I'm using vim over a slow connection and it is a little painful. Is there anything I can do in vim to alleviate the pain?
相关问题
- JavaScript File Transfer SSH
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Why does this bash script work at console but fail
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Check if directory exists on remote machine with s
- Auto-save in VIM as you type
- Git Clone Fails: Server Certificate Verification F
- How can I use gcc's -I command to add recursiv
- Test if File/Dir exists over SSH/Sudo in Python/Ba
- Vim: overloaded mapping for multiple modes
- Can't access AWS CodeCommit with SSH
Few things to look into.
The trick to working out what is causing the performance issues is to disable everything in vim, and then slowly introduce parts back in until you work out what is causing your performance issues.
I.e. delete (or move or rename) the following files/directories to quickly disable:
C:\Program Files\Vim\_vimrc
C:\Program Files\Vim\vimfiles
C:\Program Files\Vim\vim72\autoload
C:\Program Files\Vim\vim72\plugin
On Unix/Linux/OS X, these files should exist at:
~/.vim/plugin
~/.vim/autoload
If you can't find it in either of those places, then the
:version
command can show you which.vimrc
files are being used. The plugin directory should be close by.Start up vim - it will probably look weird without any settings. But it should perform acceptably now.
Then start introducing bits back in piece-by-piece until you find out what is causing the problem.
I did this and found the following stock plugins cause problems when using Vim over a VPN:
Most of the problems these plugins introduce is adding new autocmds (like during BufEnter), which do not perform well when editing remote files. You may find you also have your own plugins which will may be causing performance problems.
I then wrote a function to delete these autocmds for when working remotely:
Put in your vimrc and see if it makes a difference.
Over a slow connection, it's painful to move the cursor character by character, because you don't get immediate visual feedback, so you always end up moving too much or too little.
So what's most effective to me is to use smarter movements and commands, like:
fx
-- jump to next letterx
5w
-- move 5 words forwardci(
-- replace what's between the parenthesesdap
-- delete current paragraphI miss those commands all the time when typing in browser's textareas, like now :)
vi was created to use over 300 baud modem, that is why there is all those funny and strange (and short) command to move and navigate. Learn them...
Play with things like
And since my keyboard has a little physical dot at the keys f and j, I use the dot on key j to easy find the vim navigation "hjkl".
But the best thing is to never ever scroll at all, search to move is a life saver. When you search your pointer ends up right at the thing you search for, meaning that those slow navigations is not needed. This is really useful if you end up editing really big files over ssh...
Are you on SSH? If so, use SSH compression.
ssh -C
should help quite a bit.Vim was designed for slow connections. Are you taking advantage of the motion commands and line selection operations? My suggestion is to learn the non-cursor key parts of Vim really well.