

Bcvi - run vi over a 'back-channel' - kree10
http://sshmenu.sourceforge.net/articles/bcvi/

======
KC8ZKF
GNU Emacs users have tramp-mode for this.
<http://www.emacswiki.org/emacs/TrampMode>

~~~
jrockway
And it works with EShell:

    
    
         /home/jon
         $ hostname
         snowball2
    
         /home/jon
         $ cd /stonepath:~
    
         /scp:stonepath:/home/jon
         $ hostname
         stonepath
    

Pretty cool!

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

~~~
jrockway
s/with eshell// and I agree. I prefer sshfs, but sometimes you are on Windows
and tramp is the only way.

~~~
surki
Have you enabled SSH connection sharing? If you have a connection open
already, it could leverage that (ssh does it, not tramp).

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

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

~~~
icode
"easier to set up than sshfs"

sshfs yourname@server /some/where

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

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

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

------
ertug
Vim has a scp handler to allow you to work locally.

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

~~~
jcw
Is it just me, or is SCP very slow in vim?

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

~~~
grantm
"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.

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

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

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

------
tmsh
:set paste

~~~
mct
...but then you need to ":set nopaste", afterwards.

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

~~~
vog
_...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>

------
andrew_k
Does it work on Mac?

~~~
grantm
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>

