diff options
| author | Max Christian Pohle | 2017-05-09 00:31:47 +0200 |
|---|---|---|
| committer | Max Christian Pohle | 2017-05-09 00:31:47 +0200 |
| commit | bfe2f636a6d53e8d0371550acb4666a6e243d40c (patch) | |
| tree | 8bd35da5e07fa88d631cce01f85ac840bde47f2c | |
| parent | 5abd7ac11cd7bc204b7e1a9c38e35e038f9c6b33 (diff) | |
| download | vim-bfe2f636a6d53e8d0371550acb4666a6e243d40c.tar.bz2 vim-bfe2f636a6d53e8d0371550acb4666a6e243d40c.zip | |
Performance optimization with postponed loading
| -rw-r--r-- | vimrc-full | 81 |
1 files changed, 34 insertions, 47 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | " vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 | 1 | " vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 |
| 2 | 2 | ||
| 3 | set t_Co=256 | " required on some ssh sessions | 3 | set t_Co=256 | " required on some ssh sessions |
| 4 | let &t_Co=256 | " | 4 | let &t_Co=256 | " |
| 5 | " set background=light | " | 5 | " set background=light | " |
| 6 | " set term=xtermc | " may be required on solaris | 6 | " set term=xtermc | " may be required on solaris |
| 7 | " set term=xterm-256color | 7 | " set term=xterm-256color |
| @@ -79,6 +79,9 @@ Plug 'scrooloose/nerdtree' | " | |||
| 79 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | 79 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory |
| 80 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | 80 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) |
| 81 | let NERDTreeIgnore = ['\.aux$'] | 81 | let NERDTreeIgnore = ['\.aux$'] |
| 82 | let NERDTreeMinimalUI = 1 | ||
| 83 | let NERDTreeWinSize = 40 | ||
| 84 | let NERDTreeHiddenFirst = 1 | ||
| 82 | 85 | ||
| 83 | " depending on if NERDTree has the focus: | 86 | " depending on if NERDTree has the focus: |
| 84 | nnoremap <expr> | 87 | nnoremap <expr> |
| @@ -121,8 +124,22 @@ nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ct | |||
| 121 | 124 | ||
| 122 | 125 | ||
| 123 | " Autocompleter: =====================================. | 126 | " Autocompleter: =====================================. |
| 124 | Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | 127 | " |
| 125 | Plug 'Valloric/YouCompleteMe' | 128 | " ULTISNIPS: code snippet ============================================================================================== |
| 129 | Plug 'honza/vim-snippets', {'on': [], 'for':['ultisnips']} " dependency of ultisnips (see below) | ||
| 130 | Plug 'SirVer/ultisnips', {'on': []} " replaces loremipsum (and many more) | ||
| 131 | "let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 132 | "let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ | ||
| 133 | "let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ | ||
| 134 | "let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 135 | "let g:UltiSnipsExpandTrigger = '<leader><tab>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 136 | "let g:UltiSnipsJumpForwardTrigger = '<PageDown>'| " \ | ||
| 137 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | ||
| 138 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 139 | " | ||
| 140 | " YouCompleteMe: ====================================================================================================== | ||
| 141 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
| 142 | Plug 'Valloric/YouCompleteMe', { 'on': [] } | ||
| 126 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | 143 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window |
| 127 | let g:ycm_autoclose_preview_window_after_insertion = 1 | 144 | let g:ycm_autoclose_preview_window_after_insertion = 1 |
| 128 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | 145 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file |
| @@ -140,7 +157,11 @@ let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' | |||
| 140 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | 157 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } |
| 141 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | 158 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) |
| 142 | 159 | ||
| 143 | nnoremap <F7> :YcmCompleter FixIt<CR> | 160 | autocmd InsertEnter * call plug#load('vim-snippets', 'ultisnips', 'YouCompleteMe') |
| 161 | \| call youcompleteme#Enable() | ||
| 162 | \| nnoremap <F7> :YcmCompleter FixIt<CR> | ||
| 163 | |||
| 164 | |||
| 144 | " disable <tab>-key for YCM so that it can be used with ultisnips | 165 | " disable <tab>-key for YCM so that it can be used with ultisnips |
| 145 | " let g:ycm_key_list_select_completion=[] | 166 | " let g:ycm_key_list_select_completion=[] |
| 146 | " let g:ycm_key_list_previous_completion=[] | 167 | " let g:ycm_key_list_previous_completion=[] |
| @@ -178,31 +199,6 @@ let g:pymode_rope = 0 " https://github.com/davidhalter/jedi- | |||
| 178 | " let g:pymode_options_max_line_length = 120 | 199 | " let g:pymode_options_max_line_length = 120 |
| 179 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | 200 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' |
| 180 | 201 | ||
| 181 | " ULTISNIPS: code snippet ============================================================================================== | ||
| 182 | Plug 'honza/vim-snippets' " dependency of ultisnips (see below) | ||
| 183 | Plug 'SirVer/ultisnips' " replaces loremipsum (and many more) | ||
| 184 | "let g:UltiSnipsExpandTrigger = '<C-j>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 185 | "let g:UltiSnipsJumpForwardTrigger = '<C-j>'| " \ | ||
| 186 | "let g:UltiSnipsJumpBackwardTrigger = '<C-k>'| " \ | ||
| 187 | "let g:UltiSnipsListSnippets = '<C-`>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 188 | "let g:UltiSnipsExpandTrigger = '<leader><tab>'| " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | ||
| 189 | "let g:UltiSnipsJumpForwardTrigger = '<PageDown>'| " \ | ||
| 190 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | ||
| 191 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | ||
| 192 | " UltiSnips triggering | ||
| 193 | " let g:UltiSnipsExpandTrigger = "<nop>" | ||
| 194 | " let g:ulti_expand_or_jump_res = 0 | ||
| 195 | " function ExpandSnippetOrCarriageReturn() | ||
| 196 | " let snippet = UltiSnips#ExpandSnippetOrJump() | ||
| 197 | " if g:ulti_expand_or_jump_res > 0 | ||
| 198 | " return snippet | ||
| 199 | " else | ||
| 200 | " return "\<CR>" | ||
| 201 | " endif | ||
| 202 | " endfunction | ||
| 203 | " inoremap <expr> <CR> pumvisible() ? "\<C-R>=ExpandSnippetOrCarriageReturn()\<CR>" : "\<CR>" | ||
| 204 | " set completeopt-=preview | ||
| 205 | " let g:UltiSnipsEditSplit = 'vertical' | ||
| 206 | 202 | ||
| 207 | 203 | ||
| 208 | 204 | ||
| @@ -211,12 +207,17 @@ call plug#end() | " all plugins are gettin | |||
| 211 | " END: LOADING PLUGINS | 207 | " END: LOADING PLUGINS |
| 212 | 208 | ||
| 213 | 209 | ||
| 214 | |||
| 215 | " COLORSCHEME: | 210 | " COLORSCHEME: |
| 216 | " uses the default terminal background color as background (allows transparency) | 211 | " uses the default terminal background color as background (allows transparency) |
| 217 | function! ExtendColorTheme() | 212 | function! ExtendColorTheme() |
| 218 | set background=light | 213 | " let g:colors_name="" |
| 219 | let g:colors_name="" | 214 | " set background=light |
| 215 | filetype on | ||
| 216 | filetype plugin on | ||
| 217 | filetype indent on | ||
| 218 | |||
| 219 | syntax on | " enable syntax highlighting | ||
| 220 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
| 220 | " highlight Normal ctermbg=NONE ctermfg=black | 221 | " highlight Normal ctermbg=NONE ctermfg=black |
| 221 | 222 | ||
| 222 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | 223 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE |
| @@ -229,25 +230,16 @@ function! ExtendColorTheme() | |||
| 229 | highlight! Cursor guibg=green ctermbg=yellow | 230 | highlight! Cursor guibg=green ctermbg=yellow |
| 230 | highlight! link VertSplit LineNr | 231 | highlight! link VertSplit LineNr |
| 231 | highlight! SpellBad ctermbg=none | 232 | highlight! SpellBad ctermbg=none |
| 232 | |||
| 233 | syntax on | " enable syntax highlighting | ||
| 234 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
| 235 | endfunction | 233 | endfunction |
| 236 | autocmd ColorScheme * call ExtendColorTheme() | 234 | autocmd ColorScheme * call ExtendColorTheme() |
| 237 | 235 | ||
| 238 | 236 | ||
| 239 | 237 | let g:base16_shell_path="~/.config/base16-shell/scripts" | |
| 240 | let g:base16_shell_path="/home/max/.config/base16-shell/scrips/" | ||
| 241 | let base16colorspace=256 | 238 | let base16colorspace=256 |
| 242 | if filereadable(expand("~/.vimrc_background")) | 239 | if filereadable(expand("~/.vimrc_background")) |
| 243 | source ~/.vimrc_background | 240 | source ~/.vimrc_background |
| 244 | else | 241 | else |
| 245 | colorscheme base16-phd | 242 | colorscheme base16-phd |
| 246 | " colorscheme base16-embers | ||
| 247 | " colorscheme base16-flat | ||
| 248 | " colorscheme base16-summerfruit-dark | ||
| 249 | " colorscheme base16-tommorow | ||
| 250 | " colorscheme base16-default-dark | ||
| 251 | endif | 243 | endif |
| 252 | 244 | ||
| 253 | 245 | ||
| @@ -256,9 +248,6 @@ endif | |||
| 256 | "======================================================================================================================= | 248 | "======================================================================================================================= |
| 257 | " GENERAL: | 249 | " GENERAL: |
| 258 | "======================================================================================================================= | 250 | "======================================================================================================================= |
| 259 | filetype on | ||
| 260 | filetype plugin on | ||
| 261 | filetype indent on | ||
| 262 | 251 | ||
| 263 | 252 | ||
| 264 | "======================================================================================================================= | 253 | "======================================================================================================================= |
| @@ -464,8 +453,6 @@ if has("autocmd") | |||
| 464 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | 453 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= |
| 465 | augroup END | 454 | augroup END |
| 466 | 455 | ||
| 467 | |||
| 468 | |||
| 469 | augroup ChangeIcon | 456 | augroup ChangeIcon |
| 470 | "if filereadable("/usr/bin/xseticon") | 457 | "if filereadable("/usr/bin/xseticon") |
| 471 | "if filereadable("~/.vim/nvim.png") | 458 | "if filereadable("~/.vim/nvim.png") |
