agregue vim-tmux navigator
This commit is contained in:
parent
0b080f9b1a
commit
8af3cdc3bd
|
@ -4,7 +4,7 @@ let g:loaded_python_provider=1 " Disable python 2 interfa
|
|||
let g:python_host_skip_check=1 " Skip python 2 host check
|
||||
let g:python3_host_prog = '/usr/bin/python3'
|
||||
let g:tagbar_ctags_bin = '/usr/bin/ctags'
|
||||
let python_highlight_all=1
|
||||
let python_highlight_all=1 " full python syntax highlighting
|
||||
" }}}
|
||||
" Plugins {{{
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
|
@ -19,11 +19,12 @@ Plug 'tmsvg/pear-tree'
|
|||
Plug 'tpope/vim-commentary'
|
||||
Plug 'honza/vim-snippets'
|
||||
Plug 'mhartington/oceanic-next'
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
call plug#end()
|
||||
" }}}
|
||||
" Options {{{
|
||||
set path+=**
|
||||
set binary
|
||||
set path+=** " Full tab completion with subfolders and all
|
||||
set inccommand=nosplit " Live preview of substitutes and other similar commands
|
||||
set clipboard^=unnamedplus " system clipboard (requires +clipboard)
|
||||
set fileencoding=utf-8 " The encoding written to file.
|
||||
|
@ -64,8 +65,8 @@ set tabstop=4 " Number of spaces a <Tab> equals
|
|||
set shiftwidth=4 " Number of spaces to use in auto(indent)
|
||||
set softtabstop=4 " While performing editing operations
|
||||
set shiftround " Round indent to multiple of 'shiftwidth'
|
||||
set breakindent " Keep indentation
|
||||
set title
|
||||
set breakindent
|
||||
set redrawtime=500
|
||||
set ttimeoutlen=10
|
||||
set nowritebackup
|
||||
|
@ -491,6 +492,14 @@ map <silent> <Leader>xx :call SendToFoxdot()<CR>
|
|||
map <silent> <Leader>x. :call SilenceFoxDot()<CR>
|
||||
map <silent> <Leader>xf :set filetype=foxdot<CR>
|
||||
"}}}
|
||||
" Vim-Tmux Navigator {{{
|
||||
let g:tmux_navigator_no_mappings = 1
|
||||
|
||||
nnoremap <silent> <M-h> :TmuxNavigateLeft<cr>
|
||||
nnoremap <silent> <M-j> :TmuxNavigateDown<cr>
|
||||
nnoremap <silent> <M-k> :TmuxNavigateUp<cr>
|
||||
nnoremap <silent> <M-l> :TmuxNavigateRight<cr>
|
||||
"}}}
|
||||
"Mappings {{{
|
||||
"Normal {{{
|
||||
" Plug
|
||||
|
@ -563,12 +572,6 @@ noremap <silent> <End> g<End>
|
|||
nnoremap Y 0y$
|
||||
nnoremap <leader>y y$
|
||||
|
||||
" Alt to switch windows
|
||||
nnoremap <M-j> <C-W><C-J>
|
||||
nnoremap <M-k> <C-W><C-K>
|
||||
nnoremap <M-l> <C-W><C-L>
|
||||
nnoremap <M-h> <C-W><C-H>
|
||||
|
||||
" Tab movement
|
||||
nnoremap tn :tabnew<cr>
|
||||
nnoremap th :tabfirst<cr>
|
||||
|
|
|
@ -64,7 +64,7 @@ super + {t,b,v,q,x,c}
|
|||
{subl,$BROWSER,pavucontrol,powermenu,$TERMINAL,gsimplecal}
|
||||
|
||||
super + z
|
||||
termite --name=multi -e termux
|
||||
termite --name=multi
|
||||
|
||||
super + {n,m}
|
||||
termite --name=flota -e {nmtui,brandr}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# vim:ft=zsh
|
||||
# Tmux {{{
|
||||
if command -v tmux >/dev/null 2>&1; then
|
||||
test -z "$TMUX" && (tmux new -A -s shell)
|
||||
test -z "$TMUX" && (tmux new -A -s "Z")
|
||||
fi
|
||||
# When you clear the terminal with ctrl-l anything on-screen is not saved (this is compatible with xterm behavior).
|
||||
# In contrast, GNU screen will first push anything on-screen into the scrollback buffer before clearing the screen.
|
||||
|
|
45
.tmux.conf
45
.tmux.conf
|
@ -68,6 +68,7 @@ set -g prefix M-a
|
|||
bind-key M-a send-prefix
|
||||
|
||||
# Varios
|
||||
bind-key ? list-keys
|
||||
bind-key D detach-client
|
||||
bind-key : command-prompt
|
||||
bind-key R respawn-window
|
||||
|
@ -75,24 +76,38 @@ bind-key T command-prompt 'rename-window %%'
|
|||
bind-key S command-prompt 'rename-session %%'
|
||||
bind-key r source-file $HOME/.tmux.conf \; display "Config Reloaded"
|
||||
|
||||
# Cambiar de pane usando alt-flecha sin prefijo
|
||||
bind-key -n M-Left select-pane -L
|
||||
bind-key -n M-Right select-pane -R
|
||||
bind-key -n M-Up select-pane -U
|
||||
bind-key -n M-Down select-pane -D
|
||||
# Vim-Tmux Navigator para cambiar de panes aca y en vim
|
||||
# https://github.com/christoomey/vim-tmux-navigator
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
|
||||
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
|
||||
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
|
||||
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
|
||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
|
||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'"
|
||||
|
||||
# Redimensionar usando alt-shift-flecha sin prefijo
|
||||
bind-key -nr M-S-Left resize-pane -L 2
|
||||
bind-key -nr M-S-Right resize-pane -R 2
|
||||
bind-key -nr M-S-Up resize-pane -U 2
|
||||
bind-key -nr M-S-Down resize-pane -D 2
|
||||
bind-key -T copy-mode-vi 'M-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'M-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'M-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'M-l' select-pane -R
|
||||
bind-key -T copy-mode-vi 'M-\' select-pane -l
|
||||
|
||||
# Redimensionar usando alt-flecha sin prefijo
|
||||
bind-key -nr M-Left resize-pane -L 2
|
||||
bind-key -nr M-Right resize-pane -R 2
|
||||
bind-key -nr M-Up resize-pane -U 2
|
||||
bind-key -nr M-Down resize-pane -D 2
|
||||
bind-key -n M-z resize-pane -Z
|
||||
|
||||
# Trocar panes usando alt-shift-flecha con prefijo
|
||||
bind-key M-S-Left swap-pane -s {left-of}
|
||||
bind-key M-S-Right swap-pane -s {right-of}
|
||||
bind-key M-S-Up swap-pane -U
|
||||
bind-key M-S-Down swap-pane -D
|
||||
# Trocar panes usando alt-shift-flecha sin prefijo
|
||||
bind-key -n M-S-Left swap-pane -s {left-of}
|
||||
bind-key -n M-S-Right swap-pane -s {right-of}
|
||||
bind-key -n M-S-Up swap-pane -U
|
||||
bind-key -n M-S-Down swap-pane -D
|
||||
|
||||
# Dividir
|
||||
bind-key | split-window -h -c "#{pane_current_path}"
|
||||
|
|
Reference in New Issue