diff --git a/.tmux.conf b/.tmux.conf index 10c794e..98b447c 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,73 +1,104 @@ -# prefix +# ╭──────────────────────────────────────────────────────────╮ +# │ Keybindings │ +# ╰──────────────────────────────────────────────────────────╯ +# ──────────────────────────────── prefix ──────────────────────────────── unbind C-b set -g prefix C-Space -# send prefix to nested session after ctrl a +# ────────────────── prefix ctrl+a for nested sessions ──────────────── bind-key -n C-a send-prefix -# default shell -set-option -g default-shell /bin/zsh - -#for copying to sys clipboard - +# ────────────────── default split shortcuts overwrite ──────────────── bind | split-window -h -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}" unbind '"' unbind % +# ─────────────────────────── selecting panes ───────────────────────── bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D +# ───────────────── Shift Alt vim keys to switch windows ───────────────── +bind -n M-H previous-window +bind -n M-L next-window + +# ─────────────────── trying to make home end working ───────────────── +bind-key -n Home send Escape "OH" +bind-key -n End send Escape "OF" +# unbind shift+<-/-> to switch tabs +unbind S-Left +unbind S-Right + +# ╭──────────────────────────────────────────────────────────╮ +# │ general settings │ +# ╰──────────────────────────────────────────────────────────╯ +# ──────────────────────────── default shell ────────────────────────── +set-option -g default-shell /bin/zsh + +# ───────────────────────────── enable mouse ───────────────────────────── set -g mouse on +# ──────────────────────────── enable vi mode ──────────────────────────── set-window-option -g mode-keys vi +# ────────────────── enable autorename to current path ──────────────── set-option -g automatic-rename on set-option -g automatic-rename-format '#{b:pane_current_path}' +# ──────────────────────── some terminal options ────────────────────── set -g default-terminal "xterm-256color" set -ga terminal-overrides ",xterm-256color:Tc" - -# List of plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' - -set -g @plugin 'tmux-plugins/tmux-yank' -set -g @plugin 'tmux-plugins/tmux-copycat' -set -g @plugin 'tmux-plugins/tmux-open' - set -g default-terminal "screen-256color" -bind-key -n Home send Escape "OH" -bind-key -n End send Escape "OF" -# copying +# ─────────────────────────────── copying ───────────────────────────── set -g set-clipboard on set -g @override_copy_command 'xclip -i -selection clipboard' set -g @yank_selection 'clipboard' set -as terminal-features ',*:clipboard' -# Start windows and panes at 1, not 0 +# ───────────────── Start windows and panes at 1, not 0 ─────────────── 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 -# Shift Alt vim keys to switch windows -bind -n M-H previous-window -bind -n M-L next-window -# vim tmux navigator +# ╭──────────────────────────────────────────────────────────╮ +# │ Plugins │ +# ╰──────────────────────────────────────────────────────────╯ + +# ───────────────────────── tmux plugin manager ─────────────────────── +set -g @plugin 'tmux-plugins/tpm' + +# ── some default options https://github.com/tmux-plugins/tmux-sensible ── +set -g @plugin 'tmux-plugins/tmux-sensible' + +# ─────────────────────────── better tmux yank ─────────────────────────── +set -g @plugin 'tmux-plugins/tmux-yank' + +# ───────── some cool search shortcuts like +ctrl+u etc ─────── +set -g @plugin 'tmux-plugins/tmux-copycat' + +# ───────────── shortcut for xdg-open file/url under cursor ─────────── +set -g @plugin 'tmux-plugins/tmux-open' + +# ────────────────────────── vim tmux navigator ────────────────────────── set -g @plugin 'christoomey/vim-tmux-navigator' -set -g @plugin 'tmux-plugins/tmux-resurrect' # persistant tmux sessions -set -g @plugin 'tmux-plugins/tmux-continuum' # auto-save sessions +# ─────────────────────── tmux sessions managment ───────────────────── +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @resurrect-capture-pane-contents 'on' # save pane contents +set -g @resurrect-strategy-nvim 'session' # resurrect nvim sessions -set -g @resurrect-capture-pane-contents 'on' -set -g @continuum-restore 'on' +# ───────────────── automatically save/restore sessions ─────────────── +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @continuum-restore 'on' # enabling -# Dracula theme +# ╭──────────────────────────────────────────────────────────╮ +# │ Dracula theme │ +# ╰──────────────────────────────────────────────────────────╯ # available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, playerctl, kubernetes-context, synchronize-panes set -g @plugin 'dracula/tmux' set -g @dracula-show-powerline true @@ -87,11 +118,8 @@ set -g @dracula-show-left-sep \uE0C0 # for right symbol (can set any symbol you like as separator) set -g @dracula-show-right-sep \uE0B2 -# Shift arrow to switch windows -unbind S-Left -unbind S-Right - - - +# ╭──────────────────────────────────────────────────────────╮ +# │ run tmux plugin manager │ +# ╰──────────────────────────────────────────────────────────╯ # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run -b '~/.tmux/plugins/tpm/tpm'