3

好的,我需要帮助。出于某种原因,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 启动时间.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 ---
4

0 回答 0