每当我从vim写入.java文件时,写操作似乎会导致某种挂起。它成功写入文件,并带有
之类的消息"path/file.java" 123L, 456C written"
然后永远不会将光标返回给我。如果我按下Ctrl + C,它将在几秒钟之后返回光标....
我无法弄清楚为什么会这样。这似乎只发生在Java上。在编写python,bash,文本文件,html时,我还没有遇到过这个问题。任何vim专家都有想法吗?
这是我的.vimrc供参考:
set number
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
syntax on
set foldmethod=indent
set foldnestmax=10
set nofoldenable
set foldlevel=1
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" " required!
Bundle 'gmarik/vundle'
Bundle 'scrooloose/syntastic'
Bundle 'klen/python-mode'
Bundle 'honza/dockerfile.vim'
Bundle 'SirVer/ultisnips'
filetype plugin indent on " required!
let g:pymode_folding = 0
let g:pymode_lint_ignore = "W391"
let g:pymode_lint = 0
let g:pymode_lint_cwindow = 0
let g:pymode_run = 0
let g:pymode_rope_lookup_project = 1
let g:pymode_rope_goto_definition_bind = ''
let g:pymode_rope_goto_definition_cmd = 'e'
let python_highlight_all = 1
" Flake8 setup and shortcut
let g:syntastic_python_checkers=['flake8']
let g:syntastic_python_flake8_args='--ignore=W391'
" Set html, coffee, and javascript indent depths to 2-space.
autocmd FileType coffee,htm,html,xhtml,xml,php,javascript,mako setlocal shiftwidth=2 tabstop=2 softtabstop=2
" If you prefer the Omni-Completion tip window to close when a selection is
" made, these lines close it on movement in insert mode or when leaving
" insert mode
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
答案 0 :(得分:-1)
我遇到了同样的问题。这是因为合成插件。
在我的vimrc中添加此行解决了我的问题。
let g:syntastic_ignore_files = ['\.java$']
然后插件不会检查.java
文件的语法。