commit 3e140f543738a3dd4bcd5c57571c31cc99244ab2
parent 4ca57e48f5abf7b454442a8f365517efac28432c
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 4 Oct 2019 17:05:25 +0200
Remove most meta bindings fom tmux, fix Repeat command
Diffstat:
M | .tmux.conf | | | 52 | ++-------------------------------------------------- |
1 file changed, 2 insertions(+), 50 deletions(-)
diff --git a/.tmux.conf b/.tmux.conf
@@ -4,11 +4,9 @@ set-option -g prefix C-a # Set prefix to <C-a>
bind a send-prefix # Send <C-a> with <C-a>a
bind R source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded"
-bind -n M-R source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded"
set -g history-limit 10000 # lines to keep in hisoty
set-option -g display-panes-time 3000 # Timeout for pane-numbering in ms
-bind -n M-q display-panes
set-option -sg escape-time 0 # speed up commands
set -g mouse on # enable mouse (tmux 2.1+)
set -g base-index 1 # start window numbering at 1
@@ -44,7 +42,6 @@ set -g message-command-style fg=default # appearance of status message cmds
set -g status-left ""
# Toggle bar visibility
-bind -r -n M-t set -g status
bind -r t set -g status
# Hide status bar if there is only one window
@@ -73,28 +70,6 @@ bind -r J resize-pane -D 5 # resize pane down with <C-a>J
bind -r K resize-pane -U 5 # resize pane up with <C-a>K
bind -r L resize-pane -R 5 # resize pane right with <C-a>L
-# Navigate panes with Meta (alt) modifier + hjkl
-bind -r -n M-h select-pane -L # navigate left with M-h
-bind -r -n M-j select-pane -D # navigate down with M-j
-bind -r -n M-k select-pane -U # navigate up with M-k
-bind -r -n M-l select-pane -R # navigate right with M-l
-bind -r -n M-H resize-pane -L 5 # resize pane left with M-H
-bind -r -n M-J resize-pane -D 5 # resize pane down with M-J
-bind -r -n M-K resize-pane -U 5 # resize pane up with M-K
-bind -r -n M-L resize-pane -R 5 # resize pane right with M-L
-
-# Navigate windows with Meta (alt) modifier + number keys
-bind -n M-1 select-window -t :=1
-bind -n M-2 select-window -t :=2
-bind -n M-3 select-window -t :=3
-bind -n M-4 select-window -t :=4
-bind -n M-5 select-window -t :=5
-bind -n M-6 select-window -t :=6
-bind -n M-7 select-window -t :=7
-bind -n M-8 select-window -t :=8
-bind -n M-9 select-window -t :=9
-bind -n M-0 select-window -t :=10
-
bind C-s last-window # go to last window with <C-a><C-s>
bind C-a last-pane # go to last pane with <C-a><C-a>
bind -n M-Tab last-window # go to last pane with M-Tab
@@ -104,9 +79,6 @@ bind -r b previous-window # next window with <C-a>p
bind -n -r M-n next-window # next window with <M-n>
bind -n -r M-b previous-window # previous window with <M-n>
-bind -n M-, run-shell "tmux list-windows -F \"##I:##W\" | fzf-tmux | cut -d \":\" -f 1 | xargs tmux select-window -t"
-bind -n M-. run-shell "tmux list-sessions -F \"##S\" | fzf-tmux | xargs tmux switch -t"
-
#### LAYOUT CHANGING BINDINGS
@@ -118,23 +90,14 @@ bind -r z resize-pane -Z # toggle pane zoom with <C-a>z
bind -r y next-layout # cycle to next pane layout with <C-a>y
bind -r Y previous-layout # cycle to previous pane layout with <C-a>Y
bind -r r rotate-window # rotate panes with <C-a>r
-bind -n M-z resize-pane -Z # toggle pane zoom with <M-z>
-bind -n -r M-y next-layout # cycle to next pane layout with <M-y>
-bind -n -r M-Y previous-layout # cycle to previous pane layout with <M-Y>
-bind -n -r M-r rotate-window # rotate panes with <M-r>
bind -r B swap-window -t -1 # Swap window left
bind -r N swap-window -t +1 # Swap window right
-bind -n -r M-B swap-window -t -1 # Swap window left
-bind -n -r M-N swap-window -t +1 # Swap window right
#### CLIPBOARD
# enable reattach-to-user-namespace which fixes pasteboard access and launchctl
bind Space copy-mode # enter copy mode with <C-a><Space>
-bind -n M-u copy-mode # enter copy mode with M-u
-bind -T copy-mode-vi M-u send -X halfpage-up # scroll up with M-u
-bind -T copy-mode-vi M-d send -X halfpage-down # scroll down with M-d
bind -T copy-mode-vi v send -X begin-selection # start "visual" with v
# Copy (yank) with y
@@ -145,9 +108,7 @@ if-shell 'uname | grep -qi Cygwin' 'bind -T copy-mode-vi y send-keys -X copy-pip
# Paste with C-a p or M-p
bind p run "DISPLAY=:0 xclip -selection clipboard -o | tmux load-buffer - ; tmux paste-buffer"
if-shell 'uname | grep -qi Darwin && which reattach-to-user-namespace > /dev/null' 'bind p run "pbpaste | tmux load-buffer - ; tmux paste-buffer"'
-if-shell 'uname | grep -qi Darwin' 'bind -n M-p run "pbpaste | tmux load-buffer - ; tmux paste-buffer"'
if-shell 'uname | grep -qi Cygwin' 'bind p run "cat /dev/clipboard | tmux load-buffer - ; tmux paste-buffer"'
-if-shell 'uname | grep -qi Cygwin' 'bind -n M-p run "cat /dev/clipboard | tmux load-buffer - ; tmux paste-buffer"'
#### LAUNCH PROCESSES
@@ -158,19 +119,16 @@ bind u capture-pane -J \; \
delete-buffer \; \
split-window -l 10 "urlview '/tmp/active_tmux_buffer' && rm /tmp/active_tmux_buffer"
-bind -n C-M-v new-window -n vim "vim"
+bind -n C-M-e new-window -n edit "$EDITOR"
bind -n C-M-w new-window -n weather \
"curl 'wttr.in/?m'; echo -e '\nPress <enter> to quit'; read -n 1 -s"
# Open new window and resize status accordingly (should be a hook instead)
bind Enter new-window -c "#{pane_current_path}" \
"tmux set status-right-length `echo $(tput cols)/2|bc|tr -d '\n'`; $SHELL"
-bind -n M-Enter new-window -c "#{pane_current_path}" \
- "tmux set status-right-length `echo $(tput cols)/2|bc|tr -d '\n'`; $SHELL"
# Use nested bindings (<C-a>m) for grouping music-control bindings
bind m switchc -Tmpd
-bind -n M-m switchc -Tmpd
bind -Tmpd v new-window -n vimpc "vimpc"
bind -Tmpd p display "#(mpc toggle | tr '\n' ' ')"
bind -Tmpd s display "#(mpc stop | tr '\n' ' ')"
@@ -178,11 +136,5 @@ bind -Tmpd n display "#(mpc next | tr '\n' ' ')"
bind -Tmpd b display "#(mpc prev | tr '\n' ' ')"
bind -Tmpd r display "#(mpc clear && mpc ls | mpc add && mpc random on && mpc play | tr '\n' ' ')"
-bind -n C-M-p display "#(mpc toggle | tr '\n' ' ')"
-bind -n C-M-s display "#(mpc stop | tr '\n' ' ')"
-bind -n C-M-n display "#(mpc next | tr '\n' ' ')"
-bind -n C-M-b display "#(mpc prev | tr '\n' ' ')"
-bind -n C-M-a split-window -p 50 "source ~/code/fzf-mpd/fzf-mpd.zsh && fm"
-
# Change to the previous pane, repeat the last command, change back
-bind -n M-! last-pane \; send-keys C-p C-m \; last-pane
+bind -n M-r last-pane \; send-keys "fc -s" C-m \; last-pane