" Tmux integration to switch panes with Ctrl+{hjkl} if exists('$TMUX') function! TmuxOrSplitSwitch(wincmd, tmuxdir) let previous_winnr = winnr() silent! execute "wincmd " . a:wincmd if previous_winnr == winnr() call system("tmux select-pane -" . a:tmuxdir) redraw! endif endfunction let previous_title = substitute(system("tmux display-message -p '#{pane_title}'"), '\n', '', '') let &t_ti = "\2;vim\\\" . &t_ti let &t_te = "\2;". previous_title . "\\\" . &t_te nnoremap :call TmuxOrSplitSwitch('h', 'L') nnoremap :call TmuxOrSplitSwitch('j', 'D') nnoremap :call TmuxOrSplitSwitch('k', 'U') nnoremap :call TmuxOrSplitSwitch('l', 'R') else map h map j map k map l endif " coding preferences syntax on set noautoindent smarttab ts=2 sw=2 expandtab set showmatch set ruler