185 lines
6.5 KiB
Plaintext
185 lines
6.5 KiB
Plaintext
#---------------------------------------------------------------
|
|
# file: ~/.tmux/conf
|
|
# vim:fenc=utf-8:nu:ai:si:et:ts=4:sw=4:fdm=indent:fdn=1:ft=conf:
|
|
##############################
|
|
# _
|
|
# | |_ _ __ ___ _ ___ __
|
|
# | __| '_ ` _ \| | | \ \/ /
|
|
# | |_| | | | | | |_| |> <
|
|
# \__|_| |_| |_|\__,_/_/\_\
|
|
#
|
|
#############################
|
|
# Install TMP if not installed
|
|
run-shell " \
|
|
if [ ! -d ~/.tmux/plugins/tpm ]; then \n\
|
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm \n\
|
|
fi \
|
|
"
|
|
|
|
# Tmuxline theme-file
|
|
#source-file ~/.config/nvim/nord
|
|
# use vim motion keys while in copy mode
|
|
setw -g mode-keys vi
|
|
|
|
############################################################################
|
|
# Reset Prefix
|
|
############################################################################
|
|
set -g prefix C-a
|
|
bind-key a send-prefix # for nested tmux sessions
|
|
|
|
############################################################################
|
|
# Global options
|
|
############################################################################
|
|
# large history
|
|
set-option -g history-limit 10000
|
|
|
|
# colors
|
|
set -g default-terminal "st-256color" #"xterm-256color" # "screen-256color"
|
|
|
|
# basic settings
|
|
set-window-option -g xterm-keys on # for vim
|
|
set-window-option -g mode-keys vi # vi key
|
|
set-window-option -g monitor-activity on
|
|
|
|
# Automatically set window title
|
|
setw -g automatic-rename
|
|
|
|
# use mouse # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
|
|
set -g mouse on
|
|
set -g history-limit 30000
|
|
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
|
|
|
|
# vi movement keys
|
|
set-option -g status-keys vi
|
|
|
|
############################################################################
|
|
# Status Bar
|
|
############################################################################
|
|
set -g status-left-length 70
|
|
#set -g status-left '#[fg=black,bg=cyan] #(~/.config/Scripts/showip) #[fg=black,bg=blue,nobold,noitalics,nounderscore] '
|
|
set -g status-interval 1
|
|
set-option -g status-position top
|
|
|
|
# Titles (window number, program name, active (or not)
|
|
set-option -g set-titles on
|
|
#set-option -g set-titles-string '#H:#S.#I.#P #W #T'
|
|
#set-option -g status-justify centre
|
|
#set -g status-right '#{prefix_highlight} | %a %Y-%m-%d %H:%M'
|
|
|
|
###########################################################################
|
|
#Choose-tree
|
|
###########################################################################
|
|
bind-key W choose-tree -Zw "swap-window -t '%%'"
|
|
bind-key P choose-tree -Zw "swap-pane -t '%%'"
|
|
############################################################################
|
|
# Unbindings
|
|
############################################################################
|
|
unbind [ # copy mode bound to escape key
|
|
unbind j
|
|
unbind C-b # unbind default leader key
|
|
unbind '"' # unbind horizontal split
|
|
unbind % # unbind vertical split
|
|
|
|
|
|
############################################################################
|
|
# Bindings
|
|
############################################################################
|
|
# reload tmux conf
|
|
bind-key r source-file ~/.tmux.conf \; display-message "Config reloaded..."
|
|
|
|
bind Escape copy-mode
|
|
|
|
# new split in current pane (horizontal / vertical)
|
|
bind-key c split-window -v # split pane horizontally
|
|
bind-key v split-window -h # split pane vertically
|
|
|
|
# list panes
|
|
bind-key Space list-panes
|
|
|
|
# break-pane
|
|
bind-key Enter break-pane
|
|
|
|
# join-pane [-dhv] [-l size | -p percentage] [-s src-pane]
|
|
# [-t:dst-window.dst-pane] (destination window (dot) destination pane
|
|
# (alias: joinp)
|
|
#
|
|
#bind C-j command-prompt "joinp"
|
|
#bind C-j command-prompt "join-pane"
|
|
#bind-key j command-prompt "join-pane -s '%%'"
|
|
#bind-key j command-prompt "joinp -t:0"
|
|
bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split
|
|
|
|
# switch panes using Alt-arrow without prefix
|
|
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
|
|
|
|
############################################################################
|
|
# windows
|
|
############################################################################
|
|
bind C-j previous-window
|
|
bind C-k next-window
|
|
bind-key C-a last-window # C-a C-a for last active window
|
|
bind A command-prompt "rename-window %%"
|
|
# By default, all windows in a session are constrained to the size of the
|
|
# smallest client connected to that session,
|
|
# even if both clients are looking at different windows.
|
|
# It seems that in this particular case, Screen has the better default
|
|
# where a window is only constrained in size if a smaller client
|
|
# is actively looking at it.
|
|
setw -g aggressive-resize on
|
|
set -g set-clipboard on
|
|
|
|
############################################################################
|
|
# panes
|
|
############################################################################
|
|
# Navigation ---------------------------------------------------------------
|
|
# use the vim motion keys to move between panes
|
|
bind-key h select-pane -L
|
|
bind-key j select-pane -D
|
|
bind-key k select-pane -U
|
|
bind-key l select-pane -R
|
|
|
|
# Resizing ---------------------------------------------------------------
|
|
bind-key C-h resize-pane -L
|
|
bind-key C-j resize-pane -D
|
|
bind-key C-k resize-pane -U
|
|
bind-key C-l resize-pane -R
|
|
|
|
############################################################################
|
|
# layouts
|
|
############################################################################
|
|
bind o select-layout "active-only"
|
|
bind M-- select-layout "even-vertical"
|
|
bind M-| select-layout "even-horizontal"
|
|
bind M-r rotate-window
|
|
|
|
# focus on first window
|
|
# select-window -t 0
|
|
|
|
###########################################################################
|
|
# 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-resurrect'
|
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
|
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
|
|
set -g @plugin 'tmux-plugins/tmux-sidebar'
|
|
set -g @plugin "arcticicestudio/nord-tmux"
|
|
##########################################################################
|
|
# Plugins settings
|
|
##########################################################################
|
|
set -g @resurrect-capture-pane-contents 'on'
|
|
set -g @resurrect-processes ':all:'
|
|
set -g @continuum-restore 'on'
|
|
set -g @continuum-save-interval '10'
|
|
# for neovim
|
|
set -g @resurrect-strategy-nvim 'session'
|
|
set -g @sidebar-tree-command 'tree -C'
|
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
|
run '~/.tmux/plugins/tpm/tpm'
|