4 ms·
You can use it over a high latency flaky SSH connection surprisingly effectively. As a GUI editor user and generally vi(m) ignorant person I have a question
by Udo 15y ago
You can use it over a high latency flaky SSH connection
surprisingly effectively.
As a GUI editor user and generally vi(m) ignorant person I have a question about that. Flaky connections - that's where I live. Right now my typical MO is to open an SFTP connection to a remote dev server and edit the files on it by using an SFTP-capable editor. Essentially, the editor pulls the file, displays it for modification, and commits it back to the server when I press CMD-S. This works so incredibly well because the editing phase itself has no latency and saving 2-3 kB of (compressed) source doesn't take longer than a few seconds over the worst of connections.
Now, does vi(m) have a similar feature or did you mean (as I expect you did) that editing over a terminal connection to a vi instance that runs on the actual server was surprisingly effective? Because if you did mean that, you haven't seen actual bad connections yet ;-)
Don't get me wrong, I always have a Terminal window open, I love the command line. But I wouldn't use it for remote text editing unless it was an emergency. Also, I kinda like syntax highlighting in my editor.
- alrs 15y agovim has syntax highlighting.
- Udo 15y agoNot on a command line SSH connection, does it?
- dredmorbius 15y agoSure. Whether or not this extends to color depends on the terminal / termcap support at the remote end, but at the very least bolding and reverse-video should be supported. In most instances, you'll have full color syntax highlighting, though I've found I've got to down-rate my terminal. e.g.: rxvt-unicode isn't known on all systems, but rxvt, ansi, linux, or xterm generally are, and dropping past "rxvt" on that list is very, very rare.
- Udo 15y agoHmm, I never noticed that during my casual visits to vi-land. I'll definitely look into that, it's probably time to read up on how to massage vi's settings...
- burgerbrain 15y agoIf you want syntax highlighting you should be using Vim, not Vi. On many (but not all!) modern systems 'vi' will invoke Vim in compat mode forcing you to manually reenable Vim's additional features. Some modern systems come with a Vi provided by elvis or even busybox, always check what you're actually using.
- Udo 15y agoAlright, I promise I will check it out. I admit I do feel a bit behind the curve for being a programmer for so long while never really having looked into vi in depth.
- pyre 15y agoYou do realize that you can compile a termcap an set it up in ~/.terminfo, right? E.g.: % tree ~/.terminfo /home/pyre/.terminfo `-- r |-- rxvt-unicode `-- rxvt-unicode-256color
- dredmorbius 15y agoMy preference is to work as you suggest: edit locally, transmit the saved version remotely. vim even supports this with its ssh filespec, though I'll generally work, edit, and either rsync or git push these days. Sometimes, though, remote editing is where it's at for whatever reason, and vi/vim is still probably the least sucky tool for such an instance. Even if it means doing copy/paste into the remote session: :r ! cat <paste> EOF ... works surprisingly well too.
- Nate75Sanders 15y agoBy using sshfs (doesn't require any extra setup on the server side) you don't have to use an SFTP-capable editor. I edit files across a satellite connection on oceanographic vessels a few thousand miles away at sea (often 1000ms+ pings) and sshfs is wonderful and as the other poster points out, syntax highlighting working fully requires correct terminal settings
- Udo 15y agoBy using sshfs (doesn't require any extra setup on the server side) you don't have to use an SFTP-capable editor. I know, but that isn't really the point at all. Whether I need to start one program or two in order to make the connection isn't the issue (but I sure prefer it in one package). My post is about avoiding latency when working online with a retrieve-edit-store workflow as opposed to transmitting every single keystroke and screen update over the wire. And yes, as you already observed, I stand corrected on the point of syntax highlighting.
- dramaticus3 15y agoIt is a nice idea and as a Plan 9 user I can attest to its power. However The Fallacies of Distributed Computing [1] are not just whimsy. [1] http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Comput...
- eddieplan9 15y agoActually, VIm has built-in support for editing remote files over ftp, rcp, sep or http: http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vi... It's not perfect, but I prefer it to using vim inside a remote shell and waiting for cursor to move to the right point after I press a few j's.