Opening files the first time is very slow in vim. I made a vim --startuptime start.log .vimrc. These are the TOP4 found in start.log

2075.385  1790.067: opening buffers

2200.133  124.203: BufEnter autocommands

117.800  082.955  062.110: sourcing $HOME/.vimrc

247.013  073.089  073.089: sourcing /home/fwagner/.vim/bundle/vim-fat-finger/plugin/fat-finger.vim 

Is there a way to speed up the buffer opening?

  • How many buffers are we talking about? Did you try without a vimrc?
    – romainl
    Aug 19, 2013 at 17:02
  • Sorry for being unclear. I just opened my .vimrc (which has ~500 lines) in the example. So opening a single file/buffer is already very slow.
    – Florian
    Aug 19, 2013 at 17:31
  • 1
    Could you post the content of your ~/.vimrc? All of it.
    – romainl
    Aug 19, 2013 at 19:52

1 Answer 1


Make sure your autocommands are grouped like this:

augroup EditVim
  autocmd BufWritePost .vimrc source $MYVIMRC
  autocmd FileType vim setlocal foldmethod=marker
augroup END

If your vimrc is being sourced multiple times for some reason and your autocommands are not cancelled with autocmd!, your BufEnter commands will be registered again and again and vim will slow to a crawl. It's one of the (many) edge cases in vim.

Check out this chapter of Learn Vimscript the Hard Way by Steve Losh for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.