Browse Source

tmux Alt bindings work on SSH

Verbose refresh config.
red-hat-laptop
Kevin Mok 5 years ago
parent
commit
be01cc4d8b
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 10
      dot_config/fish/functions/refresh-config.fish
  2. 2
      dot_config/fish/functions/vim-snippet.fish
  3. 78
      dot_tmux.conf
  4. 2
      dot_vimrc.tmpl

10
dot_config/fish/functions/refresh-config.fish

@ -1,7 +1,13 @@
function refresh-config function refresh-config
chezmoi apply chezmoi apply
and sync-shortcuts
and source ~/.config/fish/key_abbr.fish > /dev/null
and echo 'Applied chezmoi.'
and tmux source-file ~/.tmux.conf and tmux source-file ~/.tmux.conf
and echo 'Sourced tmux config.'
sync-shortcuts
echo 'Synced shortcuts.'
source ~/.config/fish/key_abbr.fish > /dev/null
and echo 'Sourced shortcuts.'
and echo 'Reloading fish.'
and fish and fish
end end

2
dot_config/fish/functions/vim-snippet.fish

@ -1,4 +1,4 @@
function vim-snippet function vim-snippet
set snips_dir "/home/kevin/.vim/plugged/vim-snippets/UltiSnips"
set snips_dir "$HOME/.vim/plugged/vim-snippets/UltiSnips"
$EDITOR $snips_dir/$argv[1].snippets $EDITOR $snips_dir/$argv[1].snippets
end end

78
dot_tmux.conf.tmpl → dot_tmux.conf

@ -1,4 +1,4 @@
# basic [[[
# basic {{{
# reload config file (change file location to your the tmux.conf you want to use) # reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf
@ -13,19 +13,18 @@ set -s escape-time 0
unbind '"' unbind '"'
unbind % unbind %
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key , command-prompt "rename-session '%%'"
bind-key -n M-d detach
bind-key -n M-c copy-mode
bind v split-window -v bind v split-window -v
# ]]] #
{{ if .gui }}# [[[
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key , command-prompt "rename-session '%%'"
bind-key -n M-d detach
# }}} #
# panes [[[ #
# panes {{{ #
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L" 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-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
@ -43,9 +42,9 @@ bind-key -n M-Enter split-window -h
bind-key -n M-q kill-pane bind-key -n M-q kill-pane
# ]]] panes #
# }}} panes #
# windows [[[ #
# windows {{{ #
bind-key -n M-w new-window bind-key -n M-w new-window
bind x kill-window bind x kill-window
@ -57,46 +56,9 @@ bind-key -n M-n next-window
bind-key -n C-S-[ swap-window -t -1 bind-key -n C-S-[ swap-window -t -1
bind-key -n C-S-] swap-window -t +1 bind-key -n C-S-] swap-window -t +1
# ]]] windows #
bind-key -n M-c copy-mode
# }}} windows #
# ]]]
{{ else }}# [[[
# panes [[[ #
bind-key -n C-Left if-shell "$is_vim" "send-keys C-Left" "select-pane -L"
bind-key -n C-Down if-shell "$is_vim" "send-keys C-Down" "select-pane -D"
bind-key -n C-Up if-shell "$is_vim" "send-keys C-Up" "select-pane -U"
bind-key -n C-Right if-shell "$is_vim" "send-keys C-Right" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-Left select-pane -L
bind-key -T copy-mode-vi C-Down select-pane -D
bind-key -T copy-mode-vi C-Up select-pane -U
bind-key -T copy-mode-vi C-Right select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
# switch panes using Alt-arrow without prefix
# bind -n C-Down select-pane -D
# bind -n C-Up select-pane -U
# bind -n C-Left select-pane -L
# bind -n C-l select-pane -R
bind h split-window -h
bind-key x kill-pane
# ]]] panes #
bind-key -n C-Left previous-window
bind-key -n C-Right next-window
bind-key & kill-window
{{ end }}# ]]]
# status bar [[[ #
# status bar {{{ #
# #
# Powerline Double Cyan - Tmux Theme # Powerline Double Cyan - Tmux Theme
@ -114,20 +76,20 @@ set -g status-interval 60
# Basic status bar colors # Basic status bar colors
set -g status-style fg=colour240,bg=colour233 set -g status-style fg=colour240,bg=colour233
# Left side of status bar[[[
# Left side of status bar{{{
set -g status-left-style bg=colour233,fg=colour243 set -g status-left-style bg=colour233,fg=colour243
set -g status-left-length 40 set -g status-left-length 40
# set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]"
# set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]" # set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]"
set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]" set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]"
# ]]]
# }}}
# Right side of status bar[[[
# Right side of status bar{{{
set -g status-right-style bg=colour233,fg=colour243 set -g status-right-style bg=colour233,fg=colour243
set -g status-right-length 150 set -g status-right-length 150
# set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour39,bg=colour240]#[fg=colour233,bg=colour39,bold] #H " # set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour39,bg=colour240]#[fg=colour233,bg=colour39,bold] #H "
set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %a-%d-%m #[fg=colour39,bg=colour240]" set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %a-%d-%m #[fg=colour39,bg=colour240]"
# ]]]
# }}}
# Window status # Window status
set -g window-status-format " #I:#W#F " set -g window-status-format " #I:#W#F "
@ -168,9 +130,9 @@ set -g message-command-style bg=colour233,fg=black
# Mode # Mode
set -g mode-style bg=colour39,fg=colour232 set -g mode-style bg=colour39,fg=colour232
# ]]] status bar #
# }}} status bar #
# plugins [[[
# plugins {{{
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
@ -182,6 +144,4 @@ set -g @plugin 'christoomey/vim-tmux-navigator'
run -b '~/.tmux/plugins/tpm/tpm' run -b '~/.tmux/plugins/tpm/tpm'
# ]]] plugins #
# vim: fdm=marker ft=tmux.go-template
# }}} plugins #

2
dot_vimrc.tmpl

@ -274,12 +274,10 @@ Plug 'christoomey/vim-tmux-navigator'
" mappings [[[ " " mappings [[[ "
let g:tmux_navigator_no_mappings = 1 let g:tmux_navigator_no_mappings = 1
{{ if eq .linux_os "arch" }}
nnoremap <A-j> :TmuxNavigateDown<cr> nnoremap <A-j> :TmuxNavigateDown<cr>
nnoremap <A-k> :TmuxNavigateUp<cr> nnoremap <A-k> :TmuxNavigateUp<cr>
nnoremap <A-h> :TmuxNavigateLeft<cr> nnoremap <A-h> :TmuxNavigateLeft<cr>
nnoremap <A-l> :TmuxNavigateRight<cr> nnoremap <A-l> :TmuxNavigateRight<cr>
{{ end }}
" nnoremap <C-Down> :TmuxNavigateDown<cr> " nnoremap <C-Down> :TmuxNavigateDown<cr>
" nnoremap <C-Up> :TmuxNavigateUp<cr> " nnoremap <C-Up> :TmuxNavigateUp<cr>
" nnoremap <C-Left> :TmuxNavigateLeft<cr> " nnoremap <C-Left> :TmuxNavigateLeft<cr>

Loading…
Cancel
Save