diff options
author | Max Christian Pohle | 2018-10-20 15:35:52 +0200 |
---|---|---|
committer | Max Christian Pohle | 2018-10-20 15:35:52 +0200 |
commit | 31f80d9c334e38e486545407ea5eb5f5cbb2f07d (patch) | |
tree | 0800e2f9c6cb7525f4353434c076b97640b16b3c /vimrc-full | |
parent | 45c3e3581b74060dae453ac097e5a4d629603393 (diff) | |
download | vim-31f80d9c334e38e486545407ea5eb5f5cbb2f07d.tar.bz2 vim-31f80d9c334e38e486545407ea5eb5f5cbb2f07d.zip |
Refactored a lot
Diffstat (limited to 'vimrc-full')
-rw-r--r-- | vimrc-full | 210 |
1 files changed, 85 insertions, 125 deletions
@@ -1,4 +1,4 @@ | |||
1 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\!,\<,\>,\-,\& number | 1 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\<,\>,\-,\& number |
2 | 2 | ||
3 | "======================================================================================================================= | 3 | "======================================================================================================================= |
4 | " GENERAL: | 4 | " GENERAL: |
@@ -64,7 +64,7 @@ if has("multi_byte") | |||
64 | set listchars+=tab:▏\ | " | 64 | set listchars+=tab:▏\ | " |
65 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | 65 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) |
66 | " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | 66 | " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) |
67 | set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) | 67 | " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) |
68 | set showbreak+=› | " symbol used in the beginning of a wrapped line | 68 | set showbreak+=› | " symbol used in the beginning of a wrapped line |
69 | 69 | ||
70 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) | 70 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) |
@@ -235,13 +235,15 @@ set complete+=i " scan current and included files | |||
235 | set complete+=d " scan current and included files for defined name or macro | 235 | set complete+=d " scan current and included files for defined name or macro |
236 | set complete+=d | " scan current and included files for defined name or macro | 236 | set complete+=d | " scan current and included files for defined name or macro |
237 | set complete+=i | " scan current and included files for completions | 237 | set complete+=i | " scan current and included files for completions |
238 | set completeopt+=noinsert | " Do not insert any text for a match until the user selects one | ||
239 | set completeopt+=noselect | " Do not select a completion from the menu, let the user do that | ||
238 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] | 240 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] |
239 | set tags+=../tags | 241 | set tags+=../tags |
240 | 242 | ||
241 | " code folding... | 243 | " code folding... |
242 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) | 244 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) |
243 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | 245 | set foldclose=all | " automatically fold, when the cursor leaves the folded area |
244 | set foldcolumn=1 | " I think I don't need this second indicator | 246 | set foldcolumn=2 | " I think I don't need this second indicator |
245 | " set numberwidth=5 | 247 | " set numberwidth=5 |
246 | " set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow | 248 | " set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow |
247 | set foldnestmax=1 | " top level folding only | 249 | set foldnestmax=1 | " top level folding only |
@@ -250,7 +252,7 @@ set foldopen=block,hor,search | " when do we unfold? | |||
250 | " set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\v^/[/*]\','','g') | 252 | " set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\v^/[/*]\','','g') |
251 | " set foldtext='⊞\ '.substitute(getline(v:foldstart),'^[\ '.printf(&cms,'').']*','','').'↵'.getline(v:foldstart+1).'↵'.getline(v:foldstart+2) | 253 | " set foldtext='⊞\ '.substitute(getline(v:foldstart),'^[\ '.printf(&cms,'').']*','','').'↵'.getline(v:foldstart+1).'↵'.getline(v:foldstart+2) |
252 | " set foldtext=repeat('',indent(v:foldstart)).substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g') | 254 | " set foldtext=repeat('',indent(v:foldstart)).substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g') |
253 | set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]]\\+','\ ','g'),'^[[:space:]]','','g')) | 255 | set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]]\\+','\ ','g'),'^[[:space:]*]','','g')) |
254 | 256 | ||
255 | " works ... | 257 | " works ... |
256 | " set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 | 258 | " set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 |
@@ -403,7 +405,7 @@ if has("autocmd") | |||
403 | autocmd FileType c,cpp set grepformat=%f:%l:%c:%m | 405 | autocmd FileType c,cpp set grepformat=%f:%l:%c:%m |
404 | endif | 406 | endif |
405 | 407 | ||
406 | autocmd BufWinEnter * if &previewwindow | setlocal nonumber signcolumn=no filetype=c nobuflisted | endif | 408 | autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif |
407 | 409 | ||
408 | 410 | ||
409 | " autocmd FileType c,cpp setlocal iskeyword-=_ | 411 | " autocmd FileType c,cpp setlocal iskeyword-=_ |
@@ -704,12 +706,12 @@ let g:signify_cursorhold_insert = 0 | |||
704 | let g:signify_cursorhold_normal = 0 | 706 | let g:signify_cursorhold_normal = 0 |
705 | let g:signify_update_on_bufenter = 0 | 707 | let g:signify_update_on_bufenter = 0 |
706 | let g:signify_update_on_focusgained = 0 | 708 | let g:signify_update_on_focusgained = 0 |
707 | let g:signify_sign_show_count = 1 | 709 | let g:signify_sign_show_count = 0 |
708 | 710 | ||
709 | let g:signify_sign_add = '' | 711 | let g:signify_sign_add = '' |
710 | let g:signify_sign_delete = '' | 712 | let g:signify_sign_delete = '' |
711 | let g:signify_sign_delete_first_line = '' | 713 | let g:signify_sign_delete_first_line = '' |
712 | let g:signify_sign_change = '' | 714 | let g:signify_sign_change = '' |
713 | let g:signify_sign_changedelete = g:signify_sign_change | 715 | let g:signify_sign_changedelete = g:signify_sign_change |
714 | 716 | ||
715 | 717 | ||
@@ -742,8 +744,6 @@ nnoremap <F4> | |||
742 | " autocmd bufenter * | 744 | " autocmd bufenter * |
743 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | 745 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif |
744 | " | 746 | " |
745 | |||
746 | |||
747 | " map CTRL-PageUp/Down to next/previous buffer | 747 | " map CTRL-PageUp/Down to next/previous buffer |
748 | " and Shift-PageUp/Down to next/previous arglist file | 748 | " and Shift-PageUp/Down to next/previous arglist file |
749 | nnoremap <C-PageUp> :bn<CR> | 749 | nnoremap <C-PageUp> :bn<CR> |
@@ -751,21 +751,6 @@ nnoremap <C-PageDown> :bp<CR> | |||
751 | nnoremap <S-PageUp> :N<CR> | 751 | nnoremap <S-PageUp> :N<CR> |
752 | nnoremap <S-PageDown> :n<CR> | 752 | nnoremap <S-PageDown> :n<CR> |
753 | 753 | ||
754 | |||
755 | " Additional: ========================================. | ||
756 | " Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages | ||
757 | " let g:javascript_conceal_function = "ƒ" | ||
758 | " let g:javascript_conceal_null = "ø" | ||
759 | " let g:javascript_conceal_this = "@" | ||
760 | " let g:javascript_conceal_return = "⇚" | ||
761 | " let g:javascript_conceal_undefined = "¿" | ||
762 | " let g:javascript_conceal_NaN = "ℕ" | ||
763 | " let g:javascript_conceal_prototype = "¶" | ||
764 | " let g:javascript_conceal_static = "•" | ||
765 | " let g:javascript_conceal_super = "Ω" | ||
766 | " let g:javascript_conceal_arrow_function = "⇒" | ||
767 | |||
768 | |||
769 | " indent within <script> and <style> (default is a zero indent) | 754 | " indent within <script> and <style> (default is a zero indent) |
770 | let g:html_indent_script1 = "inc" | 755 | let g:html_indent_script1 = "inc" |
771 | let g:html_indent_style1 = "inc" | 756 | let g:html_indent_style1 = "inc" |
@@ -827,7 +812,8 @@ if has("python") || has('python3') | |||
827 | \ } | 812 | \ } |
828 | 813 | ||
829 | let g:LanguageClient_serverCommands = { | 814 | let g:LanguageClient_serverCommands = { |
830 | \ 'cpp': ['clangd'] | 815 | \ 'cpp': ['clangd'], |
816 | \ 'c': ['clangd'] | ||
831 | \ } | 817 | \ } |
832 | " Plug 'roxma/nvim-completion-manager' unmaintained python version | 818 | " Plug 'roxma/nvim-completion-manager' unmaintained python version |
833 | else | 819 | else |
@@ -848,6 +834,10 @@ if has("python") || has('python3') | |||
848 | let g:ycm_key_list_previous_completion = ['Up'] | 834 | let g:ycm_key_list_previous_completion = ['Up'] |
849 | let g:ycm_key_list_select_completion = ['Down'] | 835 | let g:ycm_key_list_select_completion = ['Down'] |
850 | 836 | ||
837 | let g:ycm_semantic_triggers = { | ||
838 | \ 'c': [ 're!\w{2}' ] | ||
839 | \ } | ||
840 | |||
851 | " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions | 841 | " Plug 'vim-scripts/dbext.vim' " dependency to allow db related completions |
852 | " let g:ycm_server_python_interpreter = 'python3' | 842 | " let g:ycm_server_python_interpreter = 'python3' |
853 | " let g:ycm_python_binary_path = '/usr/bin/python3' " the python interpreter of choice (for code checking) | 843 | " let g:ycm_python_binary_path = '/usr/bin/python3' " the python interpreter of choice (for code checking) |
@@ -864,7 +854,7 @@ if has("python") || has('python3') | |||
864 | " let g:ycm_key_list_previous_completion = ['<Up>'] | 854 | " let g:ycm_key_list_previous_completion = ['<Up>'] |
865 | " let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' | 855 | " let g:ycm_global_ycm_extra_conf = '.ycm_extra_conf.py' |
866 | " let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | 856 | " let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } |
867 | " " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? | 857 | " let g:ycm_disable_for_files_larger_than_kb = 16384 " we have faaast computers, don't we? |
868 | " let g:ycm_show_diagnostics_ui = 0 | 858 | " let g:ycm_show_diagnostics_ui = 0 |
869 | " " disable <tab>-key for YCM so that it can be used with ultisnips | 859 | " " disable <tab>-key for YCM so that it can be used with ultisnips |
870 | " let g:ycm_key_list_select_completion=[] | 860 | " let g:ycm_key_list_select_completion=[] |
@@ -967,113 +957,89 @@ let g:netrw_winsize = 20 | " window size in percent | |||
967 | " ====================================================================================================================== | 957 | " ====================================================================================================================== |
968 | 958 | ||
969 | function! ExtendColorTheme() | 959 | function! ExtendColorTheme() |
970 | " let g:status_fg=synIDattr(hlID('Cursor'), 'fg#') | 960 | filetype on |
971 | " let g:status_bg=synIDattr(hlID('Cursor'), 'bg#') | 961 | filetype plugin on |
972 | " let g:status_sel=synIDattr(hlID('Text'), 'fg#') | 962 | filetype indent on |
973 | " let g:status_sel='#ffffff' | 963 | |
974 | let g:status_fg='#00aa00' | 964 | syntax on | " enable syntax highlighting |
975 | let g:status_bg='#000000' | 965 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) |
976 | let g:status_sel='#ffff00' | 966 | |
967 | highlight! SignifySignAdd ctermbg=NONE | ||
968 | highlight! Bold cterm=bold gui=bold | ||
969 | highlight! Italic cterm=italic gui=italic | ||
970 | highlight! Underline cterm=underline gui=underline | ||
971 | highlight! BoldUnderline cterm=bold,underline gui=bold,underline | ||
972 | highlight! BoldItalic cterm=bold,Italic gui=Bold,Italic | ||
973 | highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000 | ||
974 | highlight! Error ctermbg=NONE guibg=NONE | ||
975 | highlight! SpellBad cterm=NONE gui=undercurl guibg=NONE guifg=red | ||
976 | |||
977 | |||
978 | highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing | ||
979 | highlight! link EndOfBuffer Ignore | ||
980 | highlight! link WildMenu Search | ||
981 | highlight! link Convention Error | ||
982 | highlight! link YcmErrorSign SpellBad | ||
983 | highlight! link YcmWarningSign Spellbad | ||
984 | highlight! link SignifySignAdd SignColumn | ||
985 | highlight! link SignifySignChange SignColumn | ||
986 | highlight! link SignifySignDelete SignColumn | ||
987 | highlight! link SignifySignChangeDelete SignColumn | ||
988 | highlight! link SignifySignDeleteFirstLine SignColumn | ||
989 | highlight! link VertSplit NonText | ||
990 | highlight! link LineNr Comment | ||
991 | highlight! link Folded LineNr | ||
992 | highlight! link SignColumn Comment | ||
993 | highlight! link FoldColumn Comment | ||
994 | highlight! link PmenuSbar Pmenu | ||
995 | highlight! PmenuThumb cterm=inverse | ||
996 | highlight! MoreMsg cterm=inverse | ||
997 | |||
998 | autocmd InsertEnter * silent! call matchdelete(101) | ||
999 | autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
1000 | |||
1001 | autocmd InsertEnter * set colorcolumn=80,120 | ||
1002 | autocmd InsertLeave * set colorcolumn& | ||
977 | 1003 | ||
978 | " execute 'highlight! StatusLine' | 1004 | " execute 'highlight! StatusLine' |
979 | " \ .' guibg=NONE' | 1005 | " \ .' guibg=NONE' |
980 | " \ .' guifg='.g:status_bg | 1006 | " \ .' guifg='.g:status_bg |
981 | " \ .' gui=inverse' | 1007 | " \ .' gui=inverse' |
982 | 1008 | " let g:status_fg=synIDattr(hlID('Cursor'), 'fg#') | |
1009 | " let g:status_bg=synIDattr(hlID('Cursor'), 'bg#') | ||
1010 | " let g:status_sel=synIDattr(hlID('Text'), 'fg#') | ||
1011 | " let g:status_sel='#ffffff' | ||
983 | " " execute 'highlight! User1 gui=NONE' | 1012 | " " execute 'highlight! User1 gui=NONE' |
984 | " execute 'highlight! User1 guibg='.g:status_sel | 1013 | " execute 'highlight! User1 guibg='.g:status_sel |
985 | " execute 'highlight! User1 guifg='.g:status_fg | 1014 | " execute 'highlight! User1 guifg='.g:status_fg |
986 | |||
987 | " execute 'highlight! User2 gui=NONE' | 1015 | " execute 'highlight! User2 gui=NONE' |
988 | " execute 'highlight! User2 guibg='.g:status_sel | 1016 | " execute 'highlight! User2 guibg='.g:status_sel |
989 | " execute 'highlight! User2 guifg=NONE' | 1017 | " execute 'highlight! User2 guifg=NONE' |
990 | |||
991 | |||
992 | filetype on | ||
993 | filetype plugin on | ||
994 | filetype indent on | ||
995 | |||
996 | syntax on | " enable syntax highlighting | ||
997 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | ||
998 | |||
999 | " use the default terminal background color as background (allows transparency) | 1018 | " use the default terminal background color as background (allows transparency) |
1000 | " highlight! Normal guibg=NONE ctermbg=NONE | 1019 | " highlight! Normal guibg=NONE ctermbg=NONE |
1001 | " highlight! NonText guibg=NONE guifg=black ctermbg=NONE ctermfg=black | 1020 | " highlight! NonText guibg=NONE guifg=black ctermbg=NONE ctermfg=black |
1002 | 1021 | " makes the ~ (tilde) indicator invisible, which usually marks the EOF | |
1003 | " make the ~ (tilde) indicator invisible, which usually marks the EOF | 1022 | " highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE |
1004 | highlight! link EndOfBuffer Ignore | 1023 | " highlight! Pmenu ctermbg=LightYellow ctermfg=DarkGrey |
1005 | 1024 | " highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold | |
1006 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | ||
1007 | highlight! Pmenu ctermbg=LightYellow ctermfg=DarkGrey | ||
1008 | highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold | ||
1009 | |||
1010 | highlight! link PmenuSbar Pmenu | ||
1011 | highlight! PmenuThumb cterm=inverse | ||
1012 | highlight! MoreMsg cterm=inverse | ||
1013 | |||
1014 | highlight! link LineNr Comment | ||
1015 | highlight! link Folded Comment | ||
1016 | highlight! link SignColumn Comment | ||
1017 | highlight! link FoldColumn Comment | ||
1018 | " highlight! Folded ctermbg=NONE | 1025 | " highlight! Folded ctermbg=NONE |
1019 | " highlight! Cursor guibg=#729fcf ctermbg=yellow | 1026 | " highlight! Cursor guibg=#729fcf ctermbg=yellow |
1020 | highlight! link VertSplit NonText | ||
1021 | " highlight! SpellBad ctermbg=none | 1027 | " highlight! SpellBad ctermbg=none |
1022 | highlight! SpecialKey ctermfg=19 | 1028 | " highlight! SpecialKey ctermfg=19 |
1023 | highlight! WhiteSpace ctermfg=19 | 1029 | " highlight! WhiteSpace ctermfg=19 |
1024 | |||
1025 | " highlight! link TabLine LineNr | 1030 | " highlight! link TabLine LineNr |
1026 | " highlight! TabLineSel ctermbg=blue ctermfg=black | 1031 | " highlight! TabLineSel ctermbg=blue ctermfg=black |
1027 | " highlight! link TabLineFill LineNr | 1032 | " highlight! link TabLineFill LineNr |
1028 | highlight! Search ctermbg=LightYellow ctermfg=12 guibg=#fefd86 guifg=#222222 | 1033 | " highlight! Search ctermbg=LightYellow ctermfg=12 guibg=#fefd86 guifg=#222222 |
1029 | highlight! link WildMenu Search | ||
1030 | |||
1031 | " generic, which should exist but don't | 1034 | " generic, which should exist but don't |
1032 | highlight! SignifySignAdd ctermbg=NONE | ||
1033 | highlight! Bold cterm=bold gui=bold | ||
1034 | highlight! Italic cterm=italic gui=italic | ||
1035 | highlight! Underline cterm=underline gui=underline | ||
1036 | highlight! BoldUnderline cterm=bold,underline gui=bold,underline | ||
1037 | highlight! BoldItalic cterm=Bold,Italic gui=Bold,Italic | ||
1038 | |||
1039 | " make tab stop (see listchars) less disturbing... | ||
1040 | highlight! link SpecialKey NonText | ||
1041 | |||
1042 | " highlight! link LightlineMiddle_tabline ColorColumn | ||
1043 | " highlight! link LightlineLeft_tabline_1 ColorColumn | ||
1044 | " highlight! link LightlineLeft_tabline_0_1 ColorColumn | ||
1045 | |||
1046 | highlight! Todo guibg=#ffffaa guifg=#000000 gui=bold term=bold | ||
1047 | highlight! cStatement guifg=red gui=bold term=bold | ||
1048 | |||
1049 | highlight! link Convention Error | ||
1050 | |||
1051 | |||
1052 | highlight! link SignifySignAdd LineNr | ||
1053 | highlight! link SignifySignChange LineNr | ||
1054 | highlight! link SignifySignDelete LineNr | ||
1055 | highlight! link SignifySignChangeDelete LineNr | ||
1056 | highlight! link SignifySignDeleteFirstLine LineNr | ||
1057 | |||
1058 | highlight! SpellBad ctermbg=NONE ctermfg=red cterm=NONE | ||
1059 | highlight! link YcmErrorSign SpellBad | ||
1060 | highlight! link YcmWarningSign Spellbad | ||
1061 | |||
1062 | " autocmd InsertLeave * call matchadd('Conceal', ' \+$', -1, 101, { 'conceal': '⟶' }) | 1035 | " autocmd InsertLeave * call matchadd('Conceal', ' \+$', -1, 101, { 'conceal': '⟶' }) |
1063 | autocmd InsertEnter * silent! call matchdelete(101) | ||
1064 | autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
1065 | |||
1066 | " Show trailing whitepace and spaces before a tab as part of the syntax highlighting | 1036 | " Show trailing whitepace and spaces before a tab as part of the syntax highlighting |
1067 | " autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | 1037 | " autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1068 | " autocmd Syntax * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | 1038 | " autocmd Syntax * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1069 | " autocmd BufEnter,BufWritePost * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | 1039 | " autocmd BufEnter,BufWritePost * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1070 | " autocmd InsertEnter * syntax clear Convention | 1040 | " autocmd InsertEnter * syntax clear Convention |
1071 | " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' | 1041 | " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' |
1072 | |||
1073 | autocmd InsertEnter * set colorcolumn=80,120 | ||
1074 | autocmd InsertLeave * set colorcolumn& | ||
1075 | " set colorcolumn= | " not used, because we have a :match directive for textwidth | 1042 | " set colorcolumn= | " not used, because we have a :match directive for textwidth |
1076 | " | ||
1077 | " if argc() == 0 | 1043 | " if argc() == 0 |
1078 | " rv | 1044 | " rv |
1079 | " autocmd VimEnter * split +bro\ ol | 1045 | " autocmd VimEnter * split +bro\ ol |
@@ -1113,11 +1079,6 @@ nnoremap Q !!$SHELL<CR> | |||
1113 | " ====================================================================================================================== | 1079 | " ====================================================================================================================== |
1114 | " TESTING: | 1080 | " TESTING: |
1115 | " ====================================================================================================================== | 1081 | " ====================================================================================================================== |
1116 | " avoids openin an empty buffer when restoring bufferlist from viminfo... | ||
1117 | " if argc() == 0 | ||
1118 | " silent autocmd VimEnter * nested :silent bun | ||
1119 | " endif | ||
1120 | |||
1121 | autocmd TextYankPost * echo '> text yanked to '.( | 1082 | autocmd TextYankPost * echo '> text yanked to '.( |
1122 | \ get(v:event,'regname') == '' | 1083 | \ get(v:event,'regname') == '' |
1123 | \ ? 'default register' | 1084 | \ ? 'default register' |
@@ -1158,15 +1119,15 @@ augroup status | |||
1158 | let g:symbol_branch = '' | 1119 | let g:symbol_branch = '' |
1159 | 1120 | ||
1160 | if &term == "linux" | 1121 | if &term == "linux" |
1161 | let g:symbol_branch = '' | 1122 | let g:symbol_branch = '' |
1162 | 1123 | ||
1163 | let g:group_active = "StatusLineTerm" | 1124 | let g:group_active = "StatusLineTerm" |
1164 | let g:group_inactive = "StatusLineTermNC" | 1125 | let g:group_inactive = "StatusLineTermNC" |
1165 | let g:group_tabline = "StatusLineTerm" | 1126 | let g:group_tabline = "StatusLineTerm" |
1166 | else | 1127 | else |
1167 | let g:group_active = "StatusLine" | 1128 | let g:group_active = "StatusLine" |
1168 | let g:group_inactive = "StatusLineNC" | 1129 | let g:group_inactive = "StatusLineNC" |
1169 | let g:group_tabline = "TabLine" | 1130 | let g:group_tabline = "TabLine" |
1170 | endif | 1131 | endif |
1171 | 1132 | ||
1172 | " this function reverts foreground color and background color of a given | 1133 | " this function reverts foreground color and background color of a given |
@@ -1204,13 +1165,12 @@ augroup status | |||
1204 | return '' | 1165 | return '' |
1205 | \ ."%#StatusLineHighlight#" | 1166 | \ ."%#StatusLineHighlight#" |
1206 | \ ."%#".a:highlight_group."#" | 1167 | \ ."%#".a:highlight_group."#" |
1207 | \ ."%(%w%h%q%)".' '.l:mode.' ' | 1168 | \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start.' ' |
1208 | \ .g:status_sym_sep_start.' ' | ||
1209 | \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" | 1169 | \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" |
1210 | \ ."%{winbufnr(0).' '.g:status_sym_sep_start}" | 1170 | \ ."%{winbufnr(0).' '.g:status_sym_sep_start}" |
1211 | \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" | 1171 | \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" |
1212 | \ ."%{(&modified\ ?\ '\ \ '.nr2char(0xF0C7).'\ '\ :\ '')\ }" | 1172 | \ ."%{(&modified\ ?\ '\ \ '.nr2char(0xF0C7).'\ '\ :\ '')\ }" |
1213 | \ ."%{(haslocaldir() ?\ ' '.fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " | 1173 | \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " |
1214 | \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ has('nvim')?b:term_title:expand(&titlestring)\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" | 1174 | \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ has('nvim')?b:term_title:expand(&titlestring)\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" |
1215 | \ ."%1(%)" | 1175 | \ ."%1(%)" |
1216 | \ ."%#".l:invert_group."#" | 1176 | \ ."%#".l:invert_group."#" |
@@ -1237,8 +1197,8 @@ augroup status | |||
1237 | let l:invert_group = CreateInvertGroup(a:highlight_group) | 1197 | let l:invert_group = CreateInvertGroup(a:highlight_group) |
1238 | return '' | 1198 | return '' |
1239 | \ ."%#".a:highlight_group."#" | 1199 | \ ."%#".a:highlight_group."#" |
1240 | \ ."%3( \ %)" | 1200 | \ ."%3( \ %)\ " |
1241 | \ ."%{getcwd(-1)}" | 1201 | \ ."%{getcwd(-1)}\ " |
1242 | \ .g:status_sym_sep_start.' ' | 1202 | \ .g:status_sym_sep_start.' ' |
1243 | \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)" | 1203 | \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)" |
1244 | \ ."%#".l:invert_group."#" | 1204 | \ ."%#".l:invert_group."#" |