Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tips for using vim over a slow connection?

Tags:

vim

vi

ssh

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?

like image 903
Paul Wicks Avatar asked Mar 03 '09 05:03

Paul Wicks


4 Answers

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...

like image 161
Johan Avatar answered Oct 14 '22 00:10

Johan


Few things to look into.

  • :he lazyredraw
  • :he ttyfast
  • :he nofsync
like image 42
gregf Avatar answered Oct 14 '22 01:10

gregf


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.

like image 13
Christian C. Salvadó Avatar answered Oct 14 '22 02:10

Christian C. Salvadó


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:

Remotely Programming

like image 13
dreeves Avatar answered Oct 14 '22 02:10

dreeves