Showing posts with label vi. Show all posts
Showing posts with label vi. Show all posts

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