diff options
author | Max Christian Pohle | 2017-05-12 23:33:37 +0200 |
---|---|---|
committer | Max Christian Pohle | 2017-05-12 23:33:37 +0200 |
commit | 0ddb7f6ffdae9fb5c7d5936aa0992ef46c8123ca (patch) | |
tree | 5028f05a4b024540541756284e054da00298ed0f /vimrc-full | |
parent | 942bd0953c7c9d9c46b8d282b24ce0715968d7b1 (diff) | |
download | vim-0ddb7f6ffdae9fb5c7d5936aa0992ef46c8123ca.tar.bz2 vim-0ddb7f6ffdae9fb5c7d5936aa0992ef46c8123ca.zip |
Python requirement made optional
Diffstat (limited to 'vimrc-full')
-rw-r--r-- | vimrc-full | 155 |
1 files changed, 89 insertions, 66 deletions
@@ -1,4 +1,4 @@ | |||
1 | " vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 | 1 | " vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 colorcolum=120 |
2 | 2 | ||
3 | set t_Co=256 | " required on some ssh sessions | 3 | set t_Co=256 | " required on some ssh sessions |
4 | " set background=light | " | 4 | " set background=light | " |
@@ -91,14 +91,16 @@ nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ct | |||
91 | Plug 'vim-airline/vim-airline' | " beautification of the mode line | 91 | Plug 'vim-airline/vim-airline' | " beautification of the mode line |
92 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split | 92 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split |
93 | set background=light | 93 | set background=light |
94 | let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace'] | 94 | let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace', 'ycm'] |
95 | let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] | 95 | let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] |
96 | " let g:airline_section_c = "" | " was: %F | 96 | let g:airline_section_c = "" | " was: %F |
97 | let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend | 97 | let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend |
98 | let g:airline#extensions#tabline#left_sep = ' ' | 98 | let g:airline#extensions#tabline#left_alt_sep = '' |
99 | let g:airline#extensions#tabline#left_alt_sep = ' | ' | 99 | let g:airline#extensions#tabline#left_sep = '' |
100 | let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path | 100 | let g:airline#extensions#tabline#right_alt_sep = '' |
101 | let g:airline#extensions#tabline#disable_refresh = 1 | | 101 | let g:airline#extensions#tabline#right_sep = '' |
102 | let g:airline#extensions#tabline#fnamemod = ':t' | " let airline just show the filename without its path | ||
103 | let g:airline#extensions#tabline#disable_refresh = 0 | | ||
102 | let g:airline#extensions#tabline#enabled = 1 | | 104 | let g:airline#extensions#tabline#enabled = 1 | |
103 | let g:airline#extensions#tabline#show_buffers = 1 | | 105 | let g:airline#extensions#tabline#show_buffers = 1 | |
104 | let g:airline#extensions#tabline#show_tabs = 0 | | 106 | let g:airline#extensions#tabline#show_tabs = 0 | |
@@ -107,10 +109,14 @@ let g:airline#extensions#whitespace#enabled = 1 | | |||
107 | let g:airline#extensions#wordcount#enabled = 0 | | 109 | let g:airline#extensions#wordcount#enabled = 0 | |
108 | let g:airline_detect_modified = 1 | | 110 | let g:airline_detect_modified = 1 | |
109 | let g:airline_detect_paste = 0 | | 111 | let g:airline_detect_paste = 0 | |
110 | let g:airline_exclude_preview = 1 | | 112 | let g:airline_exclude_preview = 0 | |
111 | let g:airline_inactive_collapse = 1 | | 113 | let g:airline_inactive_collapse = 1 | |
112 | let g:airline_powerline_fonts = 1 | | 114 | let g:airline_powerline_fonts = 1 | |
113 | let g:airline_skip_empty_sections = 1 | | 115 | let g:airline_skip_empty_sections = 1 | |
116 | " fixes unneccessary redraw, when e.g. opening Gundo window | ||
117 | let airline#extensions#tabline#ignore_bufadd_pat = | ||
118 | \ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|preview|^$' | ||
119 | |||
114 | " AIRLINE_Theme: | 120 | " AIRLINE_Theme: |
115 | Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme | 121 | Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme |
116 | let base16colorspace=256 | 122 | let base16colorspace=256 |
@@ -135,62 +141,65 @@ Plug 'SirVer/ultisnips' " replaces loremipsum (and many m | |||
135 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | 141 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ |
136 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | 142 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary |
137 | " | 143 | " |
138 | " YouCompleteMe: ====================================================================================================== | ||
139 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
140 | Plug 'Valloric/YouCompleteMe' | ||
141 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
142 | let g:ycm_autoclose_preview_window_after_insertion = 1 | ||
143 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | ||
144 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
145 | let g:ycm_complete_in_comments = 1 " Completion in comments | ||
146 | let g:ycm_complete_in_strings = 1 " Completion in string | ||
147 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
148 | let g:ycm_min_num_of_chars_for_completion = 1 | ||
149 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
150 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
151 | let g:ycm_confirm_extra_conf = 0 " security is overrated | ||
152 | let g:ycm_key_list_select_completion = ['<Down>'] | ||
153 | let g:ycm_key_list_previous_completion = ['<Up>'] | ||
154 | let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' | ||
155 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
156 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | ||
157 | |||
158 | " disable <tab>-key for YCM so that it can be used with ultisnips | ||
159 | " let g:ycm_key_list_select_completion=[] | ||
160 | " let g:ycm_key_list_previous_completion=[] | ||
161 | " | ||
162 | " Plug 'rdnetto/YCM-Generator' " you better use cmake to generate json build commands, like: | ||
163 | " 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file | ||
164 | |||
165 | |||
166 | |||
167 | Plug 'scrooloose/syntastic' | ||
168 | set statusline+=%#warningmsg# | ||
169 | set statusline+=%{SyntasticStatuslineFlag()} | ||
170 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
171 | let g:LatexBox_viewer = "evince" | ||
172 | let g:syntastic_always_populate_loc_list = 1 | ||
173 | let g:syntastic_auto_loc_list = 0 | ||
174 | let g:syntastic_check_on_open = 1 | ||
175 | let g:syntastic_check_on_wq = 0 | ||
176 | let g:syntastic_quiet_messages = {"type":"style"} | ||
177 | " filter ( = do not display) style/formatting errors and warnings | ||
178 | let g:syntastic_error_symbol = '✖' | ||
179 | let g:syntastic_style_error_symbol = '✗' | ||
180 | let g:syntastic_warning_symbol = '➔' | ||
181 | let g:syntastic_style_warning_symbol = '≈' | ||
182 | |||
183 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | ||
184 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | ||
185 | let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi | ||
186 | let g:jedi#show_call_signatures_delay = 0 | ||
187 | let g:jedi#auto_vim_configure = 0 | ||
188 | let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 | ||
189 | " autocmd FileType python jedi.preload_module('os', 'sys', 'math') | ||
190 | " let g:pymode_options_max_line_length = 120 | ||
191 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | ||
192 | 144 | ||
145 | if has("python") | ||
146 | " YouCompleteMe: ===================================================================================================== | ||
147 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | ||
148 | Plug 'Valloric/YouCompleteMe' | ||
149 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
150 | let g:ycm_autoclose_preview_window_after_insertion = 1 | ||
151 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | ||
152 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
153 | let g:ycm_complete_in_comments = 1 " Completion in comments | ||
154 | let g:ycm_complete_in_strings = 1 " Completion in string | ||
155 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
156 | let g:ycm_min_num_of_chars_for_completion = 1 | ||
157 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
158 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
159 | let g:ycm_confirm_extra_conf = 0 " security is overrated | ||
160 | let g:ycm_key_list_select_completion = ['<Down>'] | ||
161 | let g:ycm_key_list_previous_completion = ['<Up>'] | ||
162 | let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' | ||
163 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
164 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | ||
165 | |||
166 | " disable <tab>-key for YCM so that it can be used with ultisnips | ||
167 | " let g:ycm_key_list_select_completion=[] | ||
168 | " let g:ycm_key_list_previous_completion=[] | ||
169 | " | ||
170 | " Plug 'rdnetto/YCM-Generator' " you better use cmake to generate json build commands, like: | ||
171 | " 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file | ||
172 | |||
173 | |||
174 | " SYNTASTIC: ========================================================================================================= | ||
175 | Plug 'scrooloose/syntastic' | ||
176 | set statusline+=%#warningmsg# | ||
177 | set statusline+=%{SyntasticStatuslineFlag()} | ||
178 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
179 | let g:LatexBox_viewer = "evince" | ||
180 | let g:syntastic_always_populate_loc_list = 1 | ||
181 | let g:syntastic_auto_loc_list = 0 | ||
182 | let g:syntastic_check_on_open = 1 | ||
183 | let g:syntastic_check_on_wq = 0 | ||
184 | let g:syntastic_quiet_messages = {"type":"style"} | ||
185 | " filter ( = do not display) style/formatting errors and warnings | ||
186 | let g:syntastic_error_symbol = '✖' | ||
187 | let g:syntastic_style_error_symbol = '✗' | ||
188 | let g:syntastic_warning_symbol = '➔' | ||
189 | let g:syntastic_style_warning_symbol = '≈' | ||
190 | |||
191 | " JEDI: ============================================================================================================== | ||
192 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | ||
193 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | ||
194 | let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi | ||
195 | let g:jedi#show_call_signatures_delay = 0 | ||
196 | let g:jedi#auto_vim_configure = 0 | ||
197 | let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 | ||
198 | " autocmd FileType python jedi.preload_module('os', 'sys', 'math') | ||
199 | " let g:pymode_options_max_line_length = 120 | ||
200 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | ||
193 | 201 | ||
202 | endif | ||
194 | 203 | ||
195 | 204 | ||
196 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | 205 | call plug#end() | " all plugins are getting loaded on this line, don't remove! |
@@ -222,6 +231,7 @@ function! ExtendColorTheme() | |||
222 | highlight! link VertSplit LineNr | 231 | highlight! link VertSplit LineNr |
223 | highlight! SpellBad ctermbg=none | 232 | highlight! SpellBad ctermbg=none |
224 | highlight! SpecialKey ctermfg=19 | 233 | highlight! SpecialKey ctermfg=19 |
234 | highlight! WhiteSpace ctermfg=19 | ||
225 | endfunction | 235 | endfunction |
226 | autocmd ColorScheme * call ExtendColorTheme() | 236 | autocmd ColorScheme * call ExtendColorTheme() |
227 | 237 | ||
@@ -267,6 +277,7 @@ set complete+=i | " scan current and included files for completion | |||
267 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | 277 | set concealcursor=nc | " limits the display of concealed text to normal and command mode |
268 | set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) | 278 | set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) |
269 | set confirm | " asks 'do you want to save?' | 279 | set confirm | " asks 'do you want to save?' |
280 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
270 | set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) | 281 | set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) |
271 | set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) | 282 | set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) |
272 | set hlsearch | " highlights all search matches (not as performant!) | 283 | set hlsearch | " highlights all search matches (not as performant!) |
@@ -289,7 +300,7 @@ set relativenumber | " relative line numbers can speed up navigation | |||
289 | set noshowmode | " because we are using some powerline derivat | 300 | set noshowmode | " because we are using some powerline derivat |
290 | set nostartofline | " when scrolling: do not move the cursor to column 1 | 301 | set nostartofline | " when scrolling: do not move the cursor to column 1 |
291 | set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals | 302 | set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals |
292 | set ttimeoutlen=10 | " set esc key timeout in ms- | 303 | set ttimeoutlen=50 | " set esc key timeout in ms- |
293 | set nowrap | " but do not (by default) wrap long lines around | 304 | set nowrap | " but do not (by default) wrap long lines around |
294 | set number | " turn line numbers on/off (performance decreases when they are shown) | 305 | set number | " turn line numbers on/off (performance decreases when they are shown) |
295 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for | 306 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for |
@@ -307,11 +318,12 @@ set winminwidth=30 | " (and all other windows, so TODO: watch out) | |||
307 | set tags+=../tags | 318 | set tags+=../tags |
308 | " set textwidth=100 | " line length (80 used to be default, but...) | 319 | " set textwidth=100 | " line length (80 used to be default, but...) |
309 | set textwidth=120 | " better done with modeline | 320 | set textwidth=120 | " better done with modeline |
310 | set colorcolumn= | " not used, because we have a :match directive for textwidth | 321 | " set colorcolumn= | " not used, because we have a :match directive for textwidth |
311 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | 322 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline |
312 | set updatetime=1000 | " updates the screen more often | 323 | set updatetime=1000 | " updates the screen more often |
313 | set writedelay=0 | 324 | set writedelay=0 |
314 | set wildmenu | " use a menu in the command line | 325 | set wildmenu | " use a menu in the command line |
326 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
315 | "======================================================================================================================= | 327 | "======================================================================================================================= |
316 | 328 | ||
317 | " set fillchars+=stlnc:\― | " | 329 | " set fillchars+=stlnc:\― | " |
@@ -346,7 +358,8 @@ end | |||
346 | 358 | ||
347 | if has('cscope') " compiled with cscope support? | 359 | if has('cscope') " compiled with cscope support? |
348 | " http://vim.wikia.com/wiki/Cscope | 360 | " http://vim.wikia.com/wiki/Cscope |
349 | set cscopetag cscopeverbose | 361 | set cscopetag | " CTRL-] uses cscope instead of tags to search for the symbol |
362 | set cscopeverbose | ||
350 | 363 | ||
351 | if has('quickfix') | 364 | if has('quickfix') |
352 | set cscopequickfix=s-,c-,d-,i-,t-,e- | 365 | set cscopequickfix=s-,c-,d-,i-,t-,e- |
@@ -429,7 +442,7 @@ if has("autocmd") | |||
429 | autocmd FileType vim setlocal keywordprg=:help |. | 442 | autocmd FileType vim setlocal keywordprg=:help |. |
430 | autocmd FileType c,cpp setlocal equalprg=clang-format | 443 | autocmd FileType c,cpp setlocal equalprg=clang-format |
431 | autocmd FileType c,cpp setlocal breakat-=- | 444 | autocmd FileType c,cpp setlocal breakat-=- |
432 | autocmd FileType c,cpp setlocal iskeyword-=_ | 445 | " autocmd FileType c,cpp setlocal iskeyword-=_ |
433 | 446 | ||
434 | " keyboard mapping for xml alike languages | 447 | " keyboard mapping for xml alike languages |
435 | " Alt-Up : Move cursor up one tag | 448 | " Alt-Up : Move cursor up one tag |
@@ -543,6 +556,16 @@ inoremap | |||
543 | vnoremap < <gv | 556 | vnoremap < <gv |
544 | vnoremap > >gv | 557 | vnoremap > >gv |
545 | 558 | ||
559 | " make shift-home select to the beginning of the line | ||
560 | nnoremap <s-home> v^ | ||
561 | nnoremap <s-end> v$ | ||
562 | |||
563 | nnoremap <s-down> vj | ||
564 | vnoremap <s-down> j | ||
565 | nnoremap <s-up> vk | ||
566 | vnoremap <s-up> k | ||
567 | |||
568 | |||
546 | " close current buffer with <leader>q... | 569 | " close current buffer with <leader>q... |
547 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | 570 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. |
548 | 571 | ||