From 0ddb7f6ffdae9fb5c7d5936aa0992ef46c8123ca Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 12 May 2017 23:33:37 +0200 Subject: Python requirement made optional --- vimrc-full | 155 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 89 insertions(+), 66 deletions(-) diff --git a/vimrc-full b/vimrc-full index b7b4ada..f4f6f29 100644 --- a/vimrc-full +++ b/vimrc-full @@ -1,4 +1,4 @@ -" vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 +" vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160 colorcolum=120 set t_Co=256 | " required on some ssh sessions " set background=light | " @@ -91,14 +91,16 @@ nnoremap :TagbarToggle| " bind TagBar to Hotkey Ct Plug 'vim-airline/vim-airline' | " beautification of the mode line set laststatus=2 | " required by AirLine, without status line does not appear until a window split set background=light -let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace'] +let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace', 'ycm'] let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] -" let g:airline_section_c = "" | " was: %F +let g:airline_section_c = "" | " was: %F let g:airline#extensions#tagbar#flags = 'f' | " even though the airline extension is off this controls :h tagbar-extend -let g:airline#extensions#tabline#left_sep = ' ' -let g:airline#extensions#tabline#left_alt_sep = ' | ' -let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path -let g:airline#extensions#tabline#disable_refresh = 1 | +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#fnamemod = ':t' | " let airline just show the filename without its path +let g:airline#extensions#tabline#disable_refresh = 0 | let g:airline#extensions#tabline#enabled = 1 | let g:airline#extensions#tabline#show_buffers = 1 | let g:airline#extensions#tabline#show_tabs = 0 | @@ -107,10 +109,14 @@ let g:airline#extensions#whitespace#enabled = 1 | let g:airline#extensions#wordcount#enabled = 0 | let g:airline_detect_modified = 1 | let g:airline_detect_paste = 0 | -let g:airline_exclude_preview = 1 | +let g:airline_exclude_preview = 0 | let g:airline_inactive_collapse = 1 | let g:airline_powerline_fonts = 1 | let g:airline_skip_empty_sections = 1 | +" fixes unneccessary redraw, when e.g. opening Gundo window +let airline#extensions#tabline#ignore_bufadd_pat = + \ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|preview|^$' + " AIRLINE_Theme: Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme let base16colorspace=256 @@ -135,62 +141,65 @@ Plug 'SirVer/ultisnips' " replaces loremipsum (and many m "let g:UltiSnipsJumpBackwardTrigger = ''| " \ "let g:UltiSnipsListSnippets = ''| " YouCompleteMe includes those, so this isn't necessary " -" YouCompleteMe: ====================================================================================================== -" Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... -Plug 'Valloric/YouCompleteMe' -let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window -let g:ycm_autoclose_preview_window_after_insertion = 1 -let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file -let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword -let g:ycm_complete_in_comments = 1 " Completion in comments -let g:ycm_complete_in_strings = 1 " Completion in string -let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar -let g:ycm_min_num_of_chars_for_completion = 1 -let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure -let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar -let g:ycm_confirm_extra_conf = 0 " security is overrated -let g:ycm_key_list_select_completion = [''] -let g:ycm_key_list_previous_completion = [''] -let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' -let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } -let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) - -" disable -key for YCM so that it can be used with ultisnips -" let g:ycm_key_list_select_completion=[] -" let g:ycm_key_list_previous_completion=[] -" -" Plug 'rdnetto/YCM-Generator' " you better use cmake to generate json build commands, like: -" 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file - - - -Plug 'scrooloose/syntastic' -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -let g:LatexBox_latexmk_preview_continuously = 1 -let g:LatexBox_viewer = "evince" -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 0 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 -let g:syntastic_quiet_messages = {"type":"style"} -" filter ( = do not display) style/formatting errors and warnings -let g:syntastic_error_symbol = '✖' -let g:syntastic_style_error_symbol = '✗' -let g:syntastic_warning_symbol = '➔' -let g:syntastic_style_warning_symbol = '≈' - -Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures -let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe -let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi -let g:jedi#show_call_signatures_delay = 0 -let g:jedi#auto_vim_configure = 0 -let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 -" autocmd FileType python jedi.preload_module('os', 'sys', 'math') -" let g:pymode_options_max_line_length = 120 -" let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' +if has("python") + " YouCompleteMe: ===================================================================================================== + " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... + Plug 'Valloric/YouCompleteMe' + let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window + let g:ycm_autoclose_preview_window_after_insertion = 1 + let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file + let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword + let g:ycm_complete_in_comments = 1 " Completion in comments + let g:ycm_complete_in_strings = 1 " Completion in string + let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar + let g:ycm_min_num_of_chars_for_completion = 1 + let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure + let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar + let g:ycm_confirm_extra_conf = 0 " security is overrated + let g:ycm_key_list_select_completion = [''] + let g:ycm_key_list_previous_completion = [''] + let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' + let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } + let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) + + " disable -key for YCM so that it can be used with ultisnips + " let g:ycm_key_list_select_completion=[] + " let g:ycm_key_list_previous_completion=[] + " + " Plug 'rdnetto/YCM-Generator' " you better use cmake to generate json build commands, like: + " 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file + + + " SYNTASTIC: ========================================================================================================= + Plug 'scrooloose/syntastic' + set statusline+=%#warningmsg# + set statusline+=%{SyntasticStatuslineFlag()} + let g:LatexBox_latexmk_preview_continuously = 1 + let g:LatexBox_viewer = "evince" + let g:syntastic_always_populate_loc_list = 1 + let g:syntastic_auto_loc_list = 0 + let g:syntastic_check_on_open = 1 + let g:syntastic_check_on_wq = 0 + let g:syntastic_quiet_messages = {"type":"style"} + " filter ( = do not display) style/formatting errors and warnings + let g:syntastic_error_symbol = '✖' + let g:syntastic_style_error_symbol = '✗' + let g:syntastic_warning_symbol = '➔' + let g:syntastic_style_warning_symbol = '≈' + + " JEDI: ============================================================================================================== + Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures + let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe + let g:jedi#show_call_signatures = 1 " which sadly does not support signatures like jedi + let g:jedi#show_call_signatures_delay = 0 + let g:jedi#auto_vim_configure = 0 + let g:pymode_rope = 0 " https://github.com/davidhalter/jedi-vim/issues/163 + " autocmd FileType python jedi.preload_module('os', 'sys', 'math') + " let g:pymode_options_max_line_length = 120 + " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' +endif call plug#end() | " all plugins are getting loaded on this line, don't remove! @@ -222,6 +231,7 @@ function! ExtendColorTheme() highlight! link VertSplit LineNr highlight! SpellBad ctermbg=none highlight! SpecialKey ctermfg=19 + highlight! WhiteSpace ctermfg=19 endfunction autocmd ColorScheme * call ExtendColorTheme() @@ -267,6 +277,7 @@ set complete+=i | " scan current and included files for completion set concealcursor=nc | " limits the display of concealed text to normal and command mode set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) set confirm | " asks 'do you want to save?' +set cpoptions+=P | " makes :w filename set the current buffer to filename set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) set hlsearch | " highlights all search matches (not as performant!) @@ -289,7 +300,7 @@ set relativenumber | " relative line numbers can speed up navigation set noshowmode | " because we are using some powerline derivat set nostartofline | " when scrolling: do not move the cursor to column 1 set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals -set ttimeoutlen=10 | " set esc key timeout in ms- +set ttimeoutlen=50 | " set esc key timeout in ms- set nowrap | " but do not (by default) wrap long lines around set number | " turn line numbers on/off (performance decreases when they are shown) 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) set tags+=../tags " set textwidth=100 | " line length (80 used to be default, but...) set textwidth=120 | " better done with modeline -set colorcolumn= | " not used, because we have a :match directive for textwidth +" set colorcolumn= | " not used, because we have a :match directive for textwidth set ts=4 sts=4 sw=4 expandtab | " better done with a modeline set updatetime=1000 | " updates the screen more often set writedelay=0 set wildmenu | " use a menu in the command line +set wildmode=longest:full | " do not preselect any entry and show all possible "======================================================================================================================= " set fillchars+=stlnc:\― | " @@ -346,7 +358,8 @@ end if has('cscope') " compiled with cscope support? " http://vim.wikia.com/wiki/Cscope - set cscopetag cscopeverbose + set cscopetag | " CTRL-] uses cscope instead of tags to search for the symbol + set cscopeverbose if has('quickfix') set cscopequickfix=s-,c-,d-,i-,t-,e- @@ -429,7 +442,7 @@ if has("autocmd") autocmd FileType vim setlocal keywordprg=:help |. autocmd FileType c,cpp setlocal equalprg=clang-format autocmd FileType c,cpp setlocal breakat-=- - autocmd FileType c,cpp setlocal iskeyword-=_ + " autocmd FileType c,cpp setlocal iskeyword-=_ " keyboard mapping for xml alike languages " Alt-Up : Move cursor up one tag @@ -543,6 +556,16 @@ inoremap vnoremap < >gv +" make shift-home select to the beginning of the line +nnoremap v^ +nnoremap v$ + +nnoremap vj +vnoremap j +nnoremap vk +vnoremap k + + " close current buffer with q... nnoremap q :bpspbnbd. -- cgit v1.2.3