Tag Archives: vim

Edit a file with vim over ssh

Next step of http://blog.ledez.net/informatique/tips/editer-un-fichier-directement-en-ftp-avec-vim/

I would like to edit /etc/init.d/squid on bozzo host:

vim scp://bozzo//etc/init.d/squid

If you try with:

vim scp://bozzo/etc/init.d/squid

vim edit the file “etc/init.d/squid” in user home directory (/root/etc/squid/squid.conf in normal root account)

Delete line in vi

To delete line in vi(m) if line respect a pattern :

:g/^#/ d

Is delete comment lines

:g/^$/ d

Is delete empty lines