points/.tmux.conf

151 lines
3.8 KiB
Plaintext
Raw Normal View History

2023-03-23 09:49:43 +01:00
# => Use C-b R to reload that file
#
# To override what a plugin does, set config after the call to TPM
#***
#** Plugins
#*
# https://github.com/tmux-plugins/list
#
# TODO
# https://github.com/erikw/tmux-powerline/issues/189
## Copy
# - easymotion (normale mode: C-b S / copy mode: s / S S / S j / S k / S n),
# - path, filenames, URLs: C-b Q
# - URLs in browser: C-b P
# - Lines: C-b W
set -g @plugin 'CrispyConductor/tmux-copy-toolkit'
set -g @copytk-label-chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
set -g @copytk-color-labelchar "black:cyan"
set -g @copytk-color-highlight "cyan:blue"
## Sensible Defaults
#
set -g @plugin 'tmux-plugins/tmux-sensible'
#***
#** TPM
#*
#
set -g @plugin 'tmux-plugins/tpm'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
#***
#** Options
#*
#
set-option -g mode-keys vi
set-option -g mouse on
set-option -g repeat-time 800
set-option -g status-keys vi
#***
#** Root Keys
#*
#
# Start copy mode with Shift-PageUp
bind-key -T root S-PPage { copy-mode -e; send-keys PPage }
#***
#** Prefix Keys
#*
# Re-usable keys:
# 'it
# $&().
bind-key ? list-keys -T prefix
bind-key M-k { send-keys -R; clear-history } # Clear current pane
bind-key M-m command-prompt -p "man page:" { split-window -fh man '%%' }
bind-key M-M split-window -fh man tmux
###
## Buffers
#
# - Delete the most recently copied buffer of text.
# = Choose which buffer to paste interactively from a list.
###
## Panes
#
# ; Move to the previously active pane [last-pane]
# m Mark the current pane [select-pane -m]
# M Clear the marked pane [select-pane -M]
# o Select the next pane in the current window [select-pane -t :.+]
# q Briefly display pane indexes [display-panes]
bind-key -r C-h select-pane -L
bind-key -r C-Left select-pane -L
bind-key -r C-j select-pane -D
bind-key -r C-Down select-pane -D
bind-key -r C-k select-pane -U
bind-key -r C-Up select-pane -U
bind-key -r C-l select-pane -R
bind-key -r C-Right select-pane -R
bind-key -r H resize-pane -L 5
bind-key -r Left resize-pane -L
bind-key -r J resize-pane -D 5
bind-key -r Down resize-pane -D
bind-key -r K resize-pane -U 5
bind-key -r Up resize-pane -U
bind-key -r L resize-pane -R 5
bind-key -r Right resize-pane -R
bind-key \\ split-window -fh -c "#{pane_current_path}"
bind-key _ split-window -fv -c "#{pane_current_path}"
bind-key '%' split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
#bind-key j command-prompt -p "join pane from:" "join-pane -h -s '%%'"
#bind-key s command-prompt -p "send pane to:" "join-pane -h -t '%%'"
#bind-key j "join-pane -s !" will join the last active pane/window to the current window.
###
## Windows
#
# , Rename the current window.
# . Prompt for an index to move the current window.
# l Move to the previously selected window.
###
## Layouts: default shortcuts adapted to Azerty keyboards
#
bind-key -N "M-1" "M-&" select-layout even-horizontal
bind-key -N "M-3" 'M-"' select-layout main-horizontal
bind-key -N "M-4" "M-'" select-layout main-vertical
bind-key -N "M-5" "M-(" select-layout tiled
###
## Sessions
#
# D Choose a client to detach.
# L Switch the attached client back to the last session.
# r Force redraw of the attached client.
# f Prompt to search for text in open windows.
#***
#** Copy-mode Keys
#*
# TODO Better Buffers select
bind-key -T copy-mode-vi Space send-keys -X page-down
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi S-NPage send-keys -X page-down