aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2016-10-26 01:57:52 +0200
committerMax Christian Pohle2016-10-26 01:57:52 +0200
commit73c1b25d759b3881e8f317e395c9a168a2c3ad3d (patch)
tree7ae19499e948eb8bea875cc57b2c0521b61b3b4f
parente8693d549f7fbd922efb0659a8cd2c8e7d80e2ed (diff)
downloadvim-73c1b25d759b3881e8f317e395c9a168a2c3ad3d.tar.bz2
vim-73c1b25d759b3881e8f317e395c9a168a2c3ad3d.zip
Optimized for termite terminal
-rw-r--r--vimrc69
1 files changed, 42 insertions, 27 deletions
diff --git a/vimrc b/vimrc
index a6d90a1..c98cac6 100644
--- a/vimrc
+++ b/vimrc
@@ -14,13 +14,15 @@ map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>.
14 14
15" NERDTree: ==========================================. 15" NERDTree: ==========================================.
16Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy 16Plug 'scrooloose/nerdtree' | " replace NetRW, which is kind of buggy
17let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use <m> to create files in that included directory
17set winwidth=30 " keep NERDTreeWindow at least this size 18set winwidth=30 " keep NERDTreeWindow at least this size
18set winminwidth=30 " (and all other windows, so TODO: watch out) 19set winminwidth=30 " (and all other windows, so TODO: watch out)
19 20
21autocmd BufEnter * lcd %:p:h
20" depending on if NERDTree has the focus: 22" depending on if NERDTree has the focus:
21nnoremap <expr> 23nnoremap <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>'
24nnoremap <expr> 26nnoremap <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)
31autocmd 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
38let g:airline_detect_modified = 0 | 40let g:airline_detect_modified = 0 |
39let g:airline_detect_paste = 0 | 41let g:airline_detect_paste = 0 |
40let g:airline_exclude_preview = 1 | 42let g:airline_exclude_preview = 1 |
41let g:airline_extensions = ['tabline', 'branch', 'syntastic'] 43let g:airline_extensions = ['tabline', 'branch', 'syntastic', 'tagbar']
42let g:airline#extensions#tabline#disable_refresh = 1 | 44let g:airline#extensions#tabline#disable_refresh = 1 |
43let g:airline#extensions#tabline#enabled = 1 | 45let g:airline#extensions#tabline#enabled = 1 |
44let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path 46let g:airline#extensions#tabline#fnamemod = ':t:.' | " let airline just show the filename without its path
45let g:airline#extensions#tabline#show_buffers = 1 | 47let g:airline#extensions#tabline#show_buffers = 1 |
46let g:airline#extensions#tabline#show_tabs = 0 | 48let g:airline#extensions#tabline#show_tabs = 0 |
47let g:airline#extensions#tagbar#enabled = 1 | 49let g:airline#extensions#tagbar#enabled = 0 |
48let g:airline#extensions#tagbar#flags = 's' 50let g:airline#extensions#tagbar#flags = 's'
49let g:airline#extensions#whitespace#enabled = 0 | 51let g:airline#extensions#whitespace#enabled = 0 |
50let g:airline#extensions#wordcount#enabled = 0 | 52let g:airline#extensions#wordcount#enabled = 0 |
@@ -64,26 +66,32 @@ Plug 'sheerun/vim-polyglot' " better syntax highlighti
64Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more 66Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more
65let g:tagbar_autoclose = 1 67let g:tagbar_autoclose = 1
66let g:tagbar_autofocus = 1 68let g:tagbar_autofocus = 1
67let g:tagbar_compact = 1 69let g:tagbar_autoshowtag = 1
70let g:tagbar_compact = 0
68let g:tagbar_indent = 0 71let g:tagbar_indent = 0
72let g:tagbar_foldlevel = 99
69nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L 73nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L
70 74
71 75
72" Autocompleter: =====================================. 76" Autocompleter: =====================================.
73Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... 77Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/...
74Plug 'Valloric/YouCompleteMe' 78Plug 'Valloric/YouCompleteMe'
75let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar
76let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar
77let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file 79let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file
78let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure
79let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword
80let g:ycm_complete_in_comments = 1 " Completion in comments 80let g:ycm_complete_in_comments = 1 " Completion in comments
81let g:ycm_complete_in_strings = 1 " Completion in string 81let g:ycm_complete_in_strings = 1 " Completion in string
82let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar
83let g:ycm_min_num_of_chars_for_completion = 1
84let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword
85let g:ycm_use_ultisnips_completer = 1 " Default 1, just ensure
86let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar
87
88
82 89
83Plug 'scrooloose/syntastic' 90Plug 'scrooloose/syntastic'
84set statusline+=%#warningmsg# 91set statusline+=%#warningmsg#
85set statusline+=%{SyntasticStatuslineFlag()} 92set statusline+=%{SyntasticStatuslineFlag()}
86set statusline+=%* 93set statusline+=%*
94set signcolumn=yes " always show the column
87let g:LatexBox_latexmk_preview_continuously = 1 95let g:LatexBox_latexmk_preview_continuously = 1
88let g:LatexBox_viewer = "evince" 96let g:LatexBox_viewer = "evince"
89let g:syntastic_always_populate_loc_list = 1 97let g:syntastic_always_populate_loc_list = 1
@@ -130,18 +138,6 @@ syntax on | " enable syntax highlighting
130syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) 138syntax 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
133let base16colorspace=256
134colorscheme 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
144hi 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
195set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) 191set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth)
196set ttimeoutlen=10 | " set esc key timeout in ms- 192set ttimeoutlen=10 | " set esc key timeout in ms-
197set ttyfast | " improves speed for terminal vim 193set ttyfast | " improves speed for terminal vim
194set updatetime=1000 | " updates the screen more often
198set ttyscroll=100 | " improves speed for terminal vim 195set ttyscroll=100 | " improves speed for terminal vim
199set writedelay=0 196set 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
211end 209end
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")
301endif 302endif
302 303
303 304
305let base16colorspace=256
306colorscheme 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
..