好的,我需要帮助。出于某种原因,自几天以来,vim的启动速度非常慢。我调查了这个,我看到它可能是因为我的.vimrc文件。
例如,这里他们建议将autocmd行放在一个augroup块中。
https://superuser.com/questions/633790/how-to-speed-up-opening-vim-buffer
但问题是vim的保存速度很慢(即写:w)文件我正在编辑,也很慢(10-20秒)到相当(:q)。
任何帮助都会非常感激。
这是我的.vimrc文件:
set nowrap
set tabstop=4
set shiftwidth=4
set number
set bg=dark
set t_Co=256
:set expandtab
:set tabstop=3
:syntax enable
:colorscheme softblue
set backspace=indent,eol,start
augroup Perl
autocmd!
" Use perl compiler for all *.pl and *.pm files.
autocmd BufNewFile,BufRead *.pl,*.pm compiler perl
augroup END
:map <F2> :set nonumber<CR>
:map <F3> :set number<CR>
:map <F4> :set nowrap<CR>
:map <F5> :set wrap<CR>
:map <F6> :%!column -t<CR>
:map <F7> :s/torque/batch/g<CR>
:map <F8> :s/batch/torque/g<CR>
:map <F9> :%s/\(---S\d\d\d\.\)\(\S\+_R\d\.fastq\.gz\)/\1\2 \2/gc<CR>
我的启动时间日志文件。问题似乎在于打开缓冲区。 vim tmp.txt --startuptime startuptime.txt
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.012 000.012: --- VIM STARTING ---
000.164 000.152: Allocated generic buffers
000.375 000.211: locale set
000.404 000.029: GUI prepared
000.408 000.004: clipboard setup
000.420 000.012: window checked
001.497 001.077: inits 1
001.586 000.089: parsing arguments
001.588 000.002: expanding arguments
001.610 000.022: shell init
002.123 000.513: Termcap init
002.181 000.058: inits 2
002.310 000.129: init highlight
024.219 000.336 000.336: sourcing /gs/project/dmn-380-ab/software/vim/vim-7.4/share/vim/vim74/syntax/syncolor.vim
024.488 001.158 000.822: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/syntax/synload.vim
048.830 023.810 023.810: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/filetype.vim
048.990 026.275 001.307: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/syntax/syntax.vim
049.957 000.276 000.276: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/syntax/syncolor.vim
050.923 000.272 000.272: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/syntax/syncolor.vim
051.838 000.271 000.271: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/syntax/syncolor.vim
052.054 002.943 002.124: sourcing /sb/home/user/.vim/colors/softblue.vim
052.303 030.128 000.910: sourcing $HOME/.vimrc
052.320 019.882: sourcing vimrc file(s)
053.669 001.102 001.102: sourcing /sb/home/user/.vim/plugin/color_sample_pack.vim
057.634 000.170 000.170: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/getscriptPlugin.vim
058.252 000.396 000.396: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/gzip.vim
058.778 000.297 000.297: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/matchparen.vim
059.732 000.720 000.720: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/netrwPlugin.vim
060.111 000.125 000.125: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/rrhelper.vim
060.453 000.109 000.109: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/spellfile.vim
061.703 000.290 000.290: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/tarPlugin.vim
062.141 000.194 000.194: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/tohtml.vim
062.659 000.290 000.290: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/vimballPlugin.vim
063.303 000.339 000.339: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/plugin/zipPlugin.vim
063.467 007.115: loading plugins
063.491 000.024: inits 3
063.718 000.227: reading viminfo
063.961 000.243: setup clipboard
063.973 000.012: setting raw mode
064.005 000.032: start termcap
064.048 000.043: clearing screen
10698.690 000.801 000.801: sourcing /gs/project/dmn/software/vim/vim-7.4/share/vim/vim74/scripts.vim
10699.429 10634.580: opening buffers
10699.466 000.037: BufEnter autocommands
10699.469 000.003: editing files in windows
10699.600 000.131: VimEnter autocommands
10699.602 000.002: before starting main loop
10699.971 000.369: first screen update
10699.973 000.002: --- VIM STARTED ---