tmux navigator + navigation between splits

main
Steffen Rademacker 10 years ago
parent a3f84f407d
commit 22e9ddf373

@ -53,11 +53,12 @@ bind-key -r C-k resize-pane -U
bind-key -r C-h resize-pane -L
bind-key -r C-l resize-pane -R
# Navigation
bind-key j select-pane -D
bind-key k select-pane -U
bind-key h select-pane -L
bind-key l select-pane -R
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# Mouse support

27
vimrc

@ -29,6 +29,7 @@ NeoBundle 'Shougo/vimproc', {
\ },
\ }
NeoBundle 'calebsmith/vim-lambdify'
NeoBundle 'christoomey/vim-tmux-navigator'
NeoBundle 'editorconfig/editorconfig-vim'
NeoBundle 'edsono/vim-matchit'
NeoBundle 'gcmt/wildfire.vim'
@ -286,14 +287,15 @@ nnoremap <left> :bp<cr>
nnoremap <right> :bn<cr>
" Bubble/indent lines using unimpaired
nmap <C-k> [e
nmap <C-j> ]e
nmap <C-h> <<
nmap <C-l> >>
vmap <C-k> [egv
vmap <C-j> ]egv
vmap <C-h> <gv
vmap <C-l> >gv
" using left alt + hjkl on mac
nmap ˚ [e
nmap ∆ ]e
nmap ˙ <<
nmap ¬ >>
vmap ˚ [egv
vmap ∆ ]egv
vmap ˙ <gv
vmap ¬ >gv
" Switch between windows
nnoremap <tab> <C-w><C-w>
@ -331,7 +333,7 @@ let g:maplocalleader = ","
nnoremap <leader>\ <C-w>v<C-w>l
nnoremap <leader>- <C-w>s<C-w>j
" Adjust viewports to the same size
" Adjust viewports/splits to equal widths/heights
nnoremap <leader>= <C-w>=
" open a new split and edit the vimrc // easy sourcing vimrc
@ -350,20 +352,15 @@ nmap <leader>w :call <SID>StripTrailingWhitespaces()<CR>
" Find merge conflict markers
nmap <leader>g /\v^[<\|=>]{7}( .*\|$)<CR>
" Map <Leader>* to display all lines with keyword under cursor and ask which one to jump to
nmap <Leader>* [I:let nr = input("Enter line number: ")<Bar>exe "normal " . nr ."[\t"<CR>
" paste keeping indentation
nnoremap <leader>p p`[v`]=
" when over a class in html hit leader-f to find that class in css/scss/js
nmap <leader>f :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cnext<CR>
"======================================================================
" Plugin configuration and keymappings
"======================================================================
" vim sneak
let g:sneak#use_ic_scs = 1
let g:sneak#map_netrw = 0

Loading…
Cancel
Save