VIM refreshing buffer whenever I switch to it
I'm using VIM to edit files over SCP, so reading and writing files is a very slow process.
For some reason, whenever I switch to a buffer, VIM reads it from disk. The status bar says: ~@k.
I've disabled all autocommands 开发者_开发问答in my .vimrc, and I have no autocommands for BufEnter anyway. Any idea what I might be missing?
Update: I found one culprit, a word-count macro which wasn't an auto-command. Now when I switch it's a tad faster but still slow. Status bar says ^Ww.
Update 2: I tried ZyX's answer below (Thanks!!). The results:
1) setting eventignore=all absolutely solves it; it's blazing fast. BUT 2) trying to debug it doesn't work for me.
I tried both :debug buffer scp-buffer-name
and :debug wincmd p
and got:
Entering Debug mode. Type "cont" to continue.
cmd: wincmd p
line 1: for m in filter(copy(fuf#getModeNames()), 'fuf#{v:val}#requiresOnCommandPre()')`
And then no matter what I typed (s, n, "cont"), that single line would just repeat. It's obviously related to the Fuzzy Finder plugin, which I do use quite a lot and is a key reason for me to use VIM. Any ideas?
Thanks again for your help. Much appreciated, XyZ!
ISSUE SOLVED: It was indeed Fuzzy Finder. It has a MRU-File mode which documentation notes may cause a performance issue when switching buffers. I disabled this mode and now VIM is fast again! Thanks!
First, test this behavior with set eventignore=all
. If the problem gets fixed, try to switch to scp buffer using (be sure you have unset eventignore) debug buffer scp-buffer-name
or debug wincmd p
(depending on when you see the problem), it will open debug mode and you will be able to see all autocommands it is executing (use s[tep]
or n[ext]
to move to next command, see :h >next
and :h >step
for more details).
精彩评论