Tiny Code

Tiny Code


Vim continues to amaze me

Every time I think I've learned all of Vim's tricks, it manages to surprise me with some new feature. There are two things I've discovered recently which have made it more enjoyable to use.

The first is Vim's ability to edit files on remote systems which can be reached via scp or ftp. Since I frequently need to edit files on embedded Linux systems which don't have X11 installed, this feature is a huge timesaver for me. The following commands illustrate the basic commands for either editing a file over scp or ftp.

gvim scp://username@system//home/username/filename
gvim ftp://username@system//home/username/filename

This feature is referred to as NetRW.

The other thing I discovered was completely by accident. I was using MacVIM (my favorite Mac port of the GUI version of Vim made available from the fine folks at Google) when I found I could drag the file icon off the titlebar and into a bash shell. Once dragged into the window containing the bash shell, the full pathname of the file being edited was placed on the command line. Granted this isn't something I need to do often but when I do, it saves me from having to manually type a long pathname.

No comments: