Thingy Ma Jig is the blog of Nicholas Thompson and contains any useful tips, sites and general blog-stuff which are considered interesting or handy!
Posted on 27 May 2009 in
vim
linux
How to
Ever had that situation where you've enabled :set paste
and pasted in hundred of lines of code into vim only to see it all fully left aligned? I just did… And bugger going over each line and manually indenting it! Want know how to indent a visual block of text?
So, make a visual selection of what you'd like indented (by pressing v and moving the cursor to mark the selection). Press colon to enter command mode and type "le2
". The le
command is shorthand for left align. The 2 value is an optional indent setting.
This is what I love about vim; there is always a new trick to make your life easier!