diff options
author | A Farzat <a@farzat.xyz> | 2024-10-03 01:59:36 +0900 |
---|---|---|
committer | A Farzat <a@farzat.xyz> | 2024-10-17 01:59:36 +0900 |
commit | 46c2b0e257e99994b5fb0f8455ea4b8a34ec39df (patch) | |
tree | 7f9766d550e72e291b2872f1da9554dd8d47e675 /.config | |
parent | 5b50d342bf19e565782f58796c686f7b7cb848af (diff) | |
download | dotfiles-46c2b0e257e99994b5fb0f8455ea4b8a34ec39df.tar.gz dotfiles-46c2b0e257e99994b5fb0f8455ea4b8a34ec39df.zip |
Add tmux config
Diffstat (limited to '.config')
-rwxr-xr-x | .config/tmux/install_tpm.sh | 6 | ||||
-rw-r--r-- | .config/tmux/tmux.conf | 61 |
2 files changed, 67 insertions, 0 deletions
diff --git a/.config/tmux/install_tpm.sh b/.config/tmux/install_tpm.sh new file mode 100755 index 0000000..9212654 --- /dev/null +++ b/.config/tmux/install_tpm.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +if [ ! -d "$XDG_DATA_HOME/tmux/plugins/tpm" ]; then + git clone https://github.com/tmux-plugins/tpm "$XDG_DATA_HOME/tmux/plugins/tpm" + "$XDG_DATA_HOME/tmux/plugins/tpm/bin/install_plugins" +fi diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..8622d08 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,61 @@ +# With this ~/.bashrc is loaded. +set-option -g default-command /usr/bin/zsh + +# To satisfy the warnings in vim's checkhealth about tmux's colour settings. +set-option -sa terminal-overrides ',xterm-256color:RGB' + +# Move through panes using vim mappings while alt key is pressed. +# bind -n M-h select-pane -L +# bind -n M-j select-pane -D +# bind -n M-k select-pane -U +# bind -n M-l select-pane -R + +# Open new windows/panes using the current window's path. +bind '"' split-window -c "#{pane_current_path}" +bind % split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" + +# Use vi-like bindings for copy-mode. +# First unbind the default rectangle-toggle binding. +unbind-key -T copy-mode-vi 'v' +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle + +# Send the URLs to urlscan in a new split window. +bind-key u split-window -l 10 'tmux capture-pane -t "$(tmux list-panes -f "#{pane_last}" -F "#{pane_index}")" -pJS - | urlscan' + +# Plugin settings +# Set the plugins install dir. +set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_DATA_HOME/tmux/plugins/" +# Set the directory used by tmux-resurrect to store sessions. +set -g @resurrect-dir "$XDG_STATE_HOME/tmux/resurrect" +set -g @resurrect-capture-pane-contents 'on' +# Additional programs tmux-resurrect should restore. +set -g @resurrect-processes 'btop neomutt profanity newsboat' +# Use pywal theme in tmux-power. +set -g @tmux_power_theme 'default' +# 'L' for left only, 'R' for right only and 'LR' for both +set -g @tmux_power_prefix_highlight_pos 'R' +# Use custom script cclip to handle both normal and ssh sessions. +set -g @override_copy_command 'cclip' + +# List of plugins +set -g @plugin 'https://github.com/tmux-plugins/tpm' +set -g @plugin 'https://github.com/tmux-plugins/tmux-sensible' +set -g @plugin 'https://github.com/tmux-plugins/tmux-pain-control' +set -g @plugin 'https://github.com/tmux-plugins/tmux-yank' +set -g @plugin 'https://github.com/wfxr/tmux-power' +set -g @plugin 'https://github.com/tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'https://github.com/tmux-plugins/tmux-resurrect' +set -g @plugin 'https://github.com/tmux-plugins/tmux-continuum' + +# Other examples: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'git@github.com:user/plugin' +# set -g @plugin 'git@bitbucket.com:user/plugin' + + +# Download tpm and install the plugins when running on a new machine. +run "$XDG_CONFIG_HOME/tmux/install_tpm.sh" +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run "$XDG_DATA_HOME/tmux/plugins/tpm/tpm" |