vim tricks
April 5, 2007 Leave a comment
Here are some tricks in everyone’s favorite editor, vim.
In command mode
To indent a file:
=G
To indent between matching brackets (go over the bracket)
=%
To copy to the X clipboard or Windows clipboard using the keyboard (as opposed to the vim clipboard)
I normally highlight the text using ‘v’ to go into visual mode and then
“+y
To copy to the X clipboard, I’ve found it can be easier than the crossed out jazz to set your terminal short cuts . I tend to use CTRL+SHIFT+C for copy, CTRL+SHIFT+V for paste. This also has the advantage of working regardless of editor.
These can be handy!