summaryrefslogtreecommitdiff
path: root/.config/tmux/tmux.conf
diff options
context:
space:
mode:
Diffstat (limited to '.config/tmux/tmux.conf')
-rw-r--r--.config/tmux/tmux.conf82
1 files changed, 82 insertions, 0 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
new file mode 100644
index 0000000..90731ba
--- /dev/null
+++ b/.config/tmux/tmux.conf
@@ -0,0 +1,82 @@
+# unbind default prefix
+unbind C-b
+
+# set prefix to ctrl-a
+set -g prefix C-a
+
+# dont mess up with other ctrl-a options by pressing ctrl-a twice
+bind C-a send-prefix
+
+# use mouse to scroll
+set -g mouse on
+# Use m to toggle mouse mode
+unbind m
+bind m setw mouse
+
+# set clipboard on
+set -g set-clipboard external
+set -g allow-passthrough on
+
+# vim mode and copy keybindings
+# enable vi mode
+setw -g mode-keys vi # list keybindings: tmux list-keys -T copy-mode-vi
+
+# remap copy paste keys
+unbind [
+bind y copy-mode
+unbind p
+bind p paste-buffer
+bind-key -T copy-mode-vi 'v' send -X begin-selection
+bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'wl-copy'
+bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'wl-copy'
+bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'
+bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
+bind-key -T copy-mode-vi 'Y' send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
+bind-key -T copy-mode-vi MouseDown3Pane select-pane # right mouse button (to highlight sutff)
+bind-key -T copy-mode-vi MouseDrag3Pane select-pane \; send-keys -X begin-selection
+unbind-key -T copy-mode-vi MouseDragEnd3Pane
+
+# set zsh as default shell
+set -g default-command "exec /bin/zsh -i"
+set -g default-shell /bin/zsh
+
+set -sg escape-time 1
+
+# Start window and pane indices at 1
+set -g base-index 1
+setw -g pane-base-index 1
+
+set -g default-terminal "tmux-256color"
+set -ga terminal-overrides ",*:Tc"
+set-option -g xterm-keys on
+
+# reload config
+bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
+
+set -g history-limit 10000
+
+# vim style spliting
+bind-key v split-window -h
+bind-key s split-window -v
+
+# pane movement similar to vim
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# resize pane
+bind -r H resize-pane -L 5
+bind -r J resize-pane -D 5
+bind -r K resize-pane -U 5
+bind -r L resize-pane -R 5
+
+# styling
+set -g status-style bg='#000000',fg='#ffffff'
+set -g pane-border-style fg='#444444'
+set -g pane-active-border-style fg='#00ff00'
+
+# toggles status bar
+bind-key -r S set-option -g status
+setw -g window-status-format '#[fg=green,bg=black,bold,nounderscore,italics]#[default] #I #W #[fg=green,bg=black,bold,nounderscore,italics]'
+setw -g window-status-current-format '#[bold,nounderscore,italics]#[fg=green,bg=black] #I: #W #F #[fg=green,bg=black,bold,nounderscore,italics]'