Showing posts with label tricks. Show all posts
Showing posts with label tricks. Show all posts

Font and Font Size in gvim

Friday, April 2, 2010

Edit ~/.gvimrc and put the following lines:

set guifont=*
set guifont=Courier\ 10\ Pitch\ 12

Here "Courier 10 Pitch" is the name of the font and 12 is the font size.

Read more...

less and vim

When you are "lessing" a file, just type :gv to open the file in vim for editing. Upon quitting vim, it will return back to the less-view.

Read more...

Copying from external clipboard in gvim

Sunday, February 28, 2010

Normally, to copy from inside vim 'yy' and 'p' works. But if you are copying from an external application (say web browser or some other editor) it will not work. The easiest way is to do Edit->Paste.

But, to make life easier, we can remap it. Put this in ~/.vimrc
map "+gP

Further, to copy from vim to external clipboard, add this too:
map "+y

Now Ctrl+c and Ctrl+v works for copy paste in vim.

Read more...

vim tricks: jumping between preprocessor directives

Sunday, May 3, 2009

If you are somewhere in the code between a #if and a #endif:

  • You can jump to the #if part by using [#
  • You can jump to the #endif part using ]#
The alternate, and the generic option (which can jump between braces, #directives etc.) is the % key.

Read more...