From 6ef95200b7e5fb4a086bb7e570e0df2fd101ca95 Mon Sep 17 00:00:00 2001 From: Antonin Ruan Date: Wed, 1 Apr 2026 16:50:48 -0400 Subject: [PATCH] tmux conf and some aliases --- .aliases | 4 +- tmux.conf | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 tmux.conf diff --git a/.aliases b/.aliases index ae81fa5..519d87f 100644 --- a/.aliases +++ b/.aliases @@ -30,8 +30,10 @@ alias uctl='userctl' alias kdiff="kitten diff" alias kssh="kitten ssh" +alias kussh="kitten ssh -o StrictHostKeyChecking=no" +alias os="openstack" alias mssh="mosh --ssh='kitten ssh'" alias mussh="mosh --ssh='kitten ssh -o StrictHostKeyChecking=no'" alias gf2="/usr/bin/gf2 &> /dev/null &" alias qemu-monitor="telnet 127.0.0.1 7777" -alias sudo="sudo " \ No newline at end of file +alias sudo="/usr/bin/sudo" \ No newline at end of file diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..0391d28 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,121 @@ +# +# Config +# + +# Reset configuration +unbind-key -a + +# Tmux use bash +#set-option -g default-shell /bin/bash +#set-option -g default-command "bash --rcfile /home/aruan/rc" + +# Disable mouse support in tmux +# Who is using mouse anyway? +set -g mouse off + +# Needed http://superuser.com/questions/360832/how-can-i-make-ctrlleft-right-keys-work-right-in-tmux +set-window-option -g xterm-keys on + +# Status bar options +set-option -g status-bg black +set-option -g status-fg green +set-option -g status-interval 1 +set-option -g status-justify left +set-option -g status-keys vi +set-option -g status-left "[#S]" # Session name on left +set-option -g status-left-length 15 +set-option -g status-right "#H [%H:%M:%S %d.%m.%y]" # Date and host on right +set-option -g status-right-length 40 +set-option -g default-terminal "screen-256color" # Recommended by tmux +set-option -g status-position top # Move status bar to the top +set-option -g window-status-current-style bright # active pane name in bold + +# Windows options +# Renumber windows when we move them +set-option -g renumber-windows on + +# Aggressive resize +set-window-option -g aggressive-resize on # Resize +set-window-option -g mode-keys vi # VI mode +set-option -s escape-time 0 # No wait on escape + + +# Reload config +# bind-key r source-file /etc/tmux/tmux-aruan.conf \; display-message "Config reloaded." + +# +# Bindings +# +# bind-key -n --> prefix not needed +# bind-key --> prefix needed + +bind-key : command-prompt + +# +# Windows bindings +# +bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window +bind-key -n C-n new-window \; rename-window "-" +bind-key c new-window \; rename-window "-" +bind-key -n F2 new-window \; rename-window "-" +bind-key -n F3 previous-window +bind-key -n F4 next-window +bind-key -n C-S-F3 swap-window -t :-1 +bind-key -n C-S-F4 swap-window -t :+1 +bind-key -n F6 detach +# Detach all other clients +bind-key -n S-F6 detach-client -a +bind-key -n F7 copy-mode +bind-key -n M-NPage copy-mode \; send-keys NPage +bind-key -n M-PPage copy-mode \; send-keys PPage +bind-key -n F8 command-prompt -p "(rename-window) " "rename-window '%%'" +bind-key -n C-F8 command-prompt -p "(rename-session) " "rename-session '%%'" +bind-key -n F9 last-window +# Select windows with alt+number +bind-key -n M-0 select-window -t 0 +bind-key -n M-1 select-window -t 1 +bind-key -n M-2 select-window -t 2 +bind-key -n M-3 select-window -t 3 +bind-key -n M-4 select-window -t 4 +bind-key -n M-5 select-window -t 5 +bind-key -n M-6 select-window -t 6 +bind-key -n M-7 select-window -t 7 +bind-key -n M-8 select-window -t 8 +bind-key -n M-9 select-window -t 9 + +# +# Panes bindings +# +# Split panes +bind-key h split-window -v +bind-key v split-window -h +# Move between pane with arrow +bind-key -n S-left select-pane -L +bind-key -n S-right select-pane -R +bind-key -n S-up select-pane -U +bind-key -n S-down select-pane -D +# Next layout +bind-key -n C-space next-layout +# Synchronise panes +bind-key -n M-s set-window-option synchronize-panes +bind-key -n M-z resize-pane -Z +# Kill pane +bind-key x confirm-before -p "kill-pane #W? (y/n)" kill-pane +# Resize pane +bind-key -n C-S-up resize-pane -U 10 +bind-key -n C-S-down resize-pane -D 10 +bind-key -n C-S-left resize-pane -L 10 +bind-key -n C-S-right resize-pane -R 10 + +# +# Misc +# +# Blinking status on change +set-option -g window-status-format " #{?window_activity_flag, #[fg=colour231]#[blink],#[fg=colour245]}#{?window_bell_flag,#[fg=colour01]#[blink],#[fg=colour245]}#I:#W " +set-option -g monitor-activity on + +#pane border +set-option -g pane-border-style 'bg=colour235' +set-option -g pane-border-style 'fg=colour238' +set-option -g pane-active-border-style 'bg=colour235' +set-option -g pane-active-border-style 'fg=colour51'