diff options
author | Max Christian Pohle | 2016-10-26 01:57:52 +0200 |
---|---|---|
committer | Max Christian Pohle | 2016-10-26 01:57:52 +0200 |
commit | 73c1b25d759b3881e8f317e395c9a168a2c3ad3d (patch) | |
tree | 7ae19499e948eb8bea875cc57b2c0521b61b3b4f | |
parent | e8693d549f7fbd922efb0659a8cd2c8e7d80e2ed (diff) | |
download | vim-73c1b25d759b3881e8f317e395c9a168a2c3ad3d.tar.bz2 vim-73c1b25d759b3881e8f317e395c9a168a2c3ad3d.zip |
Optimized for termite terminal
-rw-r--r-- | vimrc | 69 |
1 files changed, 42 insertions, 27 deletions
@@ -14,13 +14,15 @@ map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | |||
14 | 14 | ||
15 | " NERDTree: ==========================================. | 15 | " NERDTree: ==========================================. |
16 | Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy | 16 | Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy |
17 | let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory | ||
17 | set winwidth=30 " keep NERDTreeWindow at least this size | 18 | set winwidth=30 " keep NERDTreeWindow at least this size |
18 | set winminwidth=30 " (and all other windows, so TODO: watch out) | 19 | set winminwidth=30 " (and all other windows, so TODO: watch out) |
19 | 20 | ||
21 | autocmd BufEnter * lcd %:p:h | ||
20 | " depending on if NERDTree has the focus: | 22 | " depending on if NERDTree has the focus: |
21 | nnoremap <expr> | 23 | nnoremap <expr> |
22 | \ <leader><leader> | 24 | \ <leader><leader> |
23 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeCWD<CR>' | 25 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' |
24 | nnoremap <expr> | 26 | nnoremap <expr> |
25 | \ <Tab> | 27 | \ <Tab> |
26 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' | 28 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' |
@@ -28,8 +30,8 @@ nnoremap <expr> | |||
28 | \ <S-Tab> | 30 | \ <S-Tab> |
29 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' | 31 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' |
30 | " close NERDTree if it is the last remaining window (taken from the official documentation) | 32 | " close NERDTree if it is the last remaining window (taken from the official documentation) |
31 | autocmd bufenter * | 33 | " autocmd bufenter * |
32 | \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | 34 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif |
33 | 35 | ||
34 | 36 | ||
35 | " AIRLINE: ===========================================. | 37 | " AIRLINE: ===========================================. |
@@ -38,13 +40,13 @@ set laststatus=2 | " required by AirLine, w | |||
38 | let g:airline_detect_modified = 0 | | 40 | let g:airline_detect_modified = 0 | |
39 | let g:airline_detect_paste = 0 | | 41 | let g:airline_detect_paste = 0 | |
40 | let g:airline_exclude_preview = 1 | | 42 | let g:airline_exclude_preview = 1 | |
41 | let g:airline_extensions = ['tabline', 'branch', 'syntastic'] | 43 | let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar'] |
42 | let g:airline#extensions#tabline#disable_refresh = 1 | | 44 | let g:airline#extensions#tabline#disable_refresh = 1 | |
43 | let g:airline#extensions#tabline#enabled = 1 | | 45 | let g:airline#extensions#tabline#enabled = 1 | |
44 | let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path | 46 | let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path |
45 | let g:airline#extensions#tabline#show_buffers = 1 | | 47 | let g:airline#extensions#tabline#show_buffers = 1 | |
46 | let g:airline#extensions#tabline#show_tabs = 0 | | 48 | let g:airline#extensions#tabline#show_tabs = 0 | |
47 | let g:airline#extensions#tagbar#enabled = 1 | | 49 | let g:airline#extensions#tagbar#enabled = 0 | |
48 | let g:airline#extensions#tagbar#flags = 's' | 50 | let g:airline#extensions#tagbar#flags = 's' |
49 | let g:airline#extensions#whitespace#enabled = 0 | | 51 | let g:airline#extensions#whitespace#enabled = 0 | |
50 | let g:airline#extensions#wordcount#enabled = 0 | | 52 | let g:airline#extensions#wordcount#enabled = 0 | |
@@ -64,26 +66,32 @@ Plug 'sheerun/vim-polyglot' " better syntax highlighti | |||
64 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more | 66 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more |
65 | let g:tagbar_autoclose = 1 | 67 | let g:tagbar_autoclose = 1 |
66 | let g:tagbar_autofocus = 1 | 68 | let g:tagbar_autofocus = 1 |
67 | let g:tagbar_compact = 1 | 69 | let g:tagbar_autoshowtag = 1 |
70 | let g:tagbar_compact = 0 | ||
68 | let g:tagbar_indent = 0 | 71 | let g:tagbar_indent = 0 |
72 | let g:tagbar_foldlevel = 99 | ||
69 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L | 73 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L |
70 | 74 | ||
71 | 75 | ||
72 | " Autocompleter: =====================================. | 76 | " Autocompleter: =====================================. |
73 | Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | 77 | Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... |
74 | Plug 'Valloric/YouCompleteMe' | 78 | Plug 'Valloric/YouCompleteMe' |
75 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
76 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
77 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | 79 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file |
78 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
79 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
80 | let g:ycm_complete_in_comments = 1 " Completion in comments | 80 | let g:ycm_complete_in_comments = 1 " Completion in comments |
81 | let g:ycm_complete_in_strings = 1 " Completion in string | 81 | let g:ycm_complete_in_strings = 1 " Completion in string |
82 | let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar | ||
83 | let g:ycm_min_num_of_chars_for_completion = 1 | ||
84 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | ||
85 | let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure | ||
86 | let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar | ||
87 | |||
88 | |||
82 | 89 | ||
83 | Plug 'scrooloose/syntastic' | 90 | Plug 'scrooloose/syntastic' |
84 | set statusline+=%#warningmsg# | 91 | set statusline+=%#warningmsg# |
85 | set statusline+=%{SyntasticStatuslineFlag()} | 92 | set statusline+=%{SyntasticStatuslineFlag()} |
86 | set statusline+=%* | 93 | set statusline+=%* |
94 | set signcolumn=yes " always show the column | ||
87 | let g:LatexBox_latexmk_preview_continuously = 1 | 95 | let g:LatexBox_latexmk_preview_continuously = 1 |
88 | let g:LatexBox_viewer = "evince" | 96 | let g:LatexBox_viewer = "evince" |
89 | let g:syntastic_always_populate_loc_list = 1 | 97 | let g:syntastic_always_populate_loc_list = 1 |
@@ -130,18 +138,6 @@ syntax on | " enable syntax highlighting | |||
130 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | 138 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) |
131 | " set term=xtermc | " required on solaris | 139 | " set term=xtermc | " required on solaris |
132 | 140 | ||
133 | let base16colorspace=256 | ||
134 | colorscheme base16-phd | ||
135 | " colorscheme base16-embers | ||
136 | " colorscheme base16-flat | ||
137 | " colorscheme base16-summerfruit-dark | ||
138 | " colorscheme base16-tommorow | ||
139 | " colorscheme base16-default-dark | ||
140 | |||
141 | |||
142 | " colorscheme customizations ========================= | ||
143 | " override colorscheme's background color in order to honor the terminals background transparency | ||
144 | hi normal ctermbg=none | ||
145 | 141 | ||
146 | 142 | ||
147 | " Shortcut mods =======================================. | 143 | " Shortcut mods =======================================. |
@@ -195,6 +191,7 @@ set thesaurus+=/home/max/.vim/thesaurus/php.txt | |||
195 | set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) | 191 | set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) |
196 | set ttimeoutlen=10 | " set esc key timeout in ms- | 192 | set ttimeoutlen=10 | " set esc key timeout in ms- |
197 | set ttyfast | " improves speed for terminal vim | 193 | set ttyfast | " improves speed for terminal vim |
194 | set updatetime=1000 | " updates the screen more often | ||
198 | set ttyscroll=100 | " improves speed for terminal vim | 195 | set ttyscroll=100 | " improves speed for terminal vim |
199 | set writedelay=0 | 196 | set writedelay=0 |
200 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) | 197 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) |
@@ -207,6 +204,7 @@ if has("multi_byte") | |||
207 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | 204 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) |
208 | set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) | 205 | set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) |
209 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | 206 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) |
207 | set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) | ||
210 | set showbreak+=› | " symbol used in the beginning of a wrapped line | 208 | set showbreak+=› | " symbol used in the beginning of a wrapped line |
211 | end | 209 | end |
212 | 210 | ||
@@ -247,8 +245,9 @@ if has("autocmd") | |||
247 | augroup set_window_title " { | 245 | augroup set_window_title " { |
248 | " autocmd BufWinEnter quickfix setl statusline=%t | 246 | " autocmd BufWinEnter quickfix setl statusline=%t |
249 | " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" | 247 | " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" |
250 | autocmd BufEnter * let &titlestring = "%t|".$USER."@".hostname().":%{expand(\"%:~:.:h\")}%=%y" | 248 | autocmd CursorHold * let &titlestring = "%t|".$USER."@".hostname().":%{expand(\"%:~:.:h\")}%=%y" |
251 | 249 | set title | |
250 | " autocmd CursorHold * let &titlestring = "Vim (".airline#extensions#tagbar#currenttag().")" | ||
252 | 251 | ||
253 | " set window title for screen(3) | 252 | " set window title for screen(3) |
254 | if &term == "screen" | 253 | if &term == "screen" |
@@ -262,10 +261,12 @@ if has("autocmd") | |||
262 | augroup END | 261 | augroup END |
263 | 262 | ||
264 | augroup visual_mode_shows_unprintable " { | 263 | augroup visual_mode_shows_unprintable " { |
265 | set nolist | " shows unprinable characters in the current line | ||
266 | " set cursorline | " use setcursorline in order to highlight non printable chars in the current line | 264 | " set cursorline | " use setcursorline in order to highlight non printable chars in the current line |
267 | autocmd ColorScheme * highlight NonText ctermbg=0 gui=bold guifg=#061229 | 265 | autocmd ColorScheme * highlight normal ctermbg=NONE |
268 | autocmd ColorScheme * highlight CursorLineNr term=bold ctermfg=Yellow gui=bold guifg=Yellow | 266 | " set list | " shows unprinable characters in the current line |
267 | autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE | ||
268 | autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE | ||
269 | " autocmd ColorScheme * highlight CursorLineNr term=bold ctermbg=NONE ctermfg=0 gui=bold guifg=Yellow | ||
269 | " | 270 | " |
270 | " | 271 | " |
271 | " highlight NonText guifg=#1d1f21 | " make non printable chars invisible. The active line is an exception. | 272 | " highlight NonText guifg=#1d1f21 | " make non printable chars invisible. The active line is an exception. |
@@ -301,6 +302,20 @@ if has("autocmd") | |||
301 | endif | 302 | endif |
302 | 303 | ||
303 | 304 | ||
305 | let base16colorspace=256 | ||
306 | colorscheme base16-phd | ||
307 | " colorscheme base16-embers | ||
308 | " colorscheme base16-flat | ||
309 | " colorscheme base16-summerfruit-dark | ||
310 | " colorscheme base16-tommorow | ||
311 | " colorscheme base16-default-dark | ||
312 | |||
313 | |||
314 | " colorscheme customizations ========================= | ||
315 | " override colorscheme's background color in order to honor the terminals background transparency | ||
316 | |||
317 | |||
318 | |||
304 | " if filereadable(expand("~/.vimrc_background")) | 319 | " if filereadable(expand("~/.vimrc_background")) |
305 | " let base16colorspace=256 | 320 | " let base16colorspace=256 |
306 | " source ~/.vimrc_background | 321 | " source ~/.vimrc_background |