integrate vim and tmux pane movement

This commit is contained in:
Marty Oehme 2019-03-15 16:26:57 +01:00
parent 00258bc985
commit c4eb15e5b7
2 changed files with 12 additions and 2 deletions

View file

@ -5,6 +5,7 @@ call plug#begin('~/.local/share/nvim/plugged')
" Base " Base
Plug 'tpope/vim-sensible' Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
Plug 'christoomey/vim-tmux-navigator' " add seamless movement between vim and tmux
" Ecosystem " Ecosystem
" Plug 'tpope/vim-fugitive' - Will have to take a closer look some other time " Plug 'tpope/vim-fugitive' - Will have to take a closer look some other time
@ -44,6 +45,9 @@ let g:tmuxline_preset = {
\'z' : '#H', \'z' : '#H',
\'options' : {}} \'options' : {}}
" automatically save the current buffer when navigating away from vim
let g:tmux_navigator_save_on_switch = 1
" VIM SETTINGS " VIM SETTINGS
" set truecolor (neovim) " set truecolor (neovim)
set termguicolors set termguicolors
@ -110,7 +114,12 @@ vnoremap <F1> <ESC>
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR> nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" 'open new tab' with leader-t (opens new buffer and switches to it) " 'open new tab' with leader-t (opens new buffer and switches to it)
nnoremap <leader>t <C-w>v<C-w><C-w> " open actual new tab with leader-T
nnoremap <leader>t <C-w>v<C-w><C-w>:NERDTreeToggle<cr>
nnoremap <leader>T :tabedit .<cr>
" save current buffer with Ctrl-s
nnoremap <C-s> :w<cr>
" open NERDtree with leader-e " open NERDtree with leader-e
nnoremap <leader>e :NERDTreeToggle<CR> nnoremap <leader>e :NERDTreeToggle<CR>

View file

@ -53,6 +53,7 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'Morantron/tmux-fingers' set -g @plugin 'Morantron/tmux-fingers'
set -g @plugin 'christoomey/vim-tmux-navigator'
run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm" run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm"
@ -156,6 +157,6 @@ setw -g window-status-activity-fg "#c8c8c8"
setw -g window-status-separator "" setw -g window-status-separator ""
setw -g window-status-bg "#2e2e2e" setw -g window-status-bg "#2e2e2e"
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#{prefix_highlight}#[fg=#c8c8c8,bg=#2e2e2e] %H:%M:%S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H " set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#{prefix_highlight} #[fg=#c8c8c8,bg=#2e2e2e] %H:%M:%S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H "
setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e]  #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e]  #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"