diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-09-06 12:16:02 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-09-06 12:19:55 +0100 |
| commit | a7f7805f6ce5c84802e2cf90e4e31919558d4a46 (patch) | |
| tree | fd32ddf0f84557e23f2e901377969ea00068b313 | |
| parent | 7b249d054535ebd0661cd8e2b501a3897d03e2cf (diff) | |
✨feat: add tmux configuration files
| -rw-r--r-- | README.org | 8 | ||||
| -rw-r--r-- | tmux/.config/tmux/tmux.conf | 45 | ||||
| -rw-r--r-- | tmux/README.org | 157 |
3 files changed, 210 insertions, 0 deletions
@@ -55,3 +55,11 @@ Main repository can be found at [[https://git.ch-naseem.com/ndpm13/nvim-config][ - ~gcc~ - Nerd Font (optional) - ~silicon~ (optional) + +** tmux + +*** Dependencies + +- ~git~ +- ~tpm~ +- ~xclip~ (optional) diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf new file mode 100644 index 0000000..fc74218 --- /dev/null +++ b/tmux/.config/tmux/tmux.conf @@ -0,0 +1,45 @@ +set -g mouse on + +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +unbind '%' +unbind '"' + +bind s split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" + +set-option -as terminal-overrides ",xterm*:RGB" + +set -g status-position top + +unbind C-b +set -g prefix C-Space + +bind-key -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 y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + +bind S choose-session + +set-window-option -g mode-keys vi + +bind l next-window +bind h previous-window + +bind -n M-k resize-pane -U 1 +bind -n M-j resize-pane -D 1 +bind -n M-h resize-pane -L 2 +bind -n M-l resize-pane -R 2 + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'ndpm13/tmux-gruvbox-truecolor' + +# Initialize TMUX plugin manager. +run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/README.org b/tmux/README.org new file mode 100644 index 0000000..0dd76e0 --- /dev/null +++ b/tmux/README.org @@ -0,0 +1,157 @@ +#+TITLE: My Tmux Config +#+AUTHOR: Naz <ndpm13@ch-naseem.com> +#+PROPERTY: header-args :tangle .config/tmux/tmux.conf :mkdirp yes +#+STARTUP: showeverything +#+OPTIONS: toc:nil +#+auto_tangle: t + +* Table Of Content :toc: +- [[#general-configurations][General Configurations]] + - [[#enable-mouse][Enable Mouse]] + - [[#window--pane-indexing][Window & Pane Indexing]] + - [[#window-splitting][Window Splitting]] +- [[#ui-configurations][UI Configurations]] + - [[#colors-fix][Colors Fix]] + - [[#status-bar-position][Status Bar Position]] +- [[#key-bindings][Key Bindings]] + - [[#prefix-key][Prefix Key]] + - [[#clipboard][Clipboard]] + - [[#session-selection][Session Selection]] + - [[#vi-mode][Vi Mode]] +- [[#plugin-management-tpm][Plugin Management (TPM)]] + - [[#plugins][Plugins]] + +* General Configurations + +** Enable Mouse + +#+begin_src conf +set -g mouse on +#+end_src + +** Window & Pane Indexing + +Start windows and panes at 1, not 0. + +#+begin_src conf +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on +#+end_src + +** Window Splitting + +Use ~PREFIX s~ and ~PREFIX v~ instead of ~PREFIX %~ and ~PREFIX "~, and keep the +current directory when splitting windows. + +#+begin_src conf +unbind '%' +unbind '"' + +bind s split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" +#+end_src + +* UI Configurations + +** Colors Fix + +I'm using this in Alacritty. If it doesn't work in your terminal emulator of +choice, try the other methods below. + +#+begin_src conf +set-option -as terminal-overrides ",xterm*:RGB" +#+end_src + +*** Other Methods + +#+begin_example conf +set -g default-terminal "$TERM" +#+end_example + +#+begin_example conf +set -ag terminal-overrides ",$TERM:Tc" +#+end_example + +** Status Bar Position + +#+begin_src conf +set -g status-position top +#+end_src + +* Key Bindings + +** Prefix Key + +Use ~CTRL-Space~ as prefix instead of ~CTRL-B~. + +#+begin_src conf +unbind C-b +set -g prefix C-Space +#+end_src + +** Clipboard + +This part requires ~xclip~ to be installed. + +#+begin_src conf +bind-key -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 y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' +#+end_src + +** Session Selection + +#+begin_src conf +bind S choose-session +#+end_src + +** Vi Mode + +#+begin_src conf +set-window-option -g mode-keys vi +#+end_src + +*** Window Navigation + +Remap ~PREFIX l~ to go to the next window, and ~PREFIX h~ to go to the previous +window. + +#+begin_src conf +bind l next-window +bind h previous-window +#+end_src + +*** Pane Resizing + +#+begin_src conf +bind -n M-k resize-pane -U 1 +bind -n M-j resize-pane -D 1 +bind -n M-h resize-pane -L 2 +bind -n M-l resize-pane -R 2 +#+end_src + +* Plugin Management (TPM) + +I'm using [[https://github.com/tmux-plugins/tpm][TPM]] to manage my plugins. Please note that it's recommended to keep +the follow line *at the very bottom of* ~tmux.conf~. + +#+NAME: run-tpm +#+begin_src conf :tangle no +run '~/.tmux/plugins/tpm/tpm' +#+end_src + +** Plugins + +#+begin_src conf :noweb yes +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'ndpm13/tmux-gruvbox-truecolor' + +# Initialize TMUX plugin manager. +<<run-tpm>> +#+end_src |
