diff options
| -rw-r--r-- | vimrc-full | 151 |
1 files changed, 69 insertions, 82 deletions
| @@ -3,17 +3,39 @@ | |||
| 3 | "======================================================================================================================= | 3 | "======================================================================================================================= |
| 4 | " GENERAL: | 4 | " GENERAL: |
| 5 | "======================================================================================================================= | 5 | "======================================================================================================================= |
| 6 | |||
| 7 | set textwidth=120 | " better done with modeline | 6 | set textwidth=120 | " better done with modeline |
| 8 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | 7 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline |
| 9 | set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry | 8 | set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry |
| 10 | 9 | ||
| 10 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | ||
| 11 | if filereadable('macros/editexisting') | ||
| 12 | silent :runtime macros/editexisting.vim | ||
| 13 | endif | ||
| 14 | |||
| 15 | "======================================================================================================================= | ||
| 16 | " SHELL | ||
| 17 | "======================================================================================================================= | ||
| 11 | if filereadable("/bin/bash") | 18 | if filereadable("/bin/bash") |
| 12 | set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here | 19 | set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here |
| 13 | elseif filereadable("/usr/local/bin/bash") | 20 | elseif filereadable("/usr/local/bin/bash") |
| 14 | set shell=/usr/local/bin/bash | 21 | set shell=/usr/local/bin/bash |
| 15 | endif | 22 | endif |
| 16 | 23 | ||
| 24 | "======================================================================================================================= | ||
| 25 | " Persistent undo | ||
| 26 | "======================================================================================================================= | ||
| 27 | if has('persistent_undo') | ||
| 28 | if isdirectory('/dev/shm') | ||
| 29 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos | ||
| 30 | elseif isdirectory('/tmp/') | ||
| 31 | set undodir=/tmp/ | ||
| 32 | endif | ||
| 33 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) | ||
| 34 | endif | ||
| 35 | |||
| 36 | "======================================================================================================================= | ||
| 37 | " multi byte | ||
| 38 | "======================================================================================================================= | ||
| 17 | if has("multi_byte") | 39 | if has("multi_byte") |
| 18 | scriptencoding utf-8 | " tell vim that we are using utf-8 here | 40 | scriptencoding utf-8 | " tell vim that we are using utf-8 here |
| 19 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) | 41 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) |
| @@ -36,26 +58,25 @@ if has("multi_byte") | |||
| 36 | " set fillchars+=stlnc:\― | " | 58 | " set fillchars+=stlnc:\― | " |
| 37 | end | 59 | end |
| 38 | 60 | ||
| 39 | if has('persistent_undo') | ||
| 40 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) | ||
| 41 | 61 | ||
| 42 | if isdirectory('/dev/shm') | 62 | "======================================================================================================================= |
| 43 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos | 63 | " SPELL_CHECKING |
| 44 | elseif isdirectory('/tmp/') | 64 | "======================================================================================================================= |
| 45 | set undodir=/tmp/ | 65 | let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' |
| 46 | endif | 66 | set nospell | " disable spell checker by default |
| 47 | endif | 67 | set spelllang=en,de | " languages for the spell checker |
| 48 | 68 | set spellsuggest=10 | " how many words will z= suggest? | |
| 49 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | 69 | set thesaurus+=~/.vim/thesaurus/php.txt |
| 50 | if filereadable('macros/editexisting') | ||
| 51 | silent :runtime macros/editexisting.vim | ||
| 52 | endif | ||
| 53 | 70 | ||
| 71 | set dictionary=/usr/share/dict/cracklib-small | ||
| 72 | set complete+=k " make default completer <C-N> respect the dictionary | ||
| 54 | 73 | ||
| 55 | "======================================================================================================================= | 74 | "======================================================================================================================= |
| 75 | " Cscope | ||
| 76 | "======================================================================================================================= | ||
| 77 | " http://vim.wikia.com/wiki/Cscope | ||
| 56 | if has('cscope') " compiled with cscope support? | 78 | if has('cscope') " compiled with cscope support? |
| 57 | " http://vim.wikia.com/wiki/Cscope | 79 | set cscopetag " CTRL-] uses cscope first, then ctags |
| 58 | set cscopetag | " CTRL-] uses cscope first, then ctags | ||
| 59 | set cscopeverbose | 80 | set cscopeverbose |
| 60 | 81 | ||
| 61 | if has('quickfix') | 82 | if has('quickfix') |
| @@ -63,54 +84,59 @@ if has('cscope') " compiled with cscope support? | |||
| 63 | endif | 84 | endif |
| 64 | 85 | ||
| 65 | if has('menu') | 86 | if has('menu') |
| 66 | menu &CScope.add | ||
| 67 | \ :cscope add .<CR> | ||
| 68 | |||
| 69 | menu &CScope.show | ||
| 70 | \ :cscope show<CR> | ||
| 71 | |||
| 72 | menu &CScope.reset | ||
| 73 | \ :cscope reset<CR> | ||
| 74 | |||
| 75 | menu &CScope.-Sep- | ||
| 76 | \ : | ||
| 77 | |||
| 78 | menu &Cscope.find.C\ symbol | 87 | menu &Cscope.find.C\ symbol |
| 79 | \ :cscope find s <cword><CR> | 88 | \ :cscope find s <cword><CR> |
| 80 | |||
| 81 | menu &Cscope.find.definition | 89 | menu &Cscope.find.definition |
| 82 | \ :cscope find g <cword><CR> | 90 | \ :cscope find g <cword><CR> |
| 83 | |||
| 84 | menu &Cscope.find.functions\ called\ by\ this | 91 | menu &Cscope.find.functions\ called\ by\ this |
| 85 | \ :cscope find d <cword><CR> | 92 | \ :cscope find d <cword><CR> |
| 86 | |||
| 87 | menu &Cscope.find.functions\ calling\ this | 93 | menu &Cscope.find.functions\ calling\ this |
| 88 | \ :cscope find c <cword><CR> | 94 | \ :cscope find c <cword><CR> |
| 89 | |||
| 90 | menu &Cscope.find.text\ string | 95 | menu &Cscope.find.text\ string |
| 91 | \ :cscope find t <cword><CR> | 96 | \ :cscope find t <cword><CR> |
| 92 | |||
| 93 | menu &Cscope.find.egrep\ pattern | 97 | menu &Cscope.find.egrep\ pattern |
| 94 | \ :cscope find e <cword><CR> | 98 | \ :cscope find e <cword><CR> |
| 95 | |||
| 96 | menu &Cscope.find.this\ file | 99 | menu &Cscope.find.this\ file |
| 97 | \ :cscope find f <cword><CR> | 100 | \ :cscope find f <cword><CR> |
| 98 | |||
| 99 | menu &Cscope.find.files\ including\ this\ file | 101 | menu &Cscope.find.files\ including\ this\ file |
| 100 | \ :cscope find i <cword><CR> | 102 | \ :cscope find i <cword><CR> |
| 101 | |||
| 102 | menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value | 103 | menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value |
| 103 | \ :cscope find a <cword><CR> | 104 | \ :cscope find a <cword><CR> |
| 105 | menu &Cscope.-Sep- | ||
| 106 | \ : | ||
| 107 | menu &Cscope.add | ||
| 108 | \ :cscope add .<CR> | ||
| 109 | menu &Cscope.show | ||
| 110 | \ :cscope show<CR> | ||
| 111 | menu &Cscope.reset | ||
| 112 | \ :cscope reset<CR> | ||
| 104 | endif | 113 | endif |
| 105 | " cnoreabbrev csa cs add | ||
| 106 | " cnoreabbrev csf cs find | ||
| 107 | " cnoreabbrev csk cs kill | ||
| 108 | " cnoreabbrev csr cs reset | ||
| 109 | " cnoreabbrev css cs show | ||
| 110 | " cnoreabbrev csh cs help | ||
| 111 | let @c = ":cs find s <cword>" | ||
| 112 | endif | 114 | endif |
| 113 | 115 | ||
| 116 | " ======================================================================================================================= | ||
| 117 | " GUI_VERSION | ||
| 118 | " ======================================================================================================================= | ||
| 119 | if has("gui_running") | ||
| 120 | set guicursor=a:block-blinkon100 | ||
| 121 | set browsedir=buffer | ||
| 122 | set toolbar+=text | ||
| 123 | set guiheadroom=0 | ||
| 124 | set guioptions+=eig | ||
| 125 | set guioptions-=T | " toolbar | ||
| 126 | set guioptions+=c | " use console dialogs instead of popups | ||
| 127 | set guioptions+=a | " autoselect: copy&paste using middleclick | ||
| 128 | set guioptions+=m | " remove menu | ||
| 129 | set guioptions-=e | " do not display tabs | ||
| 130 | set guioptions-=L | " do not show left scrollbar | ||
| 131 | set guioptions-=r | " do not show right scrollbar | ||
| 132 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) | ||
| 133 | " set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ 10 | ||
| 134 | " set guifont=Source\ Code\ Pro\ Semi-Bold\ 10 | ||
| 135 | " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12 | ||
| 136 | set guifont=Dejavu\ Sans\ Mono\ For\ Powerline\ Semibold | ||
| 137 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END | ||
| 138 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text | ||
| 139 | endif | ||
| 114 | 140 | ||
| 115 | " ======================================================================================================================= | 141 | " ======================================================================================================================= |
| 116 | " SETTINGS: | 142 | " SETTINGS: |
| @@ -178,23 +204,6 @@ set equalalways | " do not evenly size windows when opening new or | |||
| 178 | set nocursorline | " turn visual cursor line off (improves performance) | 204 | set nocursorline | " turn visual cursor line off (improves performance) |
| 179 | "======================================================================================================================= | 205 | "======================================================================================================================= |
| 180 | 206 | ||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | "======================================================================================================================= | ||
| 185 | " SPELL_CHECKING: | ||
| 186 | "======================================================================================================================= | ||
| 187 | let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' | ||
| 188 | set nospell | " disable spell checker by default | ||
| 189 | set spelllang=en,de | " languages for the spell checker | ||
| 190 | set spellsuggest=10 | " how many words will z= suggest? | ||
| 191 | set thesaurus+=~/.vim/thesaurus/php.txt | ||
| 192 | |||
| 193 | set dictionary=/usr/share/dict/cracklib-small | ||
| 194 | set complete+=k " make default completer <C-N> respect the dictionary | ||
| 195 | |||
| 196 | |||
| 197 | |||
| 198 | if has('autocmd') | 207 | if has('autocmd') |
| 199 | " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" | 208 | " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" |
| 200 | " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7" | 209 | " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7" |
| @@ -202,28 +211,6 @@ if has('autocmd') | |||
| 202 | endif | 211 | endif |
| 203 | 212 | ||
| 204 | 213 | ||
| 205 | " GUI_VERSION: | ||
| 206 | if has("gui_running") | ||
| 207 | set guicursor=a:block-blinkon100 | ||
| 208 | set browsedir=buffer | ||
| 209 | set toolbar+=text | ||
| 210 | set guiheadroom=0 | ||
| 211 | set guioptions+=eig | ||
| 212 | set guioptions-=T | " toolbar | ||
| 213 | set guioptions+=c | " use console dialogs instead of popups | ||
| 214 | set guioptions+=a | " autoselect: copy&paste using middleclick | ||
| 215 | set guioptions+=m | " remove menu | ||
| 216 | set guioptions-=e | " do not display tabs | ||
| 217 | set guioptions-=L | " do not show left scrollbar | ||
| 218 | set guioptions-=r | " do not show right scrollbar | ||
| 219 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) | ||
| 220 | " set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ 10 | ||
| 221 | " set guifont=Source\ Code\ Pro\ Semi-Bold\ 10 | ||
| 222 | " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12 | ||
| 223 | set guifont=Dejavu\ Sans\ Mono\ For\ Powerline\ Semibold | ||
| 224 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END | ||
| 225 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text | ||
| 226 | endif | ||
| 227 | 214 | ||
| 228 | " NEOVIM_incompatible: | 215 | " NEOVIM_incompatible: |
| 229 | if !has('nvim') | " settings which have been removed from neovim | 216 | if !has('nvim') | " settings which have been removed from neovim |
