mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-05 03:00:46 +00:00
chore(config): tmux config tweaks, new settings
This commit is contained in:
@@ -13,16 +13,11 @@
|
|||||||
# -t = binds to a certain key-table (root, copy-mode, prefix, etc.)
|
# -t = binds to a certain key-table (root, copy-mode, prefix, etc.)
|
||||||
|
|
||||||
# Set <prefix> to Control + Space, keeping the default of C-b intact.
|
# Set <prefix> to Control + Space, keeping the default of C-b intact.
|
||||||
|
# C-Space send-prefix line doubles the prefix when in nested tmux session.
|
||||||
# unbind C-b
|
# unbind C-b
|
||||||
set -g prefix C-Space
|
set -g prefix C-Space
|
||||||
bind C-Space send-prefix
|
bind C-Space send-prefix
|
||||||
|
|
||||||
# Vim style pane selection
|
|
||||||
bind h select-pane -L
|
|
||||||
bind j select-pane -D
|
|
||||||
bind k select-pane -U
|
|
||||||
bind l select-pane -R
|
|
||||||
|
|
||||||
# Use Alt-arrow keys without prefix key to switch panes
|
# Use Alt-arrow keys without prefix key to switch panes
|
||||||
bind -n M-Left select-pane -L
|
bind -n M-Left select-pane -L
|
||||||
bind -n M-Right select-pane -R
|
bind -n M-Right select-pane -R
|
||||||
@@ -37,12 +32,29 @@ bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|||||||
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
||||||
|
|
||||||
# Reload tmux config with <prefix> + r
|
# Reload tmux config with <prefix> + r
|
||||||
|
unbind r
|
||||||
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!"
|
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!"
|
||||||
|
|
||||||
# Switch to next client with <prefix>( and previous with <prefix>)
|
# Switch to next client with <prefix>( and previous with <prefix>)
|
||||||
|
# Repeatable, only needs prefix once
|
||||||
bind -r '(' switch-client -p\; refresh-client -S
|
bind -r '(' switch-client -p\; refresh-client -S
|
||||||
bind -r ')' switch-client -n\; refresh-client -S
|
bind -r ')' switch-client -n\; refresh-client -S
|
||||||
|
|
||||||
|
# Switch between previous and next windows with repeatable
|
||||||
|
# <prefix> + n and <prefix> + p
|
||||||
|
bind -r n next-window
|
||||||
|
bind -r p previous-window
|
||||||
|
|
||||||
|
# Switch between two most recently used windows
|
||||||
|
bind Space last-window
|
||||||
|
|
||||||
|
# Move the current window to the next window or previous window position
|
||||||
|
bind -r N run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) + 1)"
|
||||||
|
bind -r P run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) - 1)"
|
||||||
|
|
||||||
|
bind-key > swap-window -t +1 \; next
|
||||||
|
bind-key < swap-window -t -1 \; prev
|
||||||
|
|
||||||
# Open a new window with <prefix> + N
|
# Open a new window with <prefix> + N
|
||||||
bind N new-window
|
bind N new-window
|
||||||
|
|
||||||
@@ -52,13 +64,14 @@ bind M-c attach-session -c "#{pane_current_path}"
|
|||||||
# Open a new window in the current directory
|
# Open a new window in the current directory
|
||||||
bind C new-window -c "#{pane_current_path}"
|
bind C new-window -c "#{pane_current_path}"
|
||||||
|
|
||||||
# keybindings
|
# Copy mode
|
||||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||||
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||||
|
|
||||||
|
# Splits
|
||||||
bind '"' split-window -v -c "#{pane_current_path}"
|
bind '"' split-window -v -c "#{pane_current_path}"
|
||||||
bind '!' split-window -h -c "#{pane_current_path}"
|
bind '!' split-window -h -c "#{pane_current_path}"
|
||||||
bind '^' switch-client -t'{marked}'
|
|
||||||
|
|
||||||
# .local/bin/t triggers
|
# .local/bin/t triggers
|
||||||
bind -r T new-window ~/.local/bin/t
|
bind -r T new-window ~/.local/bin/t
|
||||||
@@ -80,17 +93,23 @@ bind p paste-buffer
|
|||||||
# │ Settings │
|
# │ Settings │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
# set -g default-terminal "tmux-256color"
|
||||||
|
# set -ag terminal-overrides ",xterm-256color:RGB"
|
||||||
|
|
||||||
# Undercurl
|
# Undercurl
|
||||||
set -g default-terminal "${TERM}"
|
set -g default-terminal "${TERM}"
|
||||||
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
|
||||||
set -as terminal-overrides ',*:Setulc=\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colors - needs tmux-3.0
|
set -as terminal-overrides ',*:Setulc=\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colors - needs tmux-3.0
|
||||||
|
|
||||||
# set -g default-terminal "tmux-256color"
|
# Enable hyperlinks
|
||||||
# set -ag terminal-overrides ",xterm-256color:RGB"
|
set -as terminal-overrides ',*:Hls=\E]8;id=%p1%s;%p2%s\E\\:Hlr=\E]8;;\E\\''
|
||||||
|
|
||||||
# Setting status on
|
# Setting status on
|
||||||
set -g status "on"
|
set -g status "on"
|
||||||
|
|
||||||
|
# Allow tmux to set the terminal title
|
||||||
|
set -g set-titles on
|
||||||
|
|
||||||
# Hide clock
|
# Hide clock
|
||||||
set -g display-time 0
|
set -g display-time 0
|
||||||
|
|
||||||
@@ -99,6 +118,9 @@ set -g monitor-activity on
|
|||||||
set -g visual-activity off
|
set -g visual-activity off
|
||||||
set -g visual-bell off
|
set -g visual-bell off
|
||||||
|
|
||||||
|
# A bell in another window should cause a bell in the current window
|
||||||
|
set -g bell-action any
|
||||||
|
|
||||||
# Expose window title
|
# Expose window title
|
||||||
set-option -g set-titles on
|
set-option -g set-titles on
|
||||||
|
|
||||||
@@ -129,6 +151,12 @@ set -g detach-on-destroy off
|
|||||||
# address vim mode switching delay (http://superuser.com/a/252717/65504)
|
# address vim mode switching delay (http://superuser.com/a/252717/65504)
|
||||||
set -s escape-time 0
|
set -s escape-time 0
|
||||||
|
|
||||||
|
# Focus events enabled for terminals that support them
|
||||||
|
set -g focus-events on
|
||||||
|
|
||||||
|
# Useful when using sharing a session with different size terminals
|
||||||
|
setw -g aggressive-resize on
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ Theme │
|
# │ Theme │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
Leader: `<ctrl><space>`
|
Leader: `<ctrl><space>`
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
Space Select next layout
|
|
||||||
# List all paste buffers
|
|
||||||
$ Rename current session
|
$ Rename current session
|
||||||
% Split window horizontally
|
% Split window horizontally
|
||||||
& Kill current window
|
& Kill current window
|
||||||
@@ -27,7 +25,6 @@ Leader: `<ctrl><space>`
|
|||||||
; Move to the previously active pane
|
; Move to the previously active pane
|
||||||
= Choose a paste buffer from a list
|
= Choose a paste buffer from a list
|
||||||
? List key bindings
|
? List key bindings
|
||||||
D Choose and detach a client from a list
|
|
||||||
E Spread panes out evenly
|
E Spread panes out evenly
|
||||||
L Switch to the last client
|
L Switch to the last client
|
||||||
M Clear the marked pane
|
M Clear the marked pane
|
||||||
@@ -37,7 +34,6 @@ Leader: `<ctrl><space>`
|
|||||||
f Search for a pane
|
f Search for a pane
|
||||||
i Display window information
|
i Display window information
|
||||||
m Toggle the marked pane
|
m Toggle the marked pane
|
||||||
n Select the next window
|
|
||||||
o Select the next pane
|
o Select the next pane
|
||||||
q Display pane numbers
|
q Display pane numbers
|
||||||
s Choose a session from a list
|
s Choose a session from a list
|
||||||
|
|||||||
Reference in New Issue
Block a user