diff options
author | Max Christian Pohle | 2017-05-13 15:08:45 +0200 |
---|---|---|
committer | Max Christian Pohle | 2017-05-13 15:08:45 +0200 |
commit | f06d6454cae2b379b6938eba671273a201c1f0e2 (patch) | |
tree | f3d12ebcaeb1242ae881186294b95cfc9689e958 /vimrc-full | |
parent | e710a628e1537c621884b861a53533bc841e368d (diff) | |
download | vim-f06d6454cae2b379b6938eba671273a201c1f0e2.tar.bz2 vim-f06d6454cae2b379b6938eba671273a201c1f0e2.zip |
Restructured and improved register macros
Diffstat (limited to 'vimrc-full')
-rw-r--r-- | vimrc-full | 158 |
1 files changed, 82 insertions, 76 deletions
@@ -2,11 +2,76 @@ | |||
2 | 2 | ||
3 | set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) | 3 | set encoding=utf-8 | " set up vim's cosole encoding (not file encoding, for which there is fileencoding=) |
4 | set t_Co=256 | " required on some ssh sessions | 4 | set t_Co=256 | " required on some ssh sessions |
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 |
8 | " set termguicolors | 8 | " set termguicolors |
9 | 9 | ||
10 | "======================================================================================================================= | ||
11 | " MATTER_OF_TASTE: | ||
12 | "======================================================================================================================= | ||
13 | set textwidth=120 | " better done with modeline | ||
14 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | ||
15 | |||
16 | "======================================================================================================================= | ||
17 | " SETTINGS: | ||
18 | "======================================================================================================================= | ||
19 | set noautochdir | " When on, Vim will change the current working directory | ||
20 | set breakindent | " Every wrapped line will continue visually indented | ||
21 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
22 | set cmdheight=2 | " sets the command line's height | ||
23 | set complete+=d | " scan current and included files for defined name or macro | ||
24 | set complete+=i | " scan current and included files for completions | ||
25 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
26 | set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) | ||
27 | set confirm | " asks 'do you want to save?' | ||
28 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
29 | set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) | ||
30 | set hlsearch | " highlights all search matches (not as performant!) | ||
31 | set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained | ||
32 | set lazyredraw | " disables redraw during macro exectution (improves performance) | ||
33 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
34 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
35 | set mousemodel=popup | " only in gvim: right click opens a popup-menu | ||
36 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
37 | set nocursorline | " turn visual cursor line off (improves performance) | ||
38 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
39 | set nofoldenable | " disable code folding. I hate code folding | ||
40 | set foldmethod=syntax | " foldlevel: syntax, indent, manual | ||
41 | set foldcolumn=1 | " if code folding gets used display it in the clutter bar, where line numbers live | ||
42 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
43 | set foldopen=all | " unfold when cursor moves into the closed fold | ||
44 | set foldtext=Foldtext() | " | ||
45 | set foldnestmax=1 | " top level folding only | ||
46 | set relativenumber | " relative line numbers can speed up navigation | ||
47 | set noshowmode | " because we are using some powerline derivat | ||
48 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
49 | set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals | ||
50 | set ttimeoutlen=50 | " set esc key timeout in ms- | ||
51 | set nowrap | " but do not (by default) wrap long lines around | ||
52 | set number | " turn line numbers on/off (performance decreases when they are shown) | ||
53 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for | ||
54 | set path+=** | " allow recursive searches for files | ||
55 | set redrawtime=400 | " The time in milliseconds for redrawing the display. | ||
56 | " set restorescreen | " restores the console after exiting vim | ||
57 | " set shada+=n~/.vim/shada | " shada file to use | ||
58 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
59 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
60 | set shiftround | " indent/unindent snaps to multiple of shiftwidth | ||
61 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
62 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | ||
63 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
64 | set winminwidth=30 | " (and all other windows, so TODO: watch out) | ||
65 | set tags+=../tags | ||
66 | " set textwidth=100 | " line length (80 used to be default, but...) | ||
67 | " set colorcolumn= | " not used, because we have a :match directive for textwidth | ||
68 | set updatetime=1000 | " updates the screen more often | ||
69 | set writedelay=0 | ||
70 | set wildmenu | " use a menu in the command line | ||
71 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
72 | "======================================================================================================================= | ||
73 | |||
74 | |||
10 | " START: LOADING PLUGINS | 75 | " START: LOADING PLUGINS |
11 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ | 76 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ |
12 | call plug#begin() | 77 | call plug#begin() |
@@ -18,7 +83,6 @@ Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | |||
18 | 83 | ||
19 | " TESTING: | " plugins which I am currently trying... | 84 | " TESTING: | " plugins which I am currently trying... |
20 | " Plug 'rkitover/vimpager' | 85 | " Plug 'rkitover/vimpager' |
21 | " Plug 'wting/gitsessions.vim' | " worth a try: restore sessions based on the git repo you are working in | ||
22 | " Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases | 86 | " Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases |
23 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | 87 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) |
24 | 88 | ||
@@ -89,9 +153,10 @@ nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ct | |||
89 | 153 | ||
90 | 154 | ||
91 | " AIRLINE: a fancy status line ========================================================================================= | 155 | " AIRLINE: a fancy status line ========================================================================================= |
92 | Plug 'vim-airline/vim-airline' | " beautification of the mode line | ||
93 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split | 156 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split |
94 | set background=light | 157 | set background=light |
158 | |||
159 | Plug 'vim-airline/vim-airline' | " beautification of the mode line | ||
95 | let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace', 'ycm'] | 160 | let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'whitespace', 'ycm'] |
96 | let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] | 161 | let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] |
97 | let g:airline_section_c = "" | " was: %F | 162 | let g:airline_section_c = "" | " was: %F |
@@ -128,10 +193,7 @@ let g:airline#themes#base16#constant = 0 | |||
128 | " let g:airline_theme='badcat' | " specifies which colorscheme should airline uses | 193 | " let g:airline_theme='badcat' | " specifies which colorscheme should airline uses |
129 | " let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses | 194 | " let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses |
130 | 195 | ||
131 | " Autocompleter: =====================================. | 196 | " Autocompleter: ===================================== |
132 | " | ||
133 | " | ||
134 | |||
135 | if has("python") | 197 | if has("python") |
136 | " YouCompleteMe: ===================================================================================================== | 198 | " YouCompleteMe: ===================================================================================================== |
137 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | 199 | " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... |
@@ -154,11 +216,8 @@ if has("python") | |||
154 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) | 216 | let g:ycm_python_binary_path = 'python' " the python interpreter of choice (for code checking) |
155 | 217 | ||
156 | " disable <tab>-key for YCM so that it can be used with ultisnips | 218 | " disable <tab>-key for YCM so that it can be used with ultisnips |
157 | " let g:ycm_key_list_select_completion=[] | 219 | let g:ycm_key_list_select_completion=[] |
158 | " let g:ycm_key_list_previous_completion=[] | 220 | let g:ycm_key_list_previous_completion=[] |
159 | " | ||
160 | " Plug 'rdnetto/YCM-Generator' " you better use cmake to generate json build commands, like: | ||
161 | " 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file | ||
162 | 221 | ||
163 | 222 | ||
164 | " SYNTASTIC: ========================================================================================================= | 223 | " SYNTASTIC: ========================================================================================================= |
@@ -222,8 +281,9 @@ function! ExtendColorTheme() | |||
222 | " highlight Normal ctermbg=NONE ctermfg=black | 281 | " highlight Normal ctermbg=NONE ctermfg=black |
223 | 282 | ||
224 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | 283 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE |
225 | highlight! Pmenu ctermbg=LightYellow ctermfg=blue guibg=blue guifg=LightYellow | 284 | highlight! Pmenu ctermbg=LightYellow ctermfg=blue |
226 | highlight! PmenuSel ctermbg=LightYellow ctermfg=blue guibg=LightYellow guifg=blue cterm=italic | 285 | highlight! PmenuSel ctermbg=blue ctermfg=LightYellow cterm=bold |
286 | |||
227 | highlight! link PmenuSbar Pmenu | 287 | highlight! link PmenuSbar Pmenu |
228 | highlight! PmenuThumb cterm=inverse | 288 | highlight! PmenuThumb cterm=inverse |
229 | highlight! MoreMsg cterm=inverse | 289 | highlight! MoreMsg cterm=inverse |
@@ -233,6 +293,10 @@ function! ExtendColorTheme() | |||
233 | highlight! SpellBad ctermbg=none | 293 | highlight! SpellBad ctermbg=none |
234 | highlight! SpecialKey ctermfg=19 | 294 | highlight! SpecialKey ctermfg=19 |
235 | highlight! WhiteSpace ctermfg=19 | 295 | highlight! WhiteSpace ctermfg=19 |
296 | |||
297 | highlight! link TabLine LineNr | ||
298 | highlight! TabLineSel ctermbg=blue ctermfg=black | ||
299 | highlight! link TabLineFill LineNr | ||
236 | endfunction | 300 | endfunction |
237 | autocmd ColorScheme * call ExtendColorTheme() | 301 | autocmd ColorScheme * call ExtendColorTheme() |
238 | 302 | ||
@@ -272,66 +336,6 @@ set thesaurus+=/home/max/.vim/thesaurus/php.txt | |||
272 | set dictionary=/usr/share/dict/cracklib-small | 336 | set dictionary=/usr/share/dict/cracklib-small |
273 | set complete+=k " make default completer <C-N> respect the dictionary | 337 | set complete+=k " make default completer <C-N> respect the dictionary |
274 | 338 | ||
275 | "======================================================================================================================= | ||
276 | " SETTINGS: | ||
277 | "======================================================================================================================= | ||
278 | set noautochdir | " When on, Vim will change the current working directory | ||
279 | set breakindent | " Every wrapped line will continue visually indented | ||
280 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
281 | set cmdheight=2 | " sets the command line's height | ||
282 | set complete+=d | " scan current and included files for defined name or macro | ||
283 | set complete+=i | " scan current and included files for completions | ||
284 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
285 | set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) | ||
286 | set confirm | " asks 'do you want to save?' | ||
287 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
288 | set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) | ||
289 | set hlsearch | " highlights all search matches (not as performant!) | ||
290 | set ignorecase smartcase | " search with ignorecase by default, but use case sensitive search when one captical char is contained | ||
291 | set lazyredraw | " disables redraw during macro exectution (improves performance) | ||
292 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
293 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
294 | set mousemodel=popup | " only in gvim: right click opens a popup-menu | ||
295 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
296 | set nocursorline | " turn visual cursor line off (improves performance) | ||
297 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
298 | set nofoldenable | " disable code folding. I hate code folding | ||
299 | set foldmethod=syntax | " foldlevel: syntax, indent, manual | ||
300 | set foldcolumn=1 | " if code folding gets used display it in the clutter bar, where line numbers live | ||
301 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
302 | set foldopen=all | " unfold when cursor moves into the closed fold | ||
303 | set foldtext=Foldtext() | " | ||
304 | set foldnestmax=1 | " top level folding only | ||
305 | set relativenumber | " relative line numbers can speed up navigation | ||
306 | set noshowmode | " because we are using some powerline derivat | ||
307 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
308 | set notimeout ttimeout | " improves performance but is known to cause problems on slow terminals | ||
309 | set ttimeoutlen=50 | " set esc key timeout in ms- | ||
310 | set nowrap | " but do not (by default) wrap long lines around | ||
311 | set number | " turn line numbers on/off (performance decreases when they are shown) | ||
312 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for | ||
313 | set path+=** | " allow recursive searches for files | ||
314 | set redrawtime=400 | " The time in milliseconds for redrawing the display. | ||
315 | " set restorescreen | " restores the console after exiting vim | ||
316 | " set shada+=n~/.vim/shada | " shada file to use | ||
317 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
318 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
319 | set shiftround | " indent/unindent snaps to multiple of shiftwidth | ||
320 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
321 | " ret noshowcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
322 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
323 | set winminwidth=30 | " (and all other windows, so TODO: watch out) | ||
324 | set tags+=../tags | ||
325 | " set textwidth=100 | " line length (80 used to be default, but...) | ||
326 | set textwidth=120 | " better done with modeline | ||
327 | " set colorcolumn= | " not used, because we have a :match directive for textwidth | ||
328 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | ||
329 | set updatetime=1000 | " updates the screen more often | ||
330 | set writedelay=0 | ||
331 | set wildmenu | " use a menu in the command line | ||
332 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
333 | "======================================================================================================================= | ||
334 | |||
335 | " set fillchars+=stlnc:\― | " | 339 | " set fillchars+=stlnc:\― | " |
336 | 340 | ||
337 | 341 | ||
@@ -531,7 +535,9 @@ if has("autocmd") | |||
531 | augroup CurrentFileName | 535 | augroup CurrentFileName |
532 | highlight CurrentFileName ctermbg=yellow guibg=yellow | 536 | highlight CurrentFileName ctermbg=yellow guibg=yellow |
533 | 537 | ||
534 | let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'" | 538 | |
539 | let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./' | :2match ExtraWhitespace /\\s\\+$/" | ||
540 | " let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'" | ||
535 | " highlight the current files name inside the document... | 541 | " highlight the current files name inside the document... |
536 | let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" | 542 | let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" |
537 | " put the current files name after the cursor... | 543 | " put the current files name after the cursor... |
@@ -576,7 +582,7 @@ vnoremap <s-up> k | |||
576 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | 582 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. |
577 | 583 | ||
578 | nnoremap <silent> <F5> :make<CR> | 584 | nnoremap <silent> <F5> :make<CR> |
579 | nnoremap <silent> <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR> | 585 | nnoremap <silent> <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR> |
580 | nnoremap <leader>r :syntax sync fromstart | 586 | nnoremap <leader>r :syntax sync fromstart |
581 | 587 | ||
582 | 588 | ||