summaryrefslogtreecommitdiff
path: root/tmux
diff options
context:
space:
mode:
author--global <ik.boikov.public@protonmail.com>2021-02-28 23:23:58 +0100
committer--global <ik.boikov.public@protonmail.com>2021-02-28 23:23:58 +0100
commita9ae954b1c5d13980457eac480b0664b1eac915e (patch)
tree7bc08e0ba25c12d89fba2bc317caf36370445248 /tmux
parent47d2a8e9699b689e39cb9fa4de5ddcd064695988 (diff)
random stuff
Diffstat (limited to 'tmux')
-rw-r--r--tmux/.tmux.conf46
1 files changed, 46 insertions, 0 deletions
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
new file mode 100644
index 0000000..9d1d067
--- /dev/null
+++ b/tmux/.tmux.conf
@@ -0,0 +1,46 @@
+# remap prefix from 'C-b' to 'C-a'
+unbind C-b
+set-option -g prefix C-a
+bind-key C-a send-prefix
+
+# split panes using | and -
+bind \\ split-window -h
+bind - split-window -v
+unbind '"'
+unbind %
+
+# reload config file easily
+bind r source-file ~/.tmux.conf
+
+# Enable mouse control
+set -g mouse on
+
+# 256 colors
+# Note: you'll need to tmux kill-server and restart to have this take effect
+set -g default-terminal "screen-256color"
+
+# Bottom bar black instead of green
+set -g status-style "bg=black"
+
+# Vi mode
+set-window-option -g mode-keys vi
+
+# Smart pane switching with awareness of Vim splits.
+# See: https://github.com/christoomey/vim-tmux-navigator
+is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
+ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
+bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
+bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
+bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
+bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
+tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
+if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
+ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
+if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
+ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
+
+bind-key -T copy-mode-vi 'C-h' select-pane -L
+bind-key -T copy-mode-vi 'C-j' select-pane -D
+bind-key -T copy-mode-vi 'C-k' select-pane -U
+bind-key -T copy-mode-vi 'C-l' select-pane -R
+bind-key -T copy-mode-vi 'C-\' select-pane -l