Skip to content

Commit

Permalink
Fix tmux configs!
Browse files Browse the repository at this point in the history
Fixes from:
- tmux/tmux#754
- tmux/tmux#1689
- tmux/tmux#230
- tmux-plugins/tpm#67

(And probably others...)
  • Loading branch information
nickmoorman committed Aug 27, 2021
1 parent 052bec8 commit 1d11306
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions setup.sh
Expand Up @@ -23,6 +23,10 @@ ln -s ${CUR_DIR}/tmux/tmux.conf ${HOME}/.tmux.conf
ln -s ${CUR_DIR}/tmux/conf/base.conf ${HOME}/.tmux/conf/base.conf
ln -s ${CUR_DIR}/tmux/conf/screen-bindings.conf ${HOME}/.tmux/conf/screen-bindings.conf
ln -s ${CUR_DIR}/tmux/conf/tpm.conf ${HOME}/.tmux/conf/tpm.conf
# See: https://superuser.com/a/454827
#brew install reattach-to-user-namespace
# See: https://github.com/tmux-plugins/tpm/issues/67#issuecomment-464260747
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

# TODO: ack

Expand Down
26 changes: 14 additions & 12 deletions tmux/conf/base.conf
Expand Up @@ -15,24 +15,23 @@ set -g status-right-length 70
#TODO: FIX THIS SHIT
set -g status-right "#[fg=colour255]#(date \"+%m/%d/%y %H:%M\") #[fg=colour190][#S]#[fg=colour140] \(#(ifconfig en0 | grep 'inet ' | awk '{print \"wifi: \" $2}')\)#[fg=colour170] \(#(ifconfig utun0 | grep 'inet ' | awk '{print \"vpn: \" $2}')\)"
set -g status-left " "
set-window-option -g window-status-current-bg black
set-window-option -g window-status-current-style bg=black
# Don't rename windows
set-window-option -g allow-rename off
set -g window-status-format "#[bg=colour140,fg=colour8] #I #[bg=colour24,fg=colour140]▙#[bg=colour24,fg=colour255] #W "
set -g window-status-current-format "#[bg=colour140,fg=colour8] #I #[bg=colour255,fg=colour140]▙#[bg=colour255,fg=colour24] #W #[fg=colour255]"

# Status messages
set -g status-utf8 on
set -g status-interval 5
set -g status-justify left

# Set message colors
set-option -g message-bg colour180
set-option -g message-fg black
set-option -g message-style bg=colour180
set-option -g message-style fg=black

# Pane colors
set-option -g pane-border-fg black
set-option -g pane-active-border-fg colour210
set-option -g pane-border-style fg=black
set-option -g pane-active-border-style fg=colour210

# Support nested tmux sessions for great good.
bind C-a send-prefix
Expand All @@ -50,23 +49,26 @@ bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

# Turn on utf8
set-window-option -g utf8 on
# NOTE: causes "invalid option: utf8" error
# Probably unnecessary; see: https://github.com/tmux/tmux/issues/230
#set-window-option -g utf8 on

# 0 is way too far from 1 :D
set -g base-index 1
set -g pane-base-index 1

# Split window horizontally or vertically
bind \ split-window -h # Because it's one less keystroke than |
bind \\ split-window -h # Because it's one less keystroke than |
bind - split-window -v

# Visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on

# Use vi keybindings in copy mode
# See: https://github.com/tmux/tmux/issues/754#issuecomment-297452143
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "/usr/local/bin/reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "/usr/local/bin/reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "/usr/local/bin/reattach-to-user-namespace pbcopy"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "/usr/local/bin/reattach-to-user-namespace pbcopy"
3 changes: 3 additions & 0 deletions tmux/conf/tpm.conf
Expand Up @@ -16,5 +16,8 @@ set -g @resurrect-capture-pane-contents 'on'
# tmux-continuum configuration
set -g @continuum-restore 'on'

# See: https://github.com/tmux-plugins/tpm/issues/67#issuecomment-319561401
#set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"

# Initialize tmux Plugin Manager
run '~/.tmux/plugins/tpm/tpm'

0 comments on commit 1d11306

Please sign in to comment.