2012-05-29 16:12:10 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Important:
|
|
|
|
" This requries that you install https://github.com/amix/vimrc !
|
|
|
|
"
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => GUI related
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
set background=dark
|
|
|
|
|
2013-04-13 17:33:45 -04:00
|
|
|
colorscheme peaksea
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
" Set font according to system
|
|
|
|
if has("mac") || has("macunix")
|
2013-04-13 14:15:26 -04:00
|
|
|
set gfn=Menlo:h15
|
2012-05-29 16:12:10 -04:00
|
|
|
elseif has("win16") || has("win32")
|
2013-04-13 14:15:26 -04:00
|
|
|
set gfn=Bitstream\ Vera\ Sans\ Mono:h11
|
2012-05-29 16:12:10 -04:00
|
|
|
elseif has("linux")
|
2013-04-13 14:15:26 -04:00
|
|
|
set gfn=Monospace\ 11
|
2012-05-29 16:12:10 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
" Open MacVim in fullscreen mode
|
|
|
|
if has("gui_macvim")
|
|
|
|
set fuoptions=maxvert,maxhorz
|
|
|
|
au GUIEnter * set fullscreen
|
|
|
|
endif
|
|
|
|
|
2012-08-24 18:00:53 -04:00
|
|
|
" Disable scrollbars (real hackers don't use scrollbars for navigation!)
|
|
|
|
set guioptions-=r
|
|
|
|
set guioptions-=R
|
|
|
|
set guioptions-=l
|
|
|
|
set guioptions-=L
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Fast editing and reloading of vimrc configs
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2012-05-30 12:54:47 -04:00
|
|
|
map <leader>e :e! ~/.vim_runtime/my_configs.vim<cr>
|
|
|
|
autocmd! bufwritepost vimrc source ~/.vim_runtime/my_configs.vim
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Turn persistent undo on
|
|
|
|
" means that you can undo even when you close a buffer/VIM
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
try
|
2012-05-30 12:54:47 -04:00
|
|
|
set undodir=~/.vim_runtime/temp_dirs/undodir
|
2012-05-29 16:12:10 -04:00
|
|
|
set undofile
|
|
|
|
catch
|
|
|
|
endtry
|
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2012-05-29 17:32:24 -04:00
|
|
|
" => Parenthesis/bracket
|
2012-05-29 16:12:10 -04:00
|
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
|
|
|
|
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
|
|
|
|
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
|
|
|
|
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
|
|
|
|
vnoremap $q <esc>`>a'<esc>`<i'<esc>
|
|
|
|
vnoremap $e <esc>`>a"<esc>`<i"<esc>
|
|
|
|
|
|
|
|
" Map auto complete of (, ", ', [
|
|
|
|
inoremap $1 ()<esc>i
|
|
|
|
inoremap $2 []<esc>i
|
|
|
|
inoremap $3 {}<esc>i
|
|
|
|
inoremap $4 {<esc>o}<esc>O
|
|
|
|
inoremap $q ''<esc>i
|
|
|
|
inoremap $e ""<esc>i
|
|
|
|
inoremap $t <><esc>i
|
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => General abbreviations
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
|
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Omni complete functions
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Helper functions
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
func! CurrentFileDir(cmd)
|
|
|
|
return a:cmd . " " . expand("%:p:h") . "/"
|
|
|
|
endfunc
|