aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2017-05-07 22:01:06 +0200
committerMax Christian Pohle2017-05-07 22:01:06 +0200
commit42822d1b36b299e5ebef52e2666c7f5166069383 (patch)
tree8941adcaf51539d837d86d2c7e30d43028937353
parent4a6d3efdcd52a7e358af30027acf6950010e26be (diff)
downloadvim-42822d1b36b299e5ebef52e2666c7f5166069383.tar.bz2
vim-42822d1b36b299e5ebef52e2666c7f5166069383.zip
Autocommand magic
-rw-r--r--doc/shortcuts.txt6
-rw-r--r--vimrc-full123
2 files changed, 78 insertions, 51 deletions
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt
index 3dd389f..8c0d773 100644
--- a/doc/shortcuts.txt
+++ b/doc/shortcuts.txt
@@ -86,9 +86,12 @@ do = get changes from other window into the current
86dp = put changes from current window into the other 86dp = put changes from current window into the other
87]c = jump to the next change 87]c = jump to the next change
88[c = jump to the prevous change 88[c = jump to the prevous change
89
90[folds]
91za = toggle a fold
92zM = close all folds
89zR = opens all folds (unfold all) 93zR = opens all folds (unfold all)
90zE = eliminates all folds 94zE = eliminates all folds
91z= = show spellcheck suggestions
92 95
93 96
94[buffers] 97[buffers]
@@ -102,6 +105,7 @@ z= = show spellcheck suggestions
102[special] 105[special]
103g CTRL-g = display file properties including word and char count 106g CTRL-g = display file properties including word and char count
104q: = show command history and use it like a normal buffer 107q: = show command history and use it like a normal buffer
108z= = show spellcheck suggestions
105 109
106 110
107[completions] 111[completions]
diff --git a/vimrc-full b/vimrc-full
index f4a9faa..d96702d 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -1,4 +1,12 @@
1" vim: textwidth=160 tabstop=2 shiftwidth=2 tw=160 colorcolumn=160 1" vim: tabstop=2 softtabstop=2 shiftwidth=2 textwidth=160
2
3set t_Co=256 | " required on some ssh sessions
4let &t_Co=256 | "
5" set background=light | "
6" set term=xtermc | " may be required on solaris
7set term=xterm-256color
8" set termguicolors
9
2 10
3" START: LOADING PLUGINS 11" START: LOADING PLUGINS
4" ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 12" ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
@@ -34,6 +42,7 @@ nnoremap <F12> :ToggleBufExplorer<CR>
34" AIRLINE: a fancy status line ========================================================================================= 42" AIRLINE: a fancy status line =========================================================================================
35Plug 'vim-airline/vim-airline' | " beautification of the mode line 43Plug 'vim-airline/vim-airline' | " beautification of the mode line
36set laststatus=2 | " required by AirLine, without status line does not appear until a window split 44set laststatus=2 | " required by AirLine, without status line does not appear until a window split
45set background=light
37let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar', 'whitespace', 'ycm'] 46let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar', 'whitespace', 'ycm']
38let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file'] 47let b:airline_whitespace_checks = ['indent', 'trailing', 'long', 'mixed-indent-file']
39" let g:airline_section_c = "" | " was: %F 48" let g:airline_section_c = "" | " was: %F
@@ -56,7 +65,11 @@ let g:airline_powerline_fonts = 1 |
56let g:airline_skip_empty_sections = 1 | 65let g:airline_skip_empty_sections = 1 |
57" AIRLINE_Theme: 66" AIRLINE_Theme:
58Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme 67Plug 'vim-airline/vim-airline-themes' | " airline themes to match any light and dark terminal using :AirlineTheme
59let g:airline_theme='base16' | " specifies which colorscheme should airline uses 68let base16colorspace = 256
69let g:airline_theme='base16' | " specifies which colorscheme should airline uses
70" let g:solarized_base16 = 1
71" let g:airline_base16_improved_contrast = 1
72let g:airline#themes#base16#constant = 0
60" let g:airline_theme='badcat' | " specifies which colorscheme should airline uses 73" let g:airline_theme='badcat' | " specifies which colorscheme should airline uses
61" let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses 74" let g:airline_theme='papercolor' | " specifies which colorscheme should ionirline uses
62 75
@@ -200,6 +213,49 @@ call plug#end() | " all plugins are gettin
200" END: LOADING PLUGINS 213" END: LOADING PLUGINS
201 214
202 215
216
217" COLORSCHEME:
218
219" uses the default terminal background color as background (allows transparency)
220
221
222function! ExtendColorTheme()
223 " highlight! Normal ctermbg=NONE ctermfg=black cterm=inverse
224 highlight! Normal ctermbg=NONE
225 highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE
226 highlight! Pmenu ctermbg=LightYellow ctermfg=blue guibg=LightYellow guifg=blue cterm=italic
227 highlight! PmenuSel ctermbg=LightYellow ctermfg=blue guibg=LightYellow guifg=blue gui=inverse cterm=inverse
228 highlight! link PmenuSbar Pmenu
229 highlight! PmenuThumb cterm=inverse
230 highlight! MoreMsg cterm=inverse
231 highlight! link Folded LineNr
232 highlight! Cursor guibg=green ctermbg=yellow
233 highlight! link VertSplit LineNr
234 highlight! SpellBad ctermbg=none
235
236 syntax on | " enable syntax highlighting
237 syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact)
238endfunction
239autocmd ColorScheme * call ExtendColorTheme()
240
241
242
243let g:base16_shell_path="/home/max/.config/base16-shell/scrips/"
244let base16colorspace=256
245if filereadable(expand("~/.vimrc_background"))
246 source ~/.vimrc_background
247else
248 colorscheme base16-phd
249" colorscheme base16-embers
250" colorscheme base16-flat
251" colorscheme base16-summerfruit-dark
252" colorscheme base16-tommorow
253" colorscheme base16-default-dark
254endif
255
256
257
258
203"======================================================================================================================= 259"=======================================================================================================================
204" GENERAL: 260" GENERAL:
205"======================================================================================================================= 261"=======================================================================================================================
@@ -207,8 +263,6 @@ filetype on
207filetype plugin on 263filetype plugin on
208filetype indent on 264filetype indent on
209 265
210syntax on | " enable syntax highlighting
211syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact)
212 266
213"======================================================================================================================= 267"=======================================================================================================================
214" SPELL_CHECKING: 268" SPELL_CHECKING:
@@ -278,58 +332,14 @@ set colorcolumn= | " not used, because we have a :match directive f
278set ts=4 sts=4 sw=4 expandtab | " better done with a modeline 332set ts=4 sts=4 sw=4 expandtab | " better done with a modeline
279set updatetime=1000 | " updates the screen more often 333set updatetime=1000 | " updates the screen more often
280set writedelay=0 334set writedelay=0
281set lcs+=space:· | " local space char
282"======================================================================================================================= 335"=======================================================================================================================
283" COLORSCHEME:
284" set term=xtermc | " may be required on solaris
285set t_Co=256 | " required on some ssh sessions
286let &t_Co=256
287" set termguicolors
288" set background=light | " hint how the terminal background looks like
289
290" uses the default terminal background color as background (allows transparency)
291" autocmd Colorscheme * set background=dark
292
293
294" set termguicolors
295let base16colorspace=256
296if filereadable(expand("~/.vimrc_background"))
297 set background=light
298 source ~/.vimrc_background
299else
300 colorscheme base16-phd
301" colorscheme base16-embers
302" colorscheme base16-flat
303" colorscheme base16-summerfruit-dark
304" colorscheme base16-tommorow
305" colorscheme base16-default-dark
306endif
307
308" highlight Normal ctermbg=NONE ctermfg=white
309highlight NonText ctermbg=NONE ctermfg=white
310highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE
311highlight! Pmenu ctermbg=LightYellow ctermfg=blue cterm=italic
312highlight! MoreMsg cterm=inverse
313highlight! link Folded LineNr
314highlight Cursor guibg=green
315highlight! link VertSplit LineNr
316execute ':match ColorColumn /\%>'.&textwidth.'v./'
317 336
318
319set fillchars+=fold:\ | "
320set fillchars+=vert:\│ | " cool vertical split char
321" set fillchars+=stlnc:\― | " 337" set fillchars+=stlnc:\― | "
322 338
323 339
324
325
326
327
328" let &t_EI .= "\<Esc>[0 q"
329" let &t_SI = "\<Esc>]12;green\x7"
330if has('autocmd') 340if has('autocmd')
331 autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" 341 " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q"
332 autocmd VimEnter * let &t_SI = "\<Esc>]12;black\x7" 342 " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7"
333 autocmd VimLeave * silent !echo -ne "\033]112\007" 343 autocmd VimLeave * silent !echo -ne "\033]112\007"
334endif 344endif
335 345
@@ -339,6 +349,9 @@ if has("multi_byte")
339 set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) 349 set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below)
340 set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those 350 set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those
341 351
352 set fillchars+=fold:\ | "
353 set fillchars+=vert:\│ | " cool vertical split char
354
342 set listchars= | " initialize empty listchars 355 set listchars= | " initialize empty listchars
343 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) 356 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
344 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) 357 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
@@ -472,6 +485,14 @@ if has("autocmd")
472 augroup END 485 augroup END
473 endif 486 endif
474 487
488 " use the shada/viminfo file to return the cursor to where it was...
489 function! ReturnCursor()
490 if line("'\"") > 1 && line("'\"") <= line("$")
491 exe "normal! g`\""
492 endif
493 endfunction
494 autocmd! BufReadPost * call ReturnCursor()
495
475 496
476 augroup ToggleQuickFix 497 augroup ToggleQuickFix
477 function! ToggleQuickFix() 498 function! ToggleQuickFix()
@@ -510,6 +531,7 @@ if has("autocmd")
510 augroup CurrentFileName 531 augroup CurrentFileName
511 highlight CurrentFileName ctermbg=yellow guibg=yellow 532 highlight CurrentFileName ctermbg=yellow guibg=yellow
512 533
534 let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'"
513 " highlight the current files name inside the document... 535 " highlight the current files name inside the document...
514 let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" 536 let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'"
515 " put the current files name after the cursor... 537 " put the current files name after the cursor...
@@ -618,3 +640,4 @@ let g:netrw_winsize = 20 | " window size in percent
618 640
619 641
620" autocmd BufEnter * lcd %:p:h | " Plugin vim-rooter get used instead (which is much more sane as well) 642" autocmd BufEnter * lcd %:p:h | " Plugin vim-rooter get used instead (which is much more sane as well)
643" set termguicolors
..