I think noticing a slow redrawing and slow cursor movement on a fastest PC, is one of the popular frustrations with Vim. Here I am as a yet another instance.
I have a fresh installation of VIM, with the $MYVIMRC
at the bottom.
My problem is basically a painful slowdown of cursor movements and screen redraws, which are seen often after a while when
- lot many buffers parallelly open
- a longer sessions with multiple buffers used but not immediately after I start vim. They may not be the only cases though.
This is frustrating because, the problem is not easily reproducible. I cannot debug by line by line in $VIMRC, because I don't know how long should I wait to see slow down. All that I could do over the time is to observe the two above cases.
Can some of the vim-monks quickly see where the problem is in the vimrc below? (I copied all except a heap of :nnoremap
commands that I often use)
:set nocompatible
:set regexpengine=1 "The new engine replaced with old (suggested on vi.SE)
:set foldmethod=marker "fold based on default-markers
:set foldnestmax=10 "deepest fold is 10 levels
:set nofoldenable "dont fold by default
:set noswapfile "Realized that swap troubles much more than it helps
:set number
:set wildmenu
:set guifont=Monospace\ 12
:colorscheme industry
"Make search more user-friendly
:set incsearch "Search as you go
:set hlsearch "Highlight matches
:set ignorecase "Case-insensitive searches
:set showmatch "Quickly jump to matching bracket/brace etc
%for highlighting in red all exceedingly longer lines
:au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>85v.\+', -1)
"==> This seems to be the potential culprit..
:filetype plugin on
:runtime macros/matchit.vim
:set formatoptions=tcroqlj
:au VimLeave * :mapclear
:au VimLeave * :mksession! ~/.hari_vim_session
:au VimLeave * :%normal g_lD
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'vim-scripts/tComment' " Toggle Comments -- comment/uncomment
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'bling/vim-bufferline'
"Is this bufferline the culprit? Thought it was nice!!
Plugin 'vim-scripts/vis' "Vertically selection to filters
call vundle#end()
:set lazyredraw "Don't redraw unnecessarily too many times
:set ttyfast
BTW, following
How do I debug my vimrc file? when I started vim in no-plugin no-vimrc mode, I see no slow down, but the default interface is not usable to me. I need some modifications as I did in above $MYVIMRC
. Hope you don't ask me to withdraw the whole $MYVIMRC
.
vim-bufferline
plugin. I see some performance issues on it's Github tracker.regexpengine=1
I didn't see that, somatchadd
should not be a reason of the slow down... I would still try to comment it, just to be sure.nocompatible
' affects a lot of of other settings and should be at the top of your vimrc file. See:help 'compatible
. That may not help your slowdown, but it may affect the way other settings affect the slowdown.matchadd
seems to make some significant difference as I open more and more buffers, even underregexpengine=1
. But I also havebufferline
plugin disabled. Bufferline-disabling didn't show much improvement so I disabledmatchadd
on top.