summaryrefslogtreecommitdiff
path: root/dot_config/tmux
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2019-12-21 18:19:19 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2019-12-21 18:19:19 -0500
commitdb4883389955e5cd2a1fa7ba444b7b6fe2c4e87c (patch)
treec813eb19d8c11eccfac70a0a7ebac25089707f1f /dot_config/tmux
parent[gitconfig] init (diff)
[tmux] init
Diffstat (limited to '')
-rw-r--r--dot_config/tmux/linux-clipboard.tmux6
-rw-r--r--dot_config/tmux/tmux.conf42
2 files changed, 48 insertions, 0 deletions
diff --git a/dot_config/tmux/linux-clipboard.tmux b/dot_config/tmux/linux-clipboard.tmux
new file mode 100644
index 0000000..5b2a711
--- /dev/null
+++ b/dot_config/tmux/linux-clipboard.tmux
@@ -0,0 +1,6 @@
+bind -T copy-mode MouseDragEnd1Pane send -X copy-pipe-and-cancel "xsel -ib"
+bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "xsel -ib"
+
+bind -n M-C-v run "xsel -ob | tmux load-buffer -; tmux paste-buffer"
+
+# vim: ft=tmux
diff --git a/dot_config/tmux/tmux.conf b/dot_config/tmux/tmux.conf
new file mode 100644
index 0000000..336178d
--- /dev/null
+++ b/dot_config/tmux/tmux.conf
@@ -0,0 +1,42 @@
+# --- obvious settings ---
+# basics
+set -g default-terminal "tmux-256color" # colors
+set -g mouse on # mouse mode
+set -sg escape-time 10 # fix vim
+set -g xterm-keys on # ctrl-arrows, others...
+
+# 0 is very far away from 1
+set -g base-index 1
+set -g pane-base-index 1
+
+# terminal titles
+set -g set-titles on
+set -g set-titles-string "#T"
+
+# true colors
+set -ga terminal-overrides ",*256col*:Tc"
+set -ga terminal-overrides ",xterm-kitty:Tc"
+
+# --- keybinds ---
+# splitting
+bind | split-window -h
+bind - split-window -v
+unbind '"'
+unbind %
+
+# alt-direction to switch 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
+
+# convenient copy/paste
+if "uname | grep -q Linux" "source-file ~/.tmux/linux-clipboard.tmux" # requires xsel
+
+# convenience
+bind r source-file ~/.config/tmux/tmux.conf
+
+# local conf
+source-file -q ~/.config/tmux/local.tmux
+
+# vim: ft=tmux