Showing posts with label vimrc. Show all posts
Showing posts with label vimrc. Show all posts

vim 101 - my vimrc

Monday, December 20, 2010

 "colorscheme ron  
"colorscheme jagadeesh
"color ir_black
colorscheme koehler
set nu
set nocindent
set hlsearch
set tabstop=4 shiftwidth=4 expandtab
set laststatus=2
"i don't want a toolbar in gvim
set guioptions-=T
"i dont want to see menu in gvim
set guioptions-=m
"map "+y
"imap "+y
"map "+gP
"imap "+gP
nmap "+g
map tnext
map tprev
map "+y
map "+x
map "+gP
imap "+y
imap "+x
imap "+gP
map gj
map gk
imap gki
imap gji
map []
map ][
imap []i
imap ][i
map gg
imap ggi
"Tab navigation
map gt
imap gta
au FileType tex set ai et tw=70 spell
au FileType c set cindent tw=80 nospell
au FileType h set cindent tw=80 nospell
au FileType cpp set cindent tw=80 nospell
autocmd BufEnter *.cu set cindent tw=80 nospell
au FileType cuh set cindent tw=80 nospell
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh set guifont=Courier\ 10\ Pitch\ 12
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh map [[
autocmd BufEnter *.c,*.C,*.cpp,*.CPP,*.h,*.H,*.cu,*.cuh map ]]
filetype plugin on
set ofu=syntaxcomplete#Complete
" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview
let c_no_if0=0

Read more...

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...

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...