News for hackers. Stuff that matters.
Re:Bcvi - run vi over a 'back-channel' by KC8ZKF on Friday June 04, 2010 @10:06PM (#1406186)
GNU Emacs users have tramp-mode for this. http://www.emacswiki.org/emacs/TrampMode
Re:Bcvi - run vi over a 'back-channel' by jrockway on Friday June 04, 2010 @10:22PM (#1406213)
And it works with EShell:

     /home/jon
     $ hostname
     snowball2

     /home/jon
     $ cd /stonepath:~

     /scp:stonepath:/home/jon
     $ hostname
     stonepath
Pretty cool!
Re:Bcvi - run vi over a 'back-channel' by astine on Friday June 04, 2010 @10:54PM (#1406248)
My experience using tramp with eshell is that it is painfully slow. However, most of what I would accomplish doing that can be accomplished using tramp with dired instead.
Re:Bcvi - run vi over a 'back-channel' by jrockway on Friday June 04, 2010 @11:14PM (#1406268)
s/with eshell// and I agree. I prefer sshfs, but sometimes you are on Windows and tramp is the only way.
Re:Bcvi - run vi over a 'back-channel' by surki on Saturday June 05, 2010 @01:03AM (#1406392)
Have you enabled SSH connection sharing? If you have a connection open already, it could leverage that (ssh does it, not tramp).
Re:Bcvi - run vi over a 'back-channel' by TimothyFitz on Friday June 04, 2010 @11:54PM (#1406312)
I've been doing this with sshfs (Linux/Mac) or ExpanDrive (Windows) for years, with whatever my editor of choice is for the file in question.
Re:Bcvi - run vi over a 'back-channel' by grantm on Saturday June 05, 2010 @12:06AM (#1406320)
bcvi will also let you use your editor of choice - it just happens to use gvim "out of the box".

If you're already logged into the box with SSH then being able to type 'vi file' on the server and have the editor window pop up on your workstation actually turns out to be really handy. IMHO it's easier to set up than sshfs too.

Re:Bcvi - run vi over a 'back-channel' by icode on Saturday June 05, 2010 @01:02AM (#1406390)
"easier to set up than sshfs"

sshfs yourname@server /some/where

How can the setup of bcvi be easier then this oneliner?

Re:Bcvi - run vi over a 'back-channel' by grantm on Saturday June 05, 2010 @01:48AM (#1406447)
Well 'bcvi --install server' is pretty simple and that's a one-time setup cost which survives disconnects and reboots.

But yes, of course you can do the same stuff with sshfs and if that's your preferred tool you should definitely use that.

Re:Bcvi - run vi over a 'back-channel' by vog on Saturday June 05, 2010 @09:51AM (#1406859)
You seem to imply that the "sshfs" command is the analogon to the "bcvi --install" command, which isn't true.

Rather, the "sshfs" command is the replacement for the "ssh" command, and "bcvi --install" is a complete extra step.

Re:Bcvi - run vi over a 'back-channel' by ertug on Saturday June 05, 2010 @04:25AM (#1406636)
Vim has a scp handler to allow you to work locally.

Here is how you do it: vim scp://server//path/to/document

Re:Bcvi - run vi over a 'back-channel' by jcw on Saturday June 05, 2010 @12:02PM (#1407006)
Is it just me, or is SCP very slow in vim?
Re:Bcvi - run vi over a 'back-channel' by wwortiz on Friday June 04, 2010 @11:04PM (#1406259)
I never run gvim, are there any real advantages that I am missing?

On the server I just install vim and scp -r .vim* to the server on the desktop I spend most of the time using emacs and only vim when I don't have emacs open and need to do a quick edit.

Tramp mode as stated is painfully slow and emacs doesn't really work for me in terminals as well as vim.

Re:Bcvi - run vi over a 'back-channel' by dhimes on Friday June 04, 2010 @11:18PM (#1406272)
I never run gvim, are there any real advantages that I am missing?

Probably only if you have a mouse connected to your computer. It is much easier for cutting/pasting between documents in different windows in a gui. I understand there are plugins for vi that work (I use vi most of the time), but it's easier for me to just use vim. Seems like to a first-order approximation gvim = vi + gui plugin

Re:Bcvi - run vi over a 'back-channel' by pyre on Saturday June 05, 2010 @01:24AM (#1406424)
The X11 clipboard support in vim works in the terminal, but it only works when X11 support is built in. You just have to use the keyboard shortcuts ("+y = copy / "+gP = paste).

vim has to be built with X11 (gvim) support though b/c vim and gvim are really the same binary, IIRC (gvim = vim -g).

Re:Bcvi - run vi over a 'back-channel' by dhimes on Saturday June 05, 2010 @09:59AM (#1406866)
when you compile vim this way, do you get the menus also, or is that only gvim? About the only thing I do by menu is change the color scheme, because I never remember the commands (nor the scheme names, for that matter). Different schemes can be useful for different lighting conditions and different monitors.
Re:Bcvi - run vi over a 'back-channel' by pyre on Saturday June 05, 2010 @01:48PM (#1407168)
The menus are only drawn in gvim. It doesn't draw them in the terminal like Emacs. The colorscheme command is ":colorscheme <scheme>" or ":colors <scheme>". It tab-completes to the scheme names that it has accessible to it, so you don't really need the menu. This is useful even in the terminal due to 256-color support (":set t_Co=256" if it doesn't auto-detect this for you). There are also a couple of plugins that will auto-convert gvim-only (aka fullcolor) colorschemes into 256-color schemes when you are in a 256-color terminal.
Re:Bcvi - run vi over a 'back-channel' by grantm on Friday June 04, 2010 @11:29PM (#1406282)
"I never run gvim, are there any real advantages that I am missing?"

If you're an Emacs user, probably no particular advantage. I use GVim because as a GUI app it allows me to use my mouse for stuff like selecting areas and copy/pasting. I also like the workflow of having my file open for editing in a separate window and getting my shell prompt back straight away.

Re:Bcvi - run vi over a 'back-channel' by pyre on Saturday June 05, 2010 @01:15AM (#1406409)
If you are running vim in a terminal, then try ":set mouse=a" and it will use the XTerm mouse extensions. Most terminals support this (gnome-terminal, xfce4-terminal, rxvt-unicode, xterm). I don't know about the level of support in Putty, Terminal.app or iTerm.app though.
Re:Bcvi - run vi over a 'back-channel' by camtarn on Saturday June 05, 2010 @01:47PM (#1407164)
Works pretty well in PuTTY, but you lose your local mouse support since clicks/drags are now passed straight to the server rather than selecting/copying/pasting text from PuTTY to the Windows clipboard. It's a tradeoff between easier text manipulation in vim, vs easier text transfer between the PuTTY window and other local windows (and vice versa).

However, PuTTY only switches on XTerm mouse reporting when an app needs it, so it should be easy enough to bind ":set mouse=a"/":set mouse-=a" to a hot key, and toggle mouse support on and off depending on the required operation.

Re:Bcvi - run vi over a 'back-channel' by JoshCole on Saturday June 05, 2010 @01:10AM (#1406403)
There are some terminals which support tabbed windows, and copy and paste. If you have access to those terminals, the reasons you gave for using gVim don't apply. Though I'm not really sure that being able to use the mouse for copy and paste in vim is an advantage. I thought that one of the big productivity boosts when using vim was being able to ditch the mouse. Aren't you suppose to use v[movement]"+y to get something to your clipboard?
Re:Bcvi - run vi over a 'back-channel' by pyre on Saturday June 05, 2010 @01:18AM (#1406414)
If you do want to use the mouse for selection for copy/paste, then selecting across the terminal text doesn't really work. Things like line numbers, folds, line-wrap characters and ':set list' characters end up in the selection when you don't let vim intelligently filter these things out for you.
Re:Bcvi - run vi over a 'back-channel' by surki on Saturday June 05, 2010 @12:56AM (#1406384)
... "and emacs doesn't really work for me in terminals as well as vim."

What kind of problems are you facing running emacs in terminal? I always run emacs in terminal (wrapped inside a screen session) and I have found no problem so far.

I run emacs-trunk/rxvt with 256 colors/bash. But have also used gnome-terminal.

Re:Bcvi - run vi over a 'back-channel' by pyre on Saturday June 05, 2010 @01:20AM (#1406417)
> I run emacs-trunk/rxvt with 256 colors/bash.

I suggest trying zsh.

Re:Bcvi - run vi over a 'back-channel' by phreeza on Saturday June 05, 2010 @05:18AM (#1406666)
Maybe if the server admin is an emacs fanatic and has deleted vim. And prohibits you from building it locally. err... nevermind
Re:Bcvi - run vi over a 'back-channel' by jrockway on Saturday June 05, 2010 @08:22PM (#1407730)
(make-frame-on-display ":0")
Re:Bcvi - run vi over a 'back-channel' by jcw on Saturday June 05, 2010 @12:05PM (#1407011)
This is really cool. However, one of the advantages of using vi is that you use it on any machine without really needing your configuration files, the defaults are comfortable enough.
Re:Bcvi - run vi over a 'back-channel' by tmsh on Saturday June 05, 2010 @03:38AM (#1406580)
:set paste
Re:Bcvi - run vi over a 'back-channel' by mct on Saturday June 05, 2010 @04:51AM (#1406656)
...but then you need to ":set nopaste", afterwards.

I frequently do this, instead: ":r !cat"

Re:Bcvi - run vi over a 'back-channel' by vog on Saturday June 05, 2010 @09:46AM (#1406856)
...but then you need to ":set nopaste", afterwards.

For me, it's just <F8>, then pasting, then pressing <F8> again. This works because of the following line in my .vimrc which I highly recommend:

    set pastetoggle=<F8>
Re:Bcvi - run vi over a 'back-channel' by andrew_k on Friday June 04, 2010 @11:39PM (#1406301)
Does it work on Mac?
Re:Bcvi - run vi over a 'back-channel' by grantm on Friday June 04, 2010 @11:47PM (#1406307)
If you use GVim on your mac then it should work fine.

If you use a different editor then it should be pretty easy to hack up a plugin that launches your preferred editor instead. The plugin API docs give an example of launching GNOME gedit: http://search.cpan.org/perldoc?App::BCVI::Plugins

Re:Bcvi - run vi over a 'back-channel' by newman314 on Saturday June 05, 2010 @04:09AM (#1406619)
Would be interesting to see a setup with textmate editing on the local workstation using this.
Re:Bcvi - run vi over a 'back-channel' by stevelosh on Saturday June 05, 2010 @09:46AM (#1406855)
Symlinking gvim to mvim seems to make everything work perfectly.