vim is an editor which I love to work with. I make sure, I am using the latest stable version and also from time to time explore the new features incorporated into it.
I love my customized "vim" so much that I hate to use the basic "vi" installed by default in a new aix/linux machine. Also it is tedious to install vim in those machines; every time I make a new installation on my test machine.
But as always, there is a solution to get past this problem. use "vim" installed in your local system to read/edit files located on a remote server/machine. "vim + ftp" comes to our rescue.
for e.g. if you want to open "/home/sangeek/test.txt" located in server "abc.xx.com" as a "root" user, use this command :
vim ftp://root@abc.xx.com//home/sangeek/test.txt
you will be prompted to provide the password.
Alternately if you already have "vim" open you open the remote file in "command mode" :
:e ftp://root@abc.xx.com//home/sangeek/test.txt
That's it; a local copy of the file is made on your machine. Any edit and save you make using "vim" is also made in the remote server.
Other advantages of using "vim+ftp" to access files over remote server :
1. This is very helpful in case your remote server is very slow to access over network. Since you have a local copy of the same file; you navigation/edit in the file is very fast .. only delay the is when you save the file.
2. You don't have to authenticate for the ftp session if you want to open another file on the same remote server.
3. Best, your local vimrc settings apply to all the files opened remotely.
Saturday, October 9, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment