From be01cc4d8bd96fb9fc9d9bb1d3929b5a8cf19c37 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Tue, 23 Jul 2019 19:02:47 -0400 Subject: [PATCH] tmux Alt bindings work on SSH Verbose refresh config. --- dot_config/fish/functions/refresh-config.fish | 10 ++- dot_config/fish/functions/vim-snippet.fish | 2 +- dot_tmux.conf.tmpl => dot_tmux.conf | 78 +++++-------------- dot_vimrc.tmpl | 2 - 4 files changed, 28 insertions(+), 64 deletions(-) rename dot_tmux.conf.tmpl => dot_tmux.conf (76%) diff --git a/dot_config/fish/functions/refresh-config.fish b/dot_config/fish/functions/refresh-config.fish index 37ed7ec..013d82e 100644 --- a/dot_config/fish/functions/refresh-config.fish +++ b/dot_config/fish/functions/refresh-config.fish @@ -1,7 +1,13 @@ function refresh-config 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 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 end diff --git a/dot_config/fish/functions/vim-snippet.fish b/dot_config/fish/functions/vim-snippet.fish index 9518bd5..1a06434 100755 --- a/dot_config/fish/functions/vim-snippet.fish +++ b/dot_config/fish/functions/vim-snippet.fish @@ -1,4 +1,4 @@ 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 end diff --git a/dot_tmux.conf.tmpl b/dot_tmux.conf similarity index 76% rename from dot_tmux.conf.tmpl rename to dot_tmux.conf index 1ac6ab8..c104df3 100644 --- a/dot_tmux.conf.tmpl +++ b/dot_tmux.conf @@ -1,4 +1,4 @@ -# basic [[[ +# basic {{{ # reload config file (change file location to your the tmux.conf you want to use) bind r source-file ~/.tmux.conf @@ -13,19 +13,18 @@ set -s escape-time 0 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 -# ]]] # - -{{ 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-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 -# ]]] panes # +# }}} panes # -# windows [[[ # +# windows {{{ # bind-key -n M-w new-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 -# ]]] 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 @@ -114,20 +76,20 @@ set -g status-interval 60 # Basic status bar colors 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-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:#P #[fg=colour39,bg=colour233,nobold]" 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-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] %a-%d-%m #[fg=colour39,bg=colour240]" -# ]]] +# }}} # Window status set -g window-status-format " #I:#W#F " @@ -168,9 +130,9 @@ set -g message-command-style bg=colour233,fg=black # Mode 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/tmux-sensible' @@ -182,6 +144,4 @@ set -g @plugin 'christoomey/vim-tmux-navigator' run -b '~/.tmux/plugins/tpm/tpm' -# ]]] plugins # - -# vim: fdm=marker ft=tmux.go-template +# }}} plugins # diff --git a/dot_vimrc.tmpl b/dot_vimrc.tmpl index 8ec856d..0c6cf9f 100644 --- a/dot_vimrc.tmpl +++ b/dot_vimrc.tmpl @@ -274,12 +274,10 @@ Plug 'christoomey/vim-tmux-navigator' " mappings [[[ " let g:tmux_navigator_no_mappings = 1 - {{ if eq .linux_os "arch" }} nnoremap :TmuxNavigateDown nnoremap :TmuxNavigateUp nnoremap :TmuxNavigateLeft nnoremap :TmuxNavigateRight - {{ end }} " nnoremap :TmuxNavigateDown " nnoremap :TmuxNavigateUp " nnoremap :TmuxNavigateLeft