diff options
-rw-r--r-- | vimrc-full | 41 |
1 files changed, 32 insertions, 9 deletions
@@ -10,6 +10,10 @@ set virtualedit=all | " virtual edit should be default behaviour, | |||
10 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis | 10 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis |
11 | set ignorecase smartcase hlsearch | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) | 11 | set ignorecase smartcase hlsearch | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) |
12 | 12 | ||
13 | |||
14 | set path+=** | " allow recursive searches for files | ||
15 | let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | ||
16 | |||
13 | "======================================================================================================================= | 17 | "======================================================================================================================= |
14 | " SHELL | 18 | " SHELL |
15 | "======================================================================================================================= | 19 | "======================================================================================================================= |
@@ -187,7 +191,6 @@ set noautochdir | " When on, Vim will change the current working d | |||
187 | set nostartofline | " when scrolling: do not move the cursor to column 1 | 191 | set nostartofline | " when scrolling: do not move the cursor to column 1 |
188 | set nowrap | " but do not (by default) wrap long lines around | 192 | set nowrap | " but do not (by default) wrap long lines around |
189 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | 193 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers |
190 | set path+=** | " allow recursive searches for files | ||
191 | set incsearch | " highlight pattern while entering it (performance wise this isn't that good) | 194 | set incsearch | " highlight pattern while entering it (performance wise this isn't that good) |
192 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for | 195 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for |
193 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | 196 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge |
@@ -198,7 +201,7 @@ set writedelay=0 | |||
198 | " display and performance | 201 | " display and performance |
199 | set lazyredraw | " disables redraw during macro execution (improves performance) | 202 | set lazyredraw | " disables redraw during macro execution (improves performance) |
200 | set cmdheight=2 | " sets the command line's height | 203 | set cmdheight=2 | " sets the command line's height |
201 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | 204 | set signcolumn=auto | " auto=auto hide, yes=always, no=never show the column with error indicators |
202 | set nocursorcolumn | " turn visual cursor column off (improves performance) | 205 | set nocursorcolumn | " turn visual cursor column off (improves performance) |
203 | set updatetime=80 | " updates the screen more often | 206 | set updatetime=80 | " updates the screen more often |
204 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | 207 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry |
@@ -253,7 +256,7 @@ set nosmartindent | |||
253 | set cindent cinoptions+=(0 | " indent at parentheses | 256 | set cindent cinoptions+=(0 | " indent at parentheses |
254 | 257 | ||
255 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths | 258 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths |
256 | set equalalways | " do not evenly size windows when opening new or closing old | 259 | set noequalalways | " do not evenly size windows when opening new or closing old |
257 | set nocursorline | " turn visual cursor line off (improves performance) | 260 | set nocursorline | " turn visual cursor line off (improves performance) |
258 | "======================================================================================================================= | 261 | "======================================================================================================================= |
259 | 262 | ||
@@ -1043,26 +1046,35 @@ function! ExtendColorTheme() | |||
1043 | " highlight! link LightlineLeft_tabline_1 ColorColumn | 1046 | " highlight! link LightlineLeft_tabline_1 ColorColumn |
1044 | " highlight! link LightlineLeft_tabline_0_1 ColorColumn | 1047 | " highlight! link LightlineLeft_tabline_0_1 ColorColumn |
1045 | 1048 | ||
1046 | |||
1047 | highlight! Todo guibg=#ffffaa guifg=#000000 gui=bold term=bold | 1049 | highlight! Todo guibg=#ffffaa guifg=#000000 gui=bold term=bold |
1048 | highlight! cStatement guifg=red gui=bold term=bold | 1050 | highlight! cStatement guifg=red gui=bold term=bold |
1049 | 1051 | ||
1052 | highlight! link Convention Error | ||
1053 | |||
1050 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) | 1054 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) |
1051 | autocmd InsertEnter * set list | 1055 | autocmd InsertEnter * set list |
1052 | autocmd InsertLeave * set nolist | 1056 | autocmd InsertLeave * set nolist |
1053 | 1057 | ||
1054 | " highlight double words (its unlikely they are right) | 1058 | " autocmd InsertLeave * call matchadd('Conceal', ' \+$', -1, 101, { 'conceal': '⟶' }) |
1055 | autocmd InsertLeave * syntax match Convention /\v<(\w+)\_s+\1>/ containedin=ALL | 1059 | autocmd InsertEnter * call matchdelete(101) |
1060 | autocmd InsertLeave * call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
1056 | 1061 | ||
1057 | " Show trailing whitepace and spaces before a tab as part of the syntax highlighting | 1062 | " Show trailing whitepace and spaces before a tab as part of the syntax highlighting |
1058 | highlight! link Convention Error | 1063 | " autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1059 | autocmd BufEnter,InsertLeave * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL | 1064 | " autocmd Syntax * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1060 | autocmd InsertEnter * syntax clear Convention | 1065 | " autocmd BufEnter,BufWritePost * syntax match Convention /\s\+$\| \+\ze\t/ containedin=ALL |
1066 | " autocmd InsertEnter * syntax clear Convention | ||
1061 | " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' | 1067 | " autocmd BufEnter,InsertLeave * execute ':syntax match Convention /\%>'.&textwidth.'v./ containedin=ALL' |
1062 | 1068 | ||
1063 | autocmd InsertEnter * set colorcolumn=80,120 | 1069 | autocmd InsertEnter * set colorcolumn=80,120 |
1064 | autocmd InsertLeave * set colorcolumn& | 1070 | autocmd InsertLeave * set colorcolumn& |
1065 | " set colorcolumn= | " not used, because we have a :match directive for textwidth | 1071 | " set colorcolumn= | " not used, because we have a :match directive for textwidth |
1072 | " | ||
1073 | " if argc() == 0 | ||
1074 | " rv | ||
1075 | " autocmd VimEnter * split +bro\ ol | ||
1076 | " endif | ||
1077 | " | ||
1066 | 1078 | ||
1067 | endfunction | 1079 | endfunction |
1068 | autocmd! ColorScheme * call ExtendColorTheme() | 1080 | autocmd! ColorScheme * call ExtendColorTheme() |
@@ -1074,6 +1086,7 @@ set termguicolors | " When on, uses highlight-guifg and highlight-guibg attribut | |||
1074 | if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) | 1086 | if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) |
1075 | let g:base16_shell_path="~/.config/base16-shell/scripts" | 1087 | let g:base16_shell_path="~/.config/base16-shell/scripts" |
1076 | let base16colorspace=256 | 1088 | let base16colorspace=256 |
1089 | let syntax_cmd="skip" " vim internal, use base16 and no default colors | ||
1077 | set background=dark | 1090 | set background=dark |
1078 | source ~/.vimrc_background | 1091 | source ~/.vimrc_background |
1079 | else | 1092 | else |
@@ -1101,3 +1114,13 @@ autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 | |||
1101 | 1114 | ||
1102 | " display highlight group under the cursor | 1115 | " display highlight group under the cursor |
1103 | map <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> | 1116 | map <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> |
1117 | |||
1118 | if argc() == 0 | ||
1119 | " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) | ||
1120 | |||
1121 | " from the list of recent files: make absolute paths, filter out files not | ||
1122 | " contained in cwd and finally filter out directories and non-files... | ||
1123 | autocmd VimEnter * call setqflist(map(filter(filter( | ||
1124 | \ map(copy(v:oldfiles), {_, p->expand(p)}), 'v:val =~ "'.getcwd().'"'), | ||
1125 | \ 'filereadable(v:val)'), {_, p->{'filename': fnamemodify(p, ':.')}})) | copen | only | ||
1126 | endif | ||