Tips for using vim over a slow connection?
Solution 1
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
:10 -> jump to line 10 7j -> move 7lines down
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...
Solution 2
Few things to look into.
- :he lazyredraw
- :he ttyfast
- :he nofsync
Solution 3
I think the best thing to do is edit it locally and transfer the file. This can be automated so that it feels like editing remotely:
http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim
See also the answers to this related question:
Solution 4
You can try setting off timeout and ttimeout, this way Vim will wait until either the complete mapping or key sequence has been received.
Or you can increase the timeoutlen value, this is the time in milliseconds waited for a key code or mapped key sequence to complete.
Solution 5
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 forward -
ci(
-- replace what's between the parentheses -
dap
-- delete current paragraph - and a long etcetera.
I miss those commands all the time when typing in browser's textareas, like now :)
Related videos on Youtube
Paul Wicks
Updated on January 20, 2020Comments
-
Paul Wicks over 4 years
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?
-
Johan about 15 yearsHow did it go? Did any tip here made your life easier? I'm a little bit curious :-)
-
-
Johan about 15 yearsSometimes the files is to big to be moved like that.
-
poundifdef about 15 years@John Fouhy I'm not sure! When running
script
with both options, the resulting file with black and white has 50 fewer characters. It looks like it is sending another couple of bytes each time the color changes. -
poundifdef about 15 years(continued) I think the CPU is a lot more limiting, however. Running
top
while editing a long html file, CPU sometimes spiked to 100% with color (and was choppy), but did not approach that at all for no-syntax. (a purely unscientific study, of course!) -
Tomato about 15 yearsExactly right. I learned vi in order to participate in newsgroups over two transatlantic hops. I was able to carry on typing in the face of 5 second lag.
-
Olathe over 10 yearsI didn't know about
:10
. Thanks! -
ruohola almost 4 years"Tips for using vim over a slow connection"
-
asgeo1 almost 4 yearsWhat's your point @ruohola ? - read my answer in full, it's about diagnosing which Vim plugins perform poorly over a remote connection, and disabling them. In my experience, that's one of the biggest issues.
-
Philip Kearns over 3 yearsGood. These are extensions of the old vi
redraw
option which I used to use when I was working on a dumb terminal over 1200 baud 30 years ago. -
DmitrySandalov over 2 years