aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2016-10-15 04:03:40 +0200
committerMax Christian Pohle2016-10-15 04:03:40 +0200
commit6f1d9ec580188a9585d21d193a97f262e800b3d6 (patch)
treef21fabff4d5b627fd72445bf24315e8a2d0640a8
parent92f9cd82d1d5fcda96b0dc0ee78edb21f13e7743 (diff)
downloadvim-6f1d9ec580188a9585d21d193a97f262e800b3d6.tar.bz2
vim-6f1d9ec580188a9585d21d193a97f262e800b3d6.zip
Conditional <Tab>-Key
When NERDTree has the focus: Jump to the file, but when the file has the focus, jump to the next buffer.
-rw-r--r--vimrc15
1 files changed, 12 insertions, 3 deletions
diff --git a/vimrc b/vimrc
index 8050640..418ce26 100644
--- a/vimrc
+++ b/vimrc
@@ -72,9 +72,15 @@ set statusline+=%*
72let g:LatexBox_latexmk_preview_continuously = 1 72let g:LatexBox_latexmk_preview_continuously = 1
73let g:LatexBox_viewer = "evince" 73let g:LatexBox_viewer = "evince"
74let g:syntastic_always_populate_loc_list = 1 74let g:syntastic_always_populate_loc_list = 1
75let g:syntastic_auto_loc_list = 1 75let g:syntastic_auto_loc_list = 0
76let g:syntastic_check_on_open = 1 76let g:syntastic_check_on_open = 1
77let g:syntastic_check_on_wq = 0 77let g:syntastic_check_on_wq = 0
78let g:syntastic_quiet_messages = {"type":"style"} " filter (=do not display) style/formatting errors and warnings
79" Syntastic
80let g:syntastic_error_symbol = '✖'
81let g:syntastic_style_error_symbol = '✗'
82let g:syntastic_warning_symbol = '➔'
83let g:syntastic_style_warning_symbol = '≈'
78 84
79Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures 85Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures
80let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe 86let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe
@@ -124,13 +130,16 @@ inoremap <C-Space> <C-x><C-o>
124"inoremap <C-@> <C-Space> 130"inoremap <C-@> <C-Space>
125vnoremap < <gv| " allows deindenting a selected block and keeps selection 131vnoremap < <gv| " allows deindenting a selected block and keeps selection
126vnoremap > >gv| " allows indenting a selected block and keeps selection 132vnoremap > >gv| " allows indenting a selected block and keeps selection
127nnoremap <Tab> :bn<CR>| " lets one use (CTRL+)Tab to switch between buffers 133" if NERDTree has the focus, pressing <Tab> should jump to the next window, but if the file
128nnoremap <S-Tab> :bp<CR>| " use (CTRL+)Shift+Tab to switch to previous buffers 134" buffer is selected <Tab> should select the next buffer (:bn). That is archived by :h map-expr
135nnoremap <expr> <Tab> bufname("%")=='NERD_tree_1' ? '<C-W><C-W>' : ':bn<CR>'
136nnoremap <expr> <S-Tab> bufname("%")=='NERD_tree_1' ? '<C-W><C-W>' : ':bp<CR>'
129inoremap <C-Backspace> <C-W>| " Bind CTRL+Backspace to vims version (CTRL+W) in insert mode 137inoremap <C-Backspace> <C-W>| " Bind CTRL+Backspace to vims version (CTRL+W) in insert mode
130 138
131 139
132" settings ============================================. 140" settings ============================================.
133" set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here 141" set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here
142set mouse=a | " also supported by vim, should be default
134set noshowmode | " because we are using some powerline derivat 143set noshowmode | " because we are using some powerline derivat
135set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) 144set hidden | " allows switiching buffers even if the current buffer contains changes (displays +)
136set confirm | " asks 'do you want to save?' 145set confirm | " asks 'do you want to save?'
..