Tips for using vim over a slow connection?

2019-01-22 19:39发布

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?

标签: vim ssh vi
15条回答
我只想做你的唯一
2楼-- · 2019-01-22 20:26

I'm not sure if this is applicable but if you're connection is at all temperamental and likely to drop out I'd use vim with "screen". screen gives you a virtual terminal which you can just reconnect to if it drops out so you're vim window is persistent.

查看更多
\"骚年 ilove
3楼-- · 2019-01-22 20:26

Slow vim startup by Depesz is probably not your case, but maybe it helps you too.

查看更多
Animai°情兽
4楼-- · 2019-01-22 20:26

do not set the option cursorline or colorcolumn. Otherwise vim will lag considerably.

查看更多
Juvenile、少年°
5楼-- · 2019-01-22 20:27

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.

查看更多
贼婆χ
6楼-- · 2019-01-22 20:27

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

查看更多
我命由我不由天
7楼-- · 2019-01-22 20:27

For repeated tasks, you can map a series of commands to a single keystroke. Lets say you want to find and replace a word (foo with bar), but not all instances of it

/foo
:map g cwbar^v^[n

Type g if you want to replace and n to skip

  • cw= change word
  • ^v = crtl+v to enable recording keystrokes like ESC and ENTER
  • ^[ = ctrl+ESC
  • n = next instance of search string
查看更多
登录 后发表回答