如何让 coc.nvim 在插入模式下检查代码的语义?

How can i make coc.nvim check code's semantics in insert mode?

所以我正在使用 neovim(v0.4.3) 和 Coc.nvim(v0.0.79) 以及 C++ 和 C 的 clangd。问题在于语法检查仅在正常模式下突出显示错误。这意味着我必须在插入模式下键入我的语句,然后进入正常状态以查看是否有任何错误。我希望能够在插入模式下看到我的错误。所以我想知道这是否只发生在我身上,或者这是普遍现象。如果对此有任何修复,请告诉我。在这里,我包含了我的 init.vim

的一些行
syntax on "to highlight more
set noeb vb t_vb= "to remove the annoying sound
set tabstop=4 softtabstop=4 "make tab 4 spaces instead of 8
set shiftwidth=4 "so when << or >> are pressed it shifts by 4
set smartindent " better indentation
set nowrap "line continues on the screen independant of the width
set nu rnu "line numbers and relative numbers
set noswapfile
set nobackup
set undodir=~/.vim/undodir
set undofile
set incsearch "search when typing
set cursorline "cursor line highlighted
set clipboard=unnamedplus "so yanking goes to the clipboard
"set completeopt-=preview "stops ycm from showing the preview
let mapleader =" "
"opens terminal

call plug#begin('~/.vim/plugged')
Plug 'sirver/ultisnips'
Plug 'mbbill/undotree'
Plug '907th/vim-auto-save'
Plug 'jiangmiao/auto-pairs'
Plug 'preservim/nerdcommenter'
Plug 'preservim/nerdtree'
Plug 'romgrk/winteract.vim'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
Plug 'vim-airline/vim-airline' "requires installing powerline fonts found in github
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'
Plug 'Chiel92/vim-autoformat'
Plug 'hlissner/vim-multiedit'
Plug 'tpope/vim-surround'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'masukomi/vim-markdown-folding'
Plug 'tpope/vim-markdown' "to highlight fenced code in md
Plug 'kalekundert/vim-coiled-snake'
Plug 'Konfekt/FastFold'
call plug#end()

let g:airline#extensions#tabline#enabled = 1
let g:auto_save=1 "autosave

感谢您阅读本文,希望您度过愉快的一天

在你的 coc-settings.json 中将 diagnostic.refreshOnInsertMode 设置为 true。