Skip to content

Instantly share code, notes, and snippets.

@zeux
Created August 4, 2012 06:44
Show Gist options
  • Save zeux/3255184 to your computer and use it in GitHub Desktop.
Save zeux/3255184 to your computer and use it in GitHub Desktop.
.vimrc
" english menu/messages (should be the first line of _vimrc!)
language C
" activate pathogen
call pathogen#infect()
" enable syntax highlighting
syntax on
" color scheme
let g:molokai_original = 1
colorscheme molokai
" customize popup menu colors
hi Pmenu guifg=#F8F8F2 guibg=#1B1D1E
hi PmenuSel guibg=#808080
hi PmenuSbar guibg=#1B1D1E
hi PmenuThumb guifg=#66D9EF
" display options
set nofoldenable number ruler showcmd showtabline=2 cmdheight=2
set guioptions-=T guioptions-=L guioptions-=r guioptions-=m guioptions+=c
if has('win32') || has('win64')
set guifont=Consolas:h10:cRUSSIAN guioptions+=m
autocmd VimEnter * set guioptions-=m " delay to avoid window restore on Windows
endif
" editing options
set hlsearch incsearch ignorecase smartcase gdefault
set autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
set backspace=indent,eol,start
set encoding=utf-8 fileencodings=ucs-bom,cp1251 fileformats+=mac
" completion options
set complete-=i complete-=t wildmenu
" put swap/undo/temp files to home directory (double slash to use unique file names)
silent! call map(['swap', 'undo'], 'mkdir($HOME."/.vim-temp/".v:val, "p")')
set backupdir=~/.vim-temp/swap// noswapfile undodir=~/.vim-temp/undo// undofile undolevels=1000
let g:netrw_home=$HOME.'/.vim-temp'
" misc options
set history=1000
set iskeyword=@,48-57,_,128-255 " treat localized characters as keywords
set switchbuf=usetab,newtab
" remove highlighting on esc
if has('win32') || has('win64') || has('gui_running')
nnoremap <Esc> :nohlsearch<CR><Esc>
endif
" opens file with position at the last edited on
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | execute "normal g'\"" | endif
" look for tags in the current directory and all ancestors
set tags=tags;/
" qgrep options
runtime plugin/qgrep.vim
let g:qgrep.switchbuf = 'usetab,newtab'
let g:qgrep.keymap['qgrep#acceptSelection("usetab,botright vsplit")'] = ['<C-CR>']
" grep support
call qgrep#replaceGrep('<project>', 'L1000')
nnoremap <silent> <A-.> :grep \b<cword>\b<CR>
" perforce support
nnoremap <silent> <C-e> :call perforce#openforedit()<CR>
set guitablabel=%{perforce#guitablabel()}
" miscellaneous
nnoremap <silent> <F9> :TagbarToggle<CR>
let g:localrc_filename = '_lvimrc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment