|
| 1 | +" |
| 2 | +" _ _(_)_ __ ___ _ __ ___ |
| 3 | +" / \ / / | '_ ` _ \| '__/ __| |
| 4 | +" \ V /| | | | | | | | | (__ |
| 5 | +" \_/ |_|_| |_| |_|_| \___| |
| 6 | +" |
| 7 | +" |
| 8 | +" Paul ADENOT -- 2011 |
| 9 | + |
| 10 | + |
| 11 | +set ch=2 |
| 12 | +let c_comment_strings=1 |
| 13 | +" Enable syntax highlighting |
| 14 | +syntax on |
| 15 | +" Highlight matched pattern when searching or replacing. |
| 16 | +set hlsearch |
| 17 | +" Show the line numbers. |
| 18 | +set number |
| 19 | +" Automatic indentation for C-like languages. |
| 20 | +set cindent |
| 21 | +" Write (=save) the file whenever it is compiled or when |
| 22 | +" the user changes files in a buffer. |
| 23 | +set autowrite |
| 24 | +" Automatic comments |
| 25 | +set formatoptions=tco |
| 26 | +set textwidth=80 |
| 27 | + |
| 28 | +" Incremental search : search befor return is typed |
| 29 | +set incsearch |
| 30 | +" Set the EOL format |
| 31 | +set fileformats=unix,dos |
| 32 | +" Tilda is set as an operator |
| 33 | +set tildeop |
| 34 | +" Search wrap around the entire file. |
| 35 | +set wrapscan |
| 36 | +" Wrap words, and break then between words only. |
| 37 | +set linebreak |
| 38 | +" Match pairs of symbols |
| 39 | +set matchpairs+=<:>":"`:` |
| 40 | +" Size of tabulatons |
| 41 | +set shiftwidth=2 |
| 42 | +set softtabstop=2 |
| 43 | +set tabstop=2 |
| 44 | +set expandtab |
| 45 | +" Color scheme. |
| 46 | +color slate |
| 47 | +" Font in GUI mode. |
| 48 | +"set guifont=Monospace\ 8 |
| 49 | +set guifont=Droid\ Sans\ Mono\ 8 |
| 50 | +set guioptions=nomenu |
| 51 | +" Remove bottom scrolling bar. |
| 52 | +set guioptions-=b |
| 53 | +" Set the background of the line where the cursor is to grey. |
| 54 | +" set cursorline |
| 55 | +" Copy visual area to paste buffer |
| 56 | +set go+=a |
| 57 | +" Press F4 to turn off highlighting and clear any message already displayed. |
| 58 | +:noremap <silent> <F4> :silent noh<Bar>echo<CR> |
| 59 | +" Set the dictionnary to french |
| 60 | +set dictionary+="/usr/share/dict/french" |
| 61 | + |
| 62 | +filetype indent on |
| 63 | + |
| 64 | +" Enable spelling check on .tex and .latex files. |
| 65 | +augroup filetypedetect |
| 66 | + au BufNewFile,BufRead *.latex setlocal spell spelllang=fr |
| 67 | + au BufNewFile,BufRead *.tex setlocal spell spelllang=fr |
| 68 | + au BufNewFile,BufRead *.rst set syntax=rest |
| 69 | + au BufNewFile,BufRead *.rst setlocal spell spelllang=fr |
| 70 | +augroup END |
| 71 | + |
| 72 | +" Set the GUI Size |
| 73 | +au GUIEnter * set lines=53 columns=84 |
| 74 | +" Set the Doxygen style comments, to ease the writing of documentation |
| 75 | +set comments=s1:/**,mb:*,ex:*/ |
| 76 | + |
| 77 | +set nocp |
| 78 | +filetype plugin on |
| 79 | + |
| 80 | +" configure tags - add additional tags here or comment out not-used ones |
| 81 | +set tags+=~/.vim/tags/cpp |
| 82 | +set tags+=~/.vim/tags/sqlite3 |
| 83 | +" build tags of your own project with Ctrl-F12 |
| 84 | +map <C-F12> :!ctags -R --sort=yes --c++-kinds=+lp --fields=+iaS --extra=+q .<CR> |
| 85 | +
|
| 86 | + |
| 87 | +" OmniCppComplete |
| 88 | +let OmniCpp_NamespaceSearch = 1 |
| 89 | +let OmniCpp_GlobalScopeSearch = 1 |
| 90 | +let OmniCpp_ShowAccess = 1 |
| 91 | +let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters |
| 92 | +let OmniCpp_MayCompleteDot = 1 " autocomplete after . |
| 93 | +let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> |
| 94 | +let OmniCpp_MayCompleteScope = 1 " autocomplete after :: |
| 95 | +let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] |
| 96 | +" automatically open and close the popup menu / preview window |
| 97 | +au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif |
| 98 | +set completeopt=menuone,menu,longest,preview |
| 99 | + |
| 100 | +autocmd FileType python set omnifunc=pythoncomplete#Complete |
| 101 | +autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS |
| 102 | +autocmd FileType html set omnifunc=htmlcomplete#CompleteTags |
| 103 | +autocmd FileType css set omnifunc=csscomplete#CompleteCSS |
| 104 | +autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags |
| 105 | +autocmd FileType php set omnifunc=phpcomplete#CompletePHP |
| 106 | +autocmd FileType c set omnifunc=ccomplete#Complete |
| 107 | + |
| 108 | +autocmd FileType * IndentGuidesEnable |
| 109 | + |
| 110 | +let mapleader = "," |
| 111 | + |
| 112 | +if exists(":Tabularize") |
| 113 | + nmap <Leader>a= :Tabularize /=<CR> |
| 114 | + vmap <Leader>a= :Tabularize /=<CR> |
| 115 | + vmap <Leader>z| :Tabularize /|<CR> |
| 116 | + vmap <Leader>z| :Tabularize /|<CR> |
| 117 | +endif |
| 118 | + |
| 119 | +let g:indent_guides_auto_colors = 1 |
| 120 | +autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#222222 |
| 121 | +autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#333333 |
| 122 | + |
| 123 | +let g:indent_guides_guide_size = 2 |
0 commit comments