Showing posts with label vim. Show all posts
Showing posts with label vim. Show all posts

Tuesday, March 20, 2012

vim editing a remote file

Using scp:

vim scp://keith@linux.cs.wmu.edu//home/keith/my.file

You may have to re-enter your password each time you save the file. From http://tipotheday.com/2008/06/08/editing-remote-files-with-vim-and-scp

Thursday, August 4, 2011

auto-indent an entire source code file in VI (vim, gvim)

gg=G


=, the indent command can take motions. So, gg to get the start of the file, = to indent, G to the end of the file, gg=G.

http://stackoverflow.com/questions/506075/how-do-i-fix-the-indentation-of-an-entire-file-in-vi

Tuesday, April 27, 2010

Command shortcuts in vim (vi)

I was tired of looking this up every time, so I add this line to my ~/.vimrc file:

:cnoreabbr html runtime! syntax/2html.vim

Now in VIM, I type “:html” to create a new .html file with syntax highlighting

Followers