Created
February 10, 2013 12:43
-
-
Save TimDumol/4749483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible | |
| syntax on | |
| filetype plugin indent on | |
| set background=dark | |
| colorscheme solarized | |
| set ruler " show the line number on the bar | |
| set more " use more prompt | |
| set autoread " watch for file changes | |
| set number " line numbers | |
| set hidden | |
| set noautowrite " don't automagically write on :next | |
| set lazyredraw " don't redraw when don't have to | |
| set showmode | |
| set showcmd | |
| set nocompatible " vim, not vi | |
| " newline styles | |
| set ffs=unix,dos | |
| " Indentation | |
| set autoindent smartindent " auto/smart indent | |
| set smarttab " tab and backspace are smart | |
| set tabstop=2 " 6 spaces | |
| set shiftwidth=2 | |
| set softtabstop=2 | |
| set expandtab | |
| set shiftround | |
| set scrolloff=5 " keep at least 5 lines above/below | |
| set sidescrolloff=5 " keep at least 5 lines left/right | |
| set history=200 | |
| set backspace=indent,eol,start | |
| set linebreak | |
| set cmdheight=2 " command line two lines high | |
| set undolevels=10000 " 1000 undos | |
| set updatecount=100 " switch every 100 chars | |
| set complete=.,w,b,u,U,t,i,d " do lots of scanning on tab completion | |
| set ttyfast " we have a fast terminal | |
| set noerrorbells " No error bells please | |
| set shell=bash | |
| set fileformats=unix | |
| set ff=unix | |
| set wildmode=longest:full | |
| set wildmenu " menu has tab completion | |
| let maplocalleader=',' " all my macros start with , | |
| set laststatus=2 | |
| " searching | |
| set incsearch " incremental search | |
| set ignorecase " search ignoring case | |
| set smartcase | |
| set hlsearch " highlight the search | |
| set showmatch " show matching bracket | |
| set diffopt=filler,iwhite " ignore all whitespace and sync | |
| " backup | |
| set backup | |
| set backupdir=~/vim_backup | |
| "set viminfo=%100,'100,/100,h,\"500,:100,n~/_viminfo | |
| "set viminfo='100,f1 | |
| " | |
| set updatetime=4000 | |
| " Undo | |
| try | |
| if MySys() == "windows" | |
| set undodir=C:\Windows\Temp | |
| else | |
| set undodir=~/vimfiles_runtime/undodir | |
| endif | |
| set undofile | |
| catch | |
| endtry | |
| " spelling | |
| if v:version >= 700 | |
| " Enable spell check for text files | |
| autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en | |
| endif | |
| " tags | |
| " configure tags - add additional tags here or comment out not-used ones | |
| set tags+=~/.vim/tags/cpp | |
| set tags+=~/.vim/tags/gl | |
| set tags+=~/.vim/tags/sdl | |
| set tags+=~/.vim/tags/qt4 | |
| " build tags of your own project with Ctrl-F12 | |
| map <C-F12> :!ctags -R --sort=yes --c++-kinds=+pl --fields=+iaS --extra=+q .<CR> | |
| " 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 | |
| " File navigation | |
| set wildignore+=*.o,*.obj,*.git,*.pyc,*.pyo,*~,*.swp,*.class,*.bak | |
| " Directory browsing | |
| let g:netrw_listhide='\^\..*' | |
| let g:cssColorVimDoNotMessMyUpdatetime=1 | |
| " Vim-LaTeX | |
| set grepprg=grep\ -nH\ $* | |
| let g:tex_flavor = "latex" | |
| let g:Tex_CompileRule_dvi = "lualatex --interaction=nonstopmode $*" | |
| set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after | |
| " Syntastic | |
| let g:syntastic_cpp_compiler_options = ' -std=c++11' | |
| " Custom filetypes | |
| au BufRead,BufNewFile *.tape set filetype=ducttape | |
| au BufEnter,BufNewFile *.soy set filetype=html | |
| au BufEnter,BufNewFile *.jade set filetype=jade | |
| " Templates | |
| let g:file_template_default = {} | |
| let g:file_template_default['py'] = 'skeleton' | |
| " mappings | |
| " toggle list mode | |
| nmap <LocalLeader>tl :set list!<cr> | |
| " toggle paste mode | |
| nmap <LocalLeader>pp :set paste!<cr> | |
| "Die arrow keys! | |
| "nmap <up> <nop> | |
| "nmap <down> <nop> | |
| "nmap <left> <nop> | |
| "nmap <right> <nop> | |
| "imap <up> <nop> | |
| "imap <down> <nop> | |
| "imap <left> <nop> | |
| "imap <right> <nop> | |
| "Quick directory change | |
| nmap <LocalLeader>cd :cd %:p:h<CR>:pwd<CR> | |
| "Mark column 80 | |
| set colorcolumn=80 | |
| "Highlight long lines | |
| "match ErrorMsg '\%>80v.\+' | |
| "Insert single character | |
| function! RepeatChar(char, count) | |
| return repeat(a:char, a:count) | |
| endfunction | |
| nnoremap <space> :<C-U>exec "normal i".RepeatChar(nr2char(getchar()), v:count1)<CR> | |
| "Write and edit. | |
| function! WriteEdit(f,bang) | |
| execute "write" . a:bang . " " . a:f | |
| execute "edit " . a:f | |
| endfunction | |
| command! -bang -complete=file -nargs=1 WE :execute ':call WriteEdit(<f-args>,"<bang>")' | |
| let g:ctrlp_map = '<c-p>' | |
| let g:ctrlp_cmd = 'CtrlP' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment