diff options
| -rw-r--r-- | vimrc-full | 705 |
1 files changed, 373 insertions, 332 deletions
| @@ -1,12 +1,18 @@ | |||
| 1 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\!,\<,\>,\-,\& | 1 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\!,\<,\>,\-,\& |
| 2 | 2 | ||
| 3 | "======================================================================================================================= | ||
| 4 | " GENERAL: | ||
| 5 | "======================================================================================================================= | ||
| 6 | |||
| 3 | set textwidth=120 | " better done with modeline | 7 | set textwidth=120 | " better done with modeline |
| 4 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | 8 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline |
| 5 | set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry | 9 | set redrawtime=1000 | " Timeout in milliseconds for redrawing the display / CTRL+L to retry |
| 6 | 10 | ||
| 7 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | 11 | if filereadable("/bin/bash") |
| 8 | " silent :runtime macros/editexisting.vim | 12 | set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here |
| 9 | packadd! editexisting | 13 | elseif filereadable("/usr/local/bin/bash") |
| 14 | set shell=/usr/local/bin/bash | ||
| 15 | endif | ||
| 10 | 16 | ||
| 11 | if has("multi_byte") | 17 | if has("multi_byte") |
| 12 | scriptencoding utf-8 | " tell vim that we are using utf-8 here | 18 | scriptencoding utf-8 | " tell vim that we are using utf-8 here |
| @@ -30,6 +36,82 @@ if has("multi_byte") | |||
| 30 | " set fillchars+=stlnc:\― | " | 36 | " set fillchars+=stlnc:\― | " |
| 31 | end | 37 | end |
| 32 | 38 | ||
| 39 | if has('persistent_undo') | ||
| 40 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) | ||
| 41 | |||
| 42 | if isdirectory('/dev/shm') | ||
| 43 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos | ||
| 44 | elseif isdirectory('/tmp/') | ||
| 45 | set undodir=/tmp/ | ||
| 46 | endif | ||
| 47 | endif | ||
| 48 | |||
| 49 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | ||
| 50 | if filereadable('macros/editexisting') | ||
| 51 | silent :runtime macros/editexisting.vim | ||
| 52 | endif | ||
| 53 | |||
| 54 | |||
| 55 | "======================================================================================================================= | ||
| 56 | if has('cscope') " compiled with cscope support? | ||
| 57 | " http://vim.wikia.com/wiki/Cscope | ||
| 58 | set cscopetag | " CTRL-] uses cscope first, then ctags | ||
| 59 | set cscopeverbose | ||
| 60 | |||
| 61 | if has('quickfix') | ||
| 62 | set cscopequickfix=s+,c+,d+,i+,t+,e+ | ||
| 63 | endif | ||
| 64 | |||
| 65 | 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 | ||
| 79 | \ :cscope find s <cword><CR> | ||
| 80 | |||
| 81 | menu &Cscope.find.definition | ||
| 82 | \ :cscope find g <cword><CR> | ||
| 83 | |||
| 84 | menu &Cscope.find.functions\ called\ by\ this | ||
| 85 | \ :cscope find d <cword><CR> | ||
| 86 | |||
| 87 | menu &Cscope.find.functions\ calling\ this | ||
| 88 | \ :cscope find c <cword><CR> | ||
| 89 | |||
| 90 | menu &Cscope.find.text\ string | ||
| 91 | \ :cscope find t <cword><CR> | ||
| 92 | |||
| 93 | menu &Cscope.find.egrep\ pattern | ||
| 94 | \ :cscope find e <cword><CR> | ||
| 95 | |||
| 96 | menu &Cscope.find.this\ file | ||
| 97 | \ :cscope find f <cword><CR> | ||
| 98 | |||
| 99 | menu &Cscope.find.files\ including\ this\ file | ||
| 100 | \ :cscope find i <cword><CR> | ||
| 101 | |||
| 102 | menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value | ||
| 103 | \ :cscope find a <cword><CR> | ||
| 104 | 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 | ||
| 113 | |||
| 114 | |||
| 33 | " ======================================================================================================================= | 115 | " ======================================================================================================================= |
| 34 | " SETTINGS: | 116 | " SETTINGS: |
| 35 | " ======================================================================================================================= | 117 | " ======================================================================================================================= |
| @@ -96,307 +178,7 @@ set equalalways | " do not evenly size windows when opening new or | |||
| 96 | set nocursorline | " turn visual cursor line off (improves performance) | 178 | set nocursorline | " turn visual cursor line off (improves performance) |
| 97 | "======================================================================================================================= | 179 | "======================================================================================================================= |
| 98 | 180 | ||
| 99 | if has('persistent_undo') | ||
| 100 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) | ||
| 101 | |||
| 102 | if isdirectory('/dev/shm') | ||
| 103 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos | ||
| 104 | elseif isdirectory('/tmp/') | ||
| 105 | set undodir=/tmp/ | ||
| 106 | endif | ||
| 107 | endif | ||
| 108 | |||
| 109 | " START: LOADING PLUGINS | ||
| 110 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ | ||
| 111 | call plug#begin() | ||
| 112 | |||
| 113 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | ||
| 114 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
| 115 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | ||
| 116 | Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines | ||
| 117 | let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) | ||
| 118 | let g:signify_cursorhold_insert = 1 | ||
| 119 | let g:signify_cursorhold_normal = 1 | ||
| 120 | let g:signify_update_on_bufenter = 0 | ||
| 121 | let g:signify_update_on_focusgained = 1 | ||
| 122 | |||
| 123 | " TESTING: | " plugins which I am currently trying... | ||
| 124 | " Plug 'rkitover/vimpager' | ||
| 125 | " found this command instead (use as PAGER): | ||
| 126 | " man -P 'nvim -R -u NORC -c":%!col -b" -c":set buftype=nowrite filetype=man" -' ls | ||
| 127 | " | ||
| 128 | " Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases | ||
| 129 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
| 130 | |||
| 131 | " Colorschemes: | ||
| 132 | Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) | ||
| 133 | " Plug 'ryanoasis/vim-devicons' | " eye candy icons | ||
| 134 | |||
| 135 | " SCRATCH: | " Unobtrusive scratch window | ||
| 136 | Plug 'mtth/scratch.vim' | ||
| 137 | nnoremap <F2> :ScratchPreview<CR> | ||
| 138 | |||
| 139 | " BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there | ||
| 140 | Plug 'jlanzarotta/bufexplorer' | ||
| 141 | nnoremap <F12> :ToggleBufExplorer<CR> | ||
| 142 | |||
| 143 | " NERDTree: replaces NetRW, as long as it has so many bugs | ||
| 144 | Plug 'scrooloose/nerdtree' | " | ||
| 145 | let NERDTreeIgnore = ['\.aux$'] | ||
| 146 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | ||
| 147 | let NERDTreeChDirMode = 0 | ||
| 148 | let NERDTreeHiddenFirst = 1 | ||
| 149 | let NERDTreeMinimalUI = 1 | ||
| 150 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | ||
| 151 | let NERDTreeWinSize = 40 | ||
| 152 | |||
| 153 | |||
| 154 | " depending on if NERDTree has the focus: | ||
| 155 | nnoremap <expr> | ||
| 156 | \ <leader><leader> | ||
| 157 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' | ||
| 158 | nnoremap <expr> | ||
| 159 | \ <Tab> | ||
| 160 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' | ||
| 161 | nnoremap <expr> | ||
| 162 | \ <S-Tab> | ||
| 163 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' | ||
| 164 | " close NERDTree if it is the last remaining window (taken from the official documentation) | ||
| 165 | " autocmd bufenter * | ||
| 166 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | ||
| 167 | " | ||
| 168 | |||
| 169 | " Additional: ========================================. | ||
| 170 | Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages | ||
| 171 | let g:javascript_conceal_function = "ƒ" | ||
| 172 | let g:javascript_conceal_null = "ø" | ||
| 173 | let g:javascript_conceal_this = "@" | ||
| 174 | let g:javascript_conceal_return = "⇚" | ||
| 175 | let g:javascript_conceal_undefined = "¿" | ||
| 176 | let g:javascript_conceal_NaN = "ℕ" | ||
| 177 | let g:javascript_conceal_prototype = "¶" | ||
| 178 | let g:javascript_conceal_static = "•" | ||
| 179 | let g:javascript_conceal_super = "Ω" | ||
| 180 | let g:javascript_conceal_arrow_function = "⇒" | ||
| 181 | |||
| 182 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more | ||
| 183 | let g:tagbar_autoclose = 0 | ||
| 184 | let g:tagbar_autofocus = 1 | ||
| 185 | let g:tagbar_autoshowtag = 0 | ||
| 186 | let g:tagbar_compact = 1 | ||
| 187 | let g:tagbar_indent = 0 | ||
| 188 | let g:tagbar_foldlevel = 99 | ||
| 189 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L | ||
| 190 | nnoremap <F9> :TagbarToggle<CR>| " also bind TagBar to Hotkey F9 | ||
| 191 | |||
| 192 | |||
| 193 | " AIRLINE: a fancy status line ========================================================================================= | ||
| 194 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split | ||
| 195 | set background=light | ||
| 196 | |||
| 197 | Plug 'itchyny/lightline.vim' | ||
| 198 | Plug 'taohex/lightline-buffer' | ||
| 199 | |||
| 200 | " lightline-buffer ui settings | ||
| 201 | " replace these symbols with ascii characters if your environment does not support unicode | ||
| 202 | let g:lightline_buffer_logo = ' ' | ||
| 203 | let g:lightline_buffer_readonly_icon = '' | ||
| 204 | let g:lightline_buffer_modified_icon = '✭' | ||
| 205 | let g:lightline_buffer_git_icon = ' ' | ||
| 206 | let g:lightline_buffer_ellipsis_icon = '..' | ||
| 207 | let g:lightline_buffer_expand_left_icon = '◀ ' | ||
| 208 | let g:lightline_buffer_expand_right_icon = ' ▶' | ||
| 209 | let g:lightline_buffer_active_buffer_left_icon = '' | ||
| 210 | let g:lightline_buffer_active_buffer_right_icon = '' | ||
| 211 | let g:lightline_buffer_separator_icon = ' ' | ||
| 212 | |||
| 213 | " lightline-buffer function settings | ||
| 214 | let g:lightline_buffer_show_bufnr = 0 | ||
| 215 | let g:lightline_buffer_rotate = 0 | ||
| 216 | let g:lightline_buffer_fname_mod = ':t' | ||
| 217 | let g:lightline_buffer_excludes = ['vimfiler'] | ||
| 218 | let g:lightline_buffer_maxflen = 30 | ||
| 219 | let g:lightline_buffer_maxfextlen = 3 | ||
| 220 | let g:lightline_buffer_minflen = 16 | ||
| 221 | let g:lightline_buffer_minfextlen = 3 | ||
| 222 | let g:lightline_buffer_reservelen = 20 | ||
| 223 | |||
| 224 | let g:lightline = { | ||
| 225 | \ 'colorscheme': 'Tomorrow_Night_Bright', | ||
| 226 | \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, | ||
| 227 | \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, | ||
| 228 | \ 'active': { | ||
| 229 | \ 'left': [ [ 'mode', 'paste', 'readonly' ], | ||
| 230 | \ [ 'gitbranch', 'absolutepath' ], | ||
| 231 | \ [ 'tagbar' ] ], | ||
| 232 | \ 'right': [ [ 'lineinfo', 'percent' ], | ||
| 233 | \ [ 'spell', 'fileencoding', 'fileformat', 'filetype' ] ], | ||
| 234 | \ }, | ||
| 235 | \ 'tabline': { | ||
| 236 | \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], | ||
| 237 | \ 'right': [ [ 'close' ] ], | ||
| 238 | \ }, | ||
| 239 | \ 'component': { | ||
| 240 | \ 'tagbar': '%{tagbar#currenttag("%s", "", "fs")}', | ||
| 241 | \ }, | ||
| 242 | \ 'component_expand': { | ||
| 243 | \ 'buffercurrent': 'lightline#buffer#buffercurrent2', | ||
| 244 | \ }, | ||
| 245 | \ 'component_type': { | ||
| 246 | \ 'buffercurrent': 'tabsel', | ||
| 247 | \ }, | ||
| 248 | \ 'component_function': { | ||
| 249 | \ 'bufferbefore': 'lightline#buffer#bufferbefore', | ||
| 250 | \ 'bufferafter': 'lightline#buffer#bufferafter', | ||
| 251 | \ 'bufferinfo': 'lightline#buffer#bufferinfo', | ||
| 252 | \ 'getcwd': 'getcwd', | ||
| 253 | \ 'gitbranch': 'fugitive#head' | ||
| 254 | \ }, | ||
| 255 | \ } | ||
| 256 | |||
| 257 | " Autocompleter: ===================================== | ||
| 258 | if has("python") | ||
| 259 | " YouCompleteMe: ===================================================================================================== | ||
| 260 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
| 261 | Plug 'Valloric/YouCompleteMe' | ||
| 262 | " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions | ||
| 263 | let g:ycm_server_python_interpreter = "python3" | ||
| 264 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
| 265 | let g:ycm_autoclose_preview_window_after_insertion = 1 | ||
| 266 | let g:ycm_collect_identifiers_from_tags_files = 0 " Let YCM read tags from Ctags file | ||
| 267 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
| 268 | let g:ycm_complete_in_comments = 1 " Completion in comments | ||
| 269 | let g:ycm_complete_in_strings = 1 " Completion in string | ||
| 270 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
| 271 | let g:ycm_min_num_of_chars_for_completion = 1 | ||
| 272 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
| 273 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
| 274 | let g:ycm_confirm_extra_conf = 0 " security is overrated | ||
| 275 | let g:ycm_key_list_select_completion = ['<Down>'] | ||
| 276 | let g:ycm_key_list_previous_completion = ['<Up>'] | ||
| 277 | let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' | ||
| 278 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
| 279 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | ||
| 280 | " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? | ||
| 281 | |||
| 282 | " disable <tab>-key for YCM so that it can be used with ultisnips | ||
| 283 | let g:ycm_key_list_select_completion=[] | ||
| 284 | let g:ycm_key_list_previous_completion=[] | ||
| 285 | |||
| 286 | |||
| 287 | " SYNTASTIC: ========================================================================================================= | ||
| 288 | Plug 'scrooloose/syntastic' | ||
| 289 | set statusline+=%#warningmsg# | ||
| 290 | set statusline+=%{SyntasticStatuslineFlag()} | ||
| 291 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
| 292 | let g:LatexBox_viewer = "evince" | ||
| 293 | let g:syntastic_always_populate_loc_list = 1 | ||
| 294 | let g:syntastic_auto_loc_list = 0 | ||
| 295 | let g:syntastic_check_on_open = 1 | ||
| 296 | let g:syntastic_check_on_wq = 0 | ||
| 297 | " let g:syntastic_quiet_messages = {"type":"style"} | ||
| 298 | " | ||
| 299 | " E221: multiple spaces before Operator | ||
| 300 | let g:syntastic_python_flake8_args = '--max-complexity=10 --max-line-length=120 --exclude venv --doctests --exit-zero --ignore=E221' | ||
| 301 | " filter ( = do not display) style/formatting errors and warnings | ||
| 302 | let g:syntastic_error_symbol = '✖' | ||
| 303 | let g:syntastic_style_error_symbol = '✗' | ||
| 304 | let g:syntastic_warning_symbol = '➔' | ||
| 305 | let g:syntastic_style_warning_symbol = '≈' | ||
| 306 | |||
| 307 | " ULTISNIPS: code snippet ============================================================================================== | ||
| 308 | Plug 'honza/vim-snippets' " dependency of ultisnips (see below) | ||
| 309 | Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) | ||
| 310 | "let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 311 | "let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ | ||
| 312 | "let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ | ||
| 313 | "let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 314 | "let g:UltiSnipsExpandTrigger = '<leader><tab>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 315 | "let g:UltiSnipsJumpForwardTrigger = '<PageDown>'| " \ | ||
| 316 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | ||
| 317 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 318 | |||
| 319 | " Plug 'rhysd/vim-clang-format' | ||
| 320 | Plug 'kana/vim-operator-user' " dependency, which allows overriding the = operator for indentation | ||
| 321 | autocmd FileType c,cpp,objc map <buffer> = :pyf /usr/share/clang/clang-format.py<CR> | ||
| 322 | " let g:clang_format#detect_style_file = 1 | ||
| 323 | " autocmd FileType c,cpp,objc map <buffer> = <Plug>(operator-clang-format) | ||
| 324 | |||
| 325 | " JEDI: ============================================================================================================== | ||
| 326 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | ||
| 327 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | ||
| 328 | let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi | ||
| 329 | let g:jedi#show_call_signatures_delay = 0 | ||
| 330 | let g:jedi#auto_vim_configure = 0 | ||
| 331 | let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 | ||
| 332 | " autocmd FileType python jedi.preload_module('os', 'sys', 'math') | ||
| 333 | " let g:pymode_options_max_line_length = 120 | ||
| 334 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | ||
| 335 | endif | ||
| 336 | |||
| 337 | |||
| 338 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | ||
| 339 | " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | ||
| 340 | " END: LOADING PLUGINS | ||
| 341 | |||
| 342 | |||
| 343 | " COLORSCHEME: | ||
| 344 | " uses the default terminal background color as background (allows transparency) | ||
| 345 | function! ExtendColorTheme() | ||
| 346 | " let g:colors_name="" | ||
| 347 | " set background=light | ||
| 348 | filetype on | ||
| 349 | filetype plugin on | ||
| 350 | filetype indent on | ||
| 351 | |||
| 352 | syntax on | " enable syntax highlighting | ||
| 353 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
| 354 | " highlight Normal ctermbg=NONE ctermfg=black | ||
| 355 | |||
| 356 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | ||
| 357 | highlight! Pmenu ctermbg=LightYellow ctermfg=blue | ||
| 358 | highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold | ||
| 359 | |||
| 360 | highlight! link PmenuSbar Pmenu | ||
| 361 | highlight! PmenuThumb cterm=inverse | ||
| 362 | highlight! MoreMsg cterm=inverse | ||
| 363 | highlight! link Folded LineNr | ||
| 364 | highlight! Cursor guibg=#729fcf ctermbg=yellow | ||
| 365 | highlight! link VertSplit LineNr | ||
| 366 | highlight! SpellBad ctermbg=none | ||
| 367 | highlight! SpecialKey ctermfg=19 | ||
| 368 | highlight! WhiteSpace ctermfg=19 | ||
| 369 | |||
| 370 | highlight! link TabLine LineNr | ||
| 371 | highlight! TabLineSel ctermbg=blue ctermfg=black | ||
| 372 | highlight! link TabLineFill LineNr | ||
| 373 | highlight! Search ctermbg=12 ctermfg=0 | ||
| 374 | endfunction | ||
| 375 | autocmd ColorScheme * call ExtendColorTheme() | ||
| 376 | |||
| 377 | |||
| 378 | if filereadable(expand("~/.config/base16-shell/colortest")) | ||
| 379 | let g:base16_shell_path="~/.config/base16-shell/scripts" | ||
| 380 | endif | ||
| 381 | 181 | ||
| 382 | let base16colorspace=256 | ||
| 383 | if filereadable(expand("~/.vimrc_background")) | ||
| 384 | source ~/.vimrc_background | ||
| 385 | else | ||
| 386 | colorscheme base16-phd | ||
| 387 | endif | ||
| 388 | |||
| 389 | |||
| 390 | |||
| 391 | "======================================================================================================================= | ||
| 392 | " GENERAL: | ||
| 393 | "======================================================================================================================= | ||
| 394 | |||
| 395 | if filereadable("/bin/bash") | ||
| 396 | set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here | ||
| 397 | elseif filereadable("/usr/local/bin/bash") | ||
| 398 | set shell=/usr/local/bin/bash | ||
| 399 | endif | ||
| 400 | 182 | ||
| 401 | 183 | ||
| 402 | "======================================================================================================================= | 184 | "======================================================================================================================= |
| @@ -406,7 +188,7 @@ let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' | |||
| 406 | set nospell | " disable spell checker by default | 188 | set nospell | " disable spell checker by default |
| 407 | set spelllang=en,de | " languages for the spell checker | 189 | set spelllang=en,de | " languages for the spell checker |
| 408 | set spellsuggest=10 | " how many words will z= suggest? | 190 | set spellsuggest=10 | " how many words will z= suggest? |
| 409 | set thesaurus+=/home/max/.vim/thesaurus/php.txt | 191 | set thesaurus+=~/.vim/thesaurus/php.txt |
| 410 | 192 | ||
| 411 | set dictionary=/usr/share/dict/cracklib-small | 193 | set dictionary=/usr/share/dict/cracklib-small |
| 412 | set complete+=k " make default completer <C-N> respect the dictionary | 194 | set complete+=k " make default completer <C-N> respect the dictionary |
| @@ -419,24 +201,6 @@ if has('autocmd') | |||
| 419 | autocmd VimLeave * silent !echo -ne "\033]112\007" | 201 | autocmd VimLeave * silent !echo -ne "\033]112\007" |
| 420 | endif | 202 | endif |
| 421 | 203 | ||
| 422 | "======================================================================================================================= | ||
| 423 | if has('cscope') " compiled with cscope support? | ||
| 424 | " http://vim.wikia.com/wiki/Cscope | ||
| 425 | set cscopetag | " CTRL-] uses cscope first, then ctags | ||
| 426 | set cscopeverbose | ||
| 427 | |||
| 428 | if has('quickfix') | ||
| 429 | set cscopequickfix=s+,c+,d+,i+,t+,e+ | ||
| 430 | endif | ||
| 431 | |||
| 432 | " cnoreabbrev csa cs add | ||
| 433 | " cnoreabbrev csf cs find | ||
| 434 | " cnoreabbrev csk cs kill | ||
| 435 | " cnoreabbrev csr cs reset | ||
| 436 | " cnoreabbrev css cs show | ||
| 437 | " cnoreabbrev csh cs help | ||
| 438 | let @c = ":cs find s <cword>" | ||
| 439 | endif | ||
| 440 | 204 | ||
| 441 | " GUI_VERSION: | 205 | " GUI_VERSION: |
| 442 | if has("gui_running") | 206 | if has("gui_running") |
| @@ -471,6 +235,10 @@ if !has('nvim') | " settings which have been removed from neovim | |||
| 471 | " | 235 | " |
| 472 | let g:loaded_ruby_provider = 1 " disable ruby support | 236 | let g:loaded_ruby_provider = 1 " disable ruby support |
| 473 | let g:loaded_python_provider = 1 " disable pthon3 | 237 | let g:loaded_python_provider = 1 " disable pthon3 |
| 238 | |||
| 239 | if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) | ||
| 240 | autocmd BufWinLeave * call clearmatches() | ||
| 241 | endif | ||
| 474 | endif | 242 | endif |
| 475 | 243 | ||
| 476 | if has("autocmd") | 244 | if has("autocmd") |
| @@ -642,11 +410,6 @@ if has("autocmd") | |||
| 642 | 410 | ||
| 643 | menu &Verify.Highlight\ current\ file\ name | 411 | menu &Verify.Highlight\ current\ file\ name |
| 644 | \ :execute ':match ColorColumn /'.escape(expand('%:t'), '.').'/'<CR> | 412 | \ :execute ':match ColorColumn /'.escape(expand('%:t'), '.').'/'<CR> |
| 645 | |||
| 646 | |||
| 647 | menu &CScope.add | ||
| 648 | \ :cscope add .<CR> | ||
| 649 | |||
| 650 | menu &Window.-Sep- : | 413 | menu &Window.-Sep- : |
| 651 | 414 | ||
| 652 | menu &Window.Quickfix\ List | 415 | menu &Window.Quickfix\ List |
| @@ -721,9 +484,242 @@ if has('nvim') " only neovim... | |||
| 721 | nnoremap <leader>t :new +terminal<CR> | 484 | nnoremap <leader>t :new +terminal<CR> |
| 722 | endif | 485 | endif |
| 723 | 486 | ||
| 487 | |||
| 488 | |||
| 489 | " START: LOADING PLUGINS | ||
| 490 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ | ||
| 491 | call plug#begin() | ||
| 492 | |||
| 493 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | ||
| 494 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | ||
| 495 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | ||
| 496 | Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines | ||
| 497 | let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) | ||
| 498 | let g:signify_cursorhold_insert = 1 | ||
| 499 | let g:signify_cursorhold_normal = 1 | ||
| 500 | let g:signify_update_on_bufenter = 0 | ||
| 501 | let g:signify_update_on_focusgained = 1 | ||
| 502 | |||
| 503 | " TESTING: | " plugins which I am currently trying... | ||
| 504 | " Plug 'rkitover/vimpager' | ||
| 505 | " found this command instead (use as PAGER): | ||
| 506 | " man -P 'nvim -R -u NORC -c":%!col -b" -c":set buftype=nowrite filetype=man" -' ls | ||
| 507 | " | ||
| 508 | " Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases | ||
| 509 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
| 510 | |||
| 511 | " Colorschemes: | ||
| 512 | Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) | ||
| 513 | " Plug 'ryanoasis/vim-devicons' | " eye candy icons | ||
| 514 | |||
| 515 | " SCRATCH: | " Unobtrusive scratch window | ||
| 516 | Plug 'mtth/scratch.vim' | ||
| 517 | nnoremap <F2> :ScratchPreview<CR> | ||
| 518 | |||
| 519 | " BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there | ||
| 520 | Plug 'jlanzarotta/bufexplorer' | ||
| 521 | nnoremap <F12> :ToggleBufExplorer<CR> | ||
| 522 | |||
| 523 | " NERDTree: replaces NetRW, as long as it has so many bugs | ||
| 524 | Plug 'scrooloose/nerdtree' | " | ||
| 525 | let NERDTreeIgnore = ['\.aux$'] | ||
| 526 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | ||
| 527 | let NERDTreeChDirMode = 0 | ||
| 528 | let NERDTreeHiddenFirst = 1 | ||
| 529 | let NERDTreeMinimalUI = 1 | ||
| 530 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | ||
| 531 | let NERDTreeWinSize = 40 | ||
| 532 | |||
| 533 | |||
| 534 | " depending on if NERDTree has the focus: | ||
| 535 | nnoremap <expr> | ||
| 536 | \ <leader><leader> | ||
| 537 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' | ||
| 538 | nnoremap <expr> | ||
| 539 | \ <Tab> | ||
| 540 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' | ||
| 541 | nnoremap <expr> | ||
| 542 | \ <S-Tab> | ||
| 543 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' | ||
| 544 | " close NERDTree if it is the last remaining window (taken from the official documentation) | ||
| 545 | " autocmd bufenter * | ||
| 546 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | ||
| 547 | " | ||
| 548 | |||
| 549 | " Additional: ========================================. | ||
| 550 | Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages | ||
| 551 | let g:javascript_conceal_function = "ƒ" | ||
| 552 | let g:javascript_conceal_null = "ø" | ||
| 553 | let g:javascript_conceal_this = "@" | ||
| 554 | let g:javascript_conceal_return = "⇚" | ||
| 555 | let g:javascript_conceal_undefined = "¿" | ||
| 556 | let g:javascript_conceal_NaN = "ℕ" | ||
| 557 | let g:javascript_conceal_prototype = "¶" | ||
| 558 | let g:javascript_conceal_static = "•" | ||
| 559 | let g:javascript_conceal_super = "Ω" | ||
| 560 | let g:javascript_conceal_arrow_function = "⇒" | ||
| 561 | |||
| 562 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more | ||
| 563 | let g:tagbar_autoclose = 0 | ||
| 564 | let g:tagbar_autofocus = 1 | ||
| 565 | let g:tagbar_autoshowtag = 0 | ||
| 566 | let g:tagbar_compact = 1 | ||
| 567 | let g:tagbar_indent = 0 | ||
| 568 | let g:tagbar_foldlevel = 99 | ||
| 569 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L | ||
| 570 | nnoremap <F9> :TagbarToggle<CR>| " also bind TagBar to Hotkey F9 | ||
| 571 | |||
| 572 | |||
| 573 | " AIRLINE: a fancy status line ========================================================================================= | ||
| 574 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split | ||
| 575 | set background=light | ||
| 576 | |||
| 577 | Plug 'itchyny/lightline.vim' | ||
| 578 | Plug 'taohex/lightline-buffer' | ||
| 579 | |||
| 580 | " lightline-buffer ui settings | ||
| 581 | " replace these symbols with ascii characters if your environment does not support unicode | ||
| 582 | let g:lightline_buffer_logo = ' ' | ||
| 583 | let g:lightline_buffer_readonly_icon = '' | ||
| 584 | let g:lightline_buffer_modified_icon = '✭' | ||
| 585 | let g:lightline_buffer_git_icon = ' ' | ||
| 586 | let g:lightline_buffer_ellipsis_icon = '..' | ||
| 587 | let g:lightline_buffer_expand_left_icon = '◀ ' | ||
| 588 | let g:lightline_buffer_expand_right_icon = ' ▶' | ||
| 589 | let g:lightline_buffer_active_buffer_left_icon = '' | ||
| 590 | let g:lightline_buffer_active_buffer_right_icon = '' | ||
| 591 | let g:lightline_buffer_separator_icon = ' ' | ||
| 592 | |||
| 593 | " lightline-buffer function settings | ||
| 594 | let g:lightline_buffer_show_bufnr = 0 | ||
| 595 | let g:lightline_buffer_rotate = 0 | ||
| 596 | let g:lightline_buffer_fname_mod = ':t' | ||
| 597 | let g:lightline_buffer_excludes = ['vimfiler'] | ||
| 598 | let g:lightline_buffer_maxflen = 30 | ||
| 599 | let g:lightline_buffer_maxfextlen = 3 | ||
| 600 | let g:lightline_buffer_minflen = 16 | ||
| 601 | let g:lightline_buffer_minfextlen = 3 | ||
| 602 | let g:lightline_buffer_reservelen = 20 | ||
| 603 | |||
| 604 | let g:lightline = { | ||
| 605 | \ 'colorscheme': 'Tomorrow_Night_Bright', | ||
| 606 | \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, | ||
| 607 | \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }, | ||
| 608 | \ 'active': { | ||
| 609 | \ 'left': [ [ 'mode', 'paste', 'readonly' ], | ||
| 610 | \ [ 'gitbranch', 'absolutepath' ], | ||
| 611 | \ [ 'tagbar' ] ], | ||
| 612 | \ 'right': [ [ 'lineinfo', 'percent' ], | ||
| 613 | \ [ 'spell', 'fileencoding', 'fileformat', 'filetype' ] ], | ||
| 614 | \ }, | ||
| 615 | \ 'tabline': { | ||
| 616 | \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], | ||
| 617 | \ 'right': [ [ 'close' ] ], | ||
| 618 | \ }, | ||
| 619 | \ 'component': { | ||
| 620 | \ 'tagbar': '%{tagbar#currenttag("%s", "", "fs")}', | ||
| 621 | \ }, | ||
| 622 | \ 'component_expand': { | ||
| 623 | \ 'buffercurrent': 'lightline#buffer#buffercurrent2', | ||
| 624 | \ }, | ||
| 625 | \ 'component_type': { | ||
| 626 | \ 'buffercurrent': 'tabsel', | ||
| 627 | \ }, | ||
| 628 | \ 'component_function': { | ||
| 629 | \ 'bufferbefore': 'lightline#buffer#bufferbefore', | ||
| 630 | \ 'bufferafter': 'lightline#buffer#bufferafter', | ||
| 631 | \ 'bufferinfo': 'lightline#buffer#bufferinfo', | ||
| 632 | \ 'getcwd': 'getcwd', | ||
| 633 | \ 'gitbranch': 'fugitive#head' | ||
| 634 | \ }, | ||
| 635 | \ } | ||
| 636 | |||
| 637 | " Autocompleter: ===================================== | ||
| 638 | if has("python") | ||
| 639 | " YouCompleteMe: ===================================================================================================== | ||
| 640 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
| 641 | Plug 'Valloric/YouCompleteMe' | ||
| 642 | " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions | ||
| 643 | let g:ycm_server_python_interpreter = "python3" | ||
| 644 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
| 645 | let g:ycm_autoclose_preview_window_after_insertion = 1 | ||
| 646 | let g:ycm_collect_identifiers_from_tags_files = 0 " Let YCM read tags from Ctags file | ||
| 647 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
| 648 | let g:ycm_complete_in_comments = 1 " Completion in comments | ||
| 649 | let g:ycm_complete_in_strings = 1 " Completion in string | ||
| 650 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
| 651 | let g:ycm_min_num_of_chars_for_completion = 1 | ||
| 652 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
| 653 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
| 654 | let g:ycm_confirm_extra_conf = 0 " security is overrated | ||
| 655 | let g:ycm_key_list_select_completion = ['<Down>'] | ||
| 656 | let g:ycm_key_list_previous_completion = ['<Up>'] | ||
| 657 | let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' | ||
| 658 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
| 659 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | ||
| 660 | " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? | ||
| 661 | |||
| 662 | " disable <tab>-key for YCM so that it can be used with ultisnips | ||
| 663 | let g:ycm_key_list_select_completion=[] | ||
| 664 | let g:ycm_key_list_previous_completion=[] | ||
| 665 | |||
| 666 | |||
| 667 | " SYNTASTIC: ========================================================================================================= | ||
| 668 | Plug 'scrooloose/syntastic' | ||
| 669 | set statusline+=%#warningmsg# | ||
| 670 | set statusline+=%{SyntasticStatuslineFlag()} | ||
| 671 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
| 672 | let g:LatexBox_viewer = "evince" | ||
| 673 | let g:syntastic_always_populate_loc_list = 1 | ||
| 674 | let g:syntastic_auto_loc_list = 0 | ||
| 675 | let g:syntastic_check_on_open = 1 | ||
| 676 | let g:syntastic_check_on_wq = 0 | ||
| 677 | " let g:syntastic_quiet_messages = {"type":"style"} | ||
| 678 | " | ||
| 679 | " E221: multiple spaces before Operator | ||
| 680 | let g:syntastic_python_flake8_args = '--max-complexity=10 --max-line-length=120 --exclude venv --doctests --exit-zero --ignore=E221' | ||
| 681 | " filter ( = do not display) style/formatting errors and warnings | ||
| 682 | let g:syntastic_error_symbol = '✖' | ||
| 683 | let g:syntastic_style_error_symbol = '✗' | ||
| 684 | let g:syntastic_warning_symbol = '➔' | ||
| 685 | let g:syntastic_style_warning_symbol = '≈' | ||
| 686 | |||
| 687 | " ULTISNIPS: code snippet ============================================================================================== | ||
| 688 | Plug 'honza/vim-snippets' " dependency of ultisnips (see below) | ||
| 689 | Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) | ||
| 690 | "let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 691 | "let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ | ||
| 692 | "let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ | ||
| 693 | "let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 694 | "let g:UltiSnipsExpandTrigger = '<leader><tab>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 695 | "let g:UltiSnipsJumpForwardTrigger = '<PageDown>'| " \ | ||
| 696 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | ||
| 697 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 698 | |||
| 699 | " Plug 'rhysd/vim-clang-format' | ||
| 700 | Plug 'kana/vim-operator-user' " dependency, which allows overriding the = operator for indentation | ||
| 701 | autocmd FileType c,cpp,objc map <buffer> = :pyf /usr/share/clang/clang-format.py<CR> | ||
| 702 | " let g:clang_format#detect_style_file = 1 | ||
| 703 | " autocmd FileType c,cpp,objc map <buffer> = <Plug>(operator-clang-format) | ||
| 704 | |||
| 705 | " JEDI: ============================================================================================================== | ||
| 706 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | ||
| 707 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | ||
| 708 | let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi | ||
| 709 | let g:jedi#show_call_signatures_delay = 0 | ||
| 710 | let g:jedi#auto_vim_configure = 0 | ||
| 711 | let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 | ||
| 712 | " autocmd FileType python jedi.preload_module('os', 'sys', 'math') | ||
| 713 | " let g:pymode_options_max_line_length = 120 | ||
| 714 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | ||
| 715 | endif | ||
| 716 | |||
| 717 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | ||
| 718 | " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | ||
| 719 | " END: LOADING PLUGINS | ||
| 724 | " ====================================================================================================================== | 720 | " ====================================================================================================================== |
| 725 | " Deprecated with this configuration, but still useful when deactivating some Plugins | ||
| 726 | 721 | ||
| 722 | " Deprecated with this configuration, but still useful when deactivating some Plugins | ||
| 727 | " NETRW: obsolete with NERDTree | 723 | " NETRW: obsolete with NERDTree |
| 728 | let g:netrw_alto = 0 | " open files on the right | 724 | let g:netrw_alto = 0 | " open files on the right |
| 729 | let g:netrw_altv = 1 | " open files on the right | 725 | let g:netrw_altv = 1 | " open files on the right |
| @@ -737,7 +733,55 @@ let g:netrw_liststyle = 3 | " 3=tree | |||
| 737 | let g:netrw_preview = 0 | " | 733 | let g:netrw_preview = 0 | " |
| 738 | let g:netrw_winsize = 20 | " window size in percent | 734 | let g:netrw_winsize = 20 | " window size in percent |
| 739 | 735 | ||
| 736 | " ====================================================================================================================== | ||
| 737 | " COLORSCHEME: | ||
| 738 | " uses the default terminal background color as background (allows transparency) | ||
| 739 | function! ExtendColorTheme() | ||
| 740 | " let g:colors_name="" | ||
| 741 | " set background=light | ||
| 742 | filetype on | ||
| 743 | filetype plugin on | ||
| 744 | filetype indent on | ||
| 740 | 745 | ||
| 746 | syntax on | " enable syntax highlighting | ||
| 747 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
| 748 | " highlight Normal ctermbg=NONE ctermfg=black | ||
| 749 | |||
| 750 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | ||
| 751 | highlight! Pmenu ctermbg=LightYellow ctermfg=blue | ||
| 752 | highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold | ||
| 753 | |||
| 754 | highlight! link PmenuSbar Pmenu | ||
| 755 | highlight! PmenuThumb cterm=inverse | ||
| 756 | highlight! MoreMsg cterm=inverse | ||
| 757 | highlight! link Folded LineNr | ||
| 758 | highlight! Cursor guibg=#729fcf ctermbg=yellow | ||
| 759 | highlight! link VertSplit LineNr | ||
| 760 | highlight! SpellBad ctermbg=none | ||
| 761 | highlight! SpecialKey ctermfg=19 | ||
| 762 | highlight! WhiteSpace ctermfg=19 | ||
| 763 | |||
| 764 | highlight! link TabLine LineNr | ||
| 765 | highlight! TabLineSel ctermbg=blue ctermfg=black | ||
| 766 | highlight! link TabLineFill LineNr | ||
| 767 | highlight! Search ctermbg=12 ctermfg=0 | ||
| 768 | endfunction | ||
| 769 | autocmd! ColorScheme * call ExtendColorTheme() | ||
| 770 | |||
| 771 | |||
| 772 | if filereadable(expand("~/.config/base16-shell/colortest")) | ||
| 773 | let g:base16_shell_path="~/.config/base16-shell/scripts" | ||
| 774 | endif | ||
| 775 | |||
| 776 | let base16colorspace=256 | ||
| 777 | if filereadable(expand("~/.vimrc_background")) | ||
| 778 | source ~/.vimrc_background | ||
| 779 | else | ||
| 780 | colorscheme base16-phd | ||
| 781 | endif | ||
| 782 | |||
| 783 | |||
| 784 | " ====================================================================================================================== | ||
| 741 | highlight WordBold ctermbg=LightYellow ctermfg=black cterm=bold gui=bold guibg=LightYellow guifg=black | 785 | highlight WordBold ctermbg=LightYellow ctermfg=black cterm=bold gui=bold guibg=LightYellow guifg=black |
| 742 | let w:m1 = 0 | 786 | let w:m1 = 0 |
| 743 | function! HighlightWordUnderCursor() | 787 | function! HighlightWordUnderCursor() |
| @@ -751,11 +795,7 @@ function! HighlightWordUnderCursor() | |||
| 751 | silent! call matchadd('WordBold', '\<'.l:currentword.'\>', -1, w:m1) | 795 | silent! call matchadd('WordBold', '\<'.l:currentword.'\>', -1, w:m1) |
| 752 | endif | 796 | endif |
| 753 | endfunction | 797 | endfunction |
| 754 | |||
| 755 | autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() | 798 | autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() |
| 756 | if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) | ||
| 757 | autocmd BufWinLeave * call clearmatches() | ||
| 758 | endif | ||
| 759 | 799 | ||
| 760 | 800 | ||
| 761 | " avoids openin an empty buffer when restoring bufferlist from viminfo... | 801 | " avoids openin an empty buffer when restoring bufferlist from viminfo... |
| @@ -774,4 +814,5 @@ endif | |||
| 774 | " autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | 814 | " autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS |
| 775 | " autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | 815 | " autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags |
| 776 | " | 816 | " |
| 817 | " | ||
| 777 | " set termguicolors | 818 | " set termguicolors |
