Skip to content

Instantly share code, notes, and snippets.

@RowanFeely
Created April 18, 2020 10:40
Show Gist options
  • Save RowanFeely/150fc58a672713aa83f2bdd5226da6ce to your computer and use it in GitHub Desktop.
Save RowanFeely/150fc58a672713aa83f2bdd5226da6ce to your computer and use it in GitHub Desktop.
# ██
# ░██
# ███████████████ ██ ████ ██
#░░░██░░██░░██░░█░██ ░█░░██ ██
# ░██ ░██ ░██ ░█░██ ░██░░███
# ░██ ░██ ░██ ░█░██ ░██ ██░██
# ░░█████ ░██ ░█░░████████ ░░██
# ░░░░░ ░░ ░░ ░░░░░░░░ ░░
#
# ▓▓▓▓▓▓▓▓▓▓
# ░▓ author ▓ ROGUE(X3)<rowanfeely.github.io>
# ░▓ code ▓ https://github.com/RowanFeely/dotfiles
# ░▓ ▓ http://rowanfeely.github.io
# ░▓▓▓▓▓▓▓▓▓▓
# ░░░░░░░░░░
#
# screen mode
set -g default-command /usr/local/bin/fish
set -g default-shell /usr/local/bin/fish
set -g default-terminal "tmux-256color"
#set-option -g default-terminal "xterm-256color"
#set -ga terminal-overrides "screen-256color:Tc"
#set -as terminal-overrides ',alacritty:Tc'
#set -as terminal-overrides ",gnome^:RGB"
set-option -g default-shell /usr/local/bin/fish
# use for tmux-vim clipboard plugin
set -g focus-events on
# set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
# start with window 1 (instead of 0)
set -g base-index 1
# renumber windows after closing
set -g renumber-windows on
# start with pane 1
set -g pane-base-index 1
# remove esc delay
set -sg escape-time 0
# history
set -g history-limit 10000
# allow terminal scrolling
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
# use vi mode
setw -g mode-keys vi
set -g status-keys vi
# pleb mode
set -g mouse on
# panes
set -g pane-border-style "fg=colour0"
set -g pane-active-border-style "fg=colour0"
#set -g window-active-style 'bg=colour236'
#set -g window-style 'bg=black'
# status line
set -g status-justify left
set -g status-style "bg=#2e3440,fg=blue"
set-option -g status-interval 1
# messaging
set -g message-style "bg=#2e3440,fg=cyan"
set -g message-command-style "bg=#4c566a,fg=cyan"
# window mode
setw -g mode-style "bg=#4c566a,fg=cyan"
# split sytle
set -g pane-border-style "bg=colour0,fg=colour0"
set -g pane-active-border-style "bg=colour0,fg=colour0"
#resizing
setw -g aggressive-resize on
# window status
set-option -g status-position bottom
setw -g window-status-format "#[bg=#4c566a,fg=#2e3440,noreverse] #W ░▒▓█"
setw -g window-status-current-format "#[bg=#5E81AC]#[fg=#2e3440] #W ░▒▓█"
setw -g window-status-separator ''
#info on left
# set -g status-left '█▓▒░ '
set -g status-left ''
# info on right
set -g status-right-length 100
set -g status-right '#(~/Development/dotfiles/tmux/bin/tmux-status)'
# loud or quiet?
set-option -g visual-activity on
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# tmux clock
set -g clock-mode-colour colour14
# change prefix to backtick
unbind C-b
set-option -g prefix `
bind ` send-prefix
# vim style copy paste mode
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# splitting
unbind %
bind h split-window -v
unbind '"'
bind v split-window -h
# navigate and resize splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n M-h if-shell "$is_vim" "send-keys M-h" "resize-pane -L 2"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "resize-pane -R 2"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "resize-pane -U 2"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "resize-pane -D 2"
# zoom split
unbind z
bind z if-shell "$is_vim" "send-keys ,z" "resize-pane -Z"
bind Z resize-pane -Z
# vim style commands
bind : command-prompt
# screensaver
#set -g lock-after-time 300
# set -g lock-command "/usr/local/bin/cmatrix -a -s -u 3"
# set -g lock-command "pipes.sh -t1"
#set -g lock-command "unimatrix -l kkknnssss -a -o -s 95 -n -f"
# set -g lock-command "bklk -s"
# set -g lock-command "cmatrix -sab"
bind-key -n S-Up set-option -g status
bind-key -n S-Down set-option -g status
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
# source config file
bind r source-file ~/.tmux.conf \; display-message "█▓░ ~/.tmux.conf reloaded."
# other random key-binding changes
bind x kill-pane
bind t set status
bind a set-window-option synchronize-panes \; display-message "█▓░ synchronize"
#run-shell "notify-send -m 'tmux: reloaded' -i '~/Development/cmd-notify.jpg'"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'xamut/tmux-spotify'
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment