diff --git a/.gitignore b/.gitignore index b2b63d9..293837c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vim/.vim/spell/ vim/.vim/view/ # Miscellaneous desktop files desktop/ +tmux/.config/tmux/plugins diff --git a/Makefile b/Makefile index dc6c14c..99b6510 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ CLI_PACKAGES := \ shell \ ssh \ tin \ + tmux \ vim \ zsh \ @@ -50,6 +51,7 @@ CLI_DEPENDENCIES := \ community/stack \ community/stow \ community/tig \ + community/tmux \ community/udiskie \ community/zsh-completions \ core/archlinux-keyring \ @@ -154,6 +156,12 @@ stow-tin: tin rm -rf $(STOW_TARGET)/.tin ln -s $(realpath tin/.tin) $(STOW_TARGET)/.tin +stow-tmux: tmux + $(STOW) $< + [ -d ~/.config/tmux/plugins/tpm ] || \ + git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm; + ~/.config/tmux/plugins/tpm/bin/install_plugins + stow-vim: vim $(STOW) $< vim +PlugInstall @@ -179,6 +187,10 @@ unstow-system-X: unstow-tin: rm -f $(STOW_TARGET)/.tin +unstow-tmux: + $(STOW) -D tmux + rm -rf ~/.config/tmux/plugins/ + # Development related installations .PHONY: rust rust: diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf new file mode 100644 index 0000000..a2d642b --- /dev/null +++ b/tmux/.config/tmux/tmux.conf @@ -0,0 +1,34 @@ +# Don't use login shell +set -g default-command "${SHELL}" + +# Better Vim mode +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel + +# Change where plugins are downloaded +set-environment -g TMUX_PLUGIN_MANAGER_PATH '/home/ambroisie/.config/tmux/plugins/' + +# TPM itself +set -g @plugin 'tmux-plugins/tpm' +# Minimum viable configuration +set -g @plugin 'tmux-plugins/tmux-sensible' +# Show when prefix has been pressed +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +# Open high-lighted files in copy mode +set -g @plugin 'tmux-plugins/tmux-open' +# Better pane management +set -g @plugin 'tmux-plugins/tmux-pain-control' + +# Suggested in `man tmux`, and added by tmux-sensible, with wrong file... +bind-key R source-file ~/.config/tmux/tmux.conf \; \ + display-message "source-file done" + +# Show when I'm in prefix mode in status bar +set -g status-right '#{prefix_highlight} %a %Y-%m-%d %H:%M' + +# Also show when I'm in copy or sync mode +set -g @prefix_highlight_show_copy_mode 'on' +set -g @prefix_highlight_show_sync_mode 'on' + +# Initialize TPM +run '~/.config/tmux/plugins/tpm/tpm'