我有ViM9.0和Python支持:我已经安装了Python的自动完成和语法检查。以下是我的~/..vimrc文件内容:
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
" ...
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Bundle 'Valloric/YouCompleteMe'
set clipboard=unnamed
set nu
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
"if has('gui_running')
" set background=dark
" colorscheme solarized
"else
" colorscheme zenburn
"endif
"so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim
let python_highlight_all=1
syntax on
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
set splitbelow
set splitright
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
"au BufNewFile,BufRead *.py
" \ setlocal tabstop=4 set softtabstop=4 set shiftwidth=4 set textwidth=79 set expandtab set autoindent set fileformat=unix
au FileType *.js, *.html, *.css
\ setlocal tabstop=2 set softtabstop=2 set shiftwidth=2
"au BufNewFile,BufRead *.js,*.html,*.css,*.vue
"\ set tabstop=2 |
"\ set softtabstop=2 |
"\ set shiftwidth=2
"Flagging Unnecessary Whitespace
highlight BadWhitespace ctermbg=red guibg=darkred
au FileType *.py, *.pyw, *.c, *.h match BadWhitespace /\s\+$/
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
set encoding=utf-8
"All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required为了测试Python支持,我创建了一个简单的脚本,如下图所示。它有两行奇怪的警告:缺少函数- docstring、缺少函数或方法docstring。

我怎样才能抑制这种错误/警告呢?
发布于 2022-08-26 14:06:17
没什么好担心的。这是YCM插件的正常行为:
GetDoc子命令: 显示在游标下填充了有关标识符的快速信息的预览窗口。根据文件类型的不同,这包括以下内容:
因此,当尝试执行其GetDoc功能以显示光标下的函数信息时,YCM简单地告诉您,函数testing()没有与其关联的文档。
https://stackoverflow.com/questions/73322546
复制相似问题