Skip to content

Commit

Permalink
Update .tmux.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecollier authored Jul 6, 2021
1 parent 0fd5d47 commit e242c47
Showing 1 changed file with 38 additions and 70 deletions.
108 changes: 38 additions & 70 deletions tmux/.tmux.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
# enable system clipboard for macosx
set-option -g default-command "reattach-to-user-namespace -l $SHELL"

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# Autosave
set -g @continuum-restore 'on'

# Start window numbering at 1
set -g base-index 1
setw -g pane-base-index 1

# Act like Vim
set-window-option -g mode-keys vi
list-keys -T copy-mode-vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # Begin selection in copy mode.
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi 'Enter' send -X copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
bind P paste-buffer
set -g mouse on

Expand All @@ -29,6 +21,14 @@ bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R

bind c new-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"

# Terminal
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ',screen-256color:RGB'

# Vim splits
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
Expand All @@ -38,81 +38,49 @@ 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"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
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
bind-key -T copy-mode-vi 'C-\' select-pane -l

# Share paste-buffer with vim
set -g focus-events on
# Renumber windows
set-option -g renumber-windows on
setw -g xterm-keys on

# Start window numbering at 1
set -g base-index 1
setw -g pane-base-index 1

# Set inactive/active window styles
set -g window-style 'fg=colour247,bg=colour236'
set -g window-active-style 'fg=white,bg=black'

# Status line
# Highlight active window
set-window-option -g window-status-current-fg colour2
set-window-option -g window-status-current-style 'fg=colour2'


# Set background window
set -g status-bg colour0
set -g status-fg white
set -g status-style 'bg=colour0,fg=white'

# set the pane border colors
set -g pane-border-style fg=colour250,bg=colour236
set -g pane-active-border-style fg=green,bg=colour236

# Status line
# Shows computer name, turns yellow when prefix is used
set -g status-left-length 80
set -g status-left "#[bg=black]#{?client_prefix,#[fg=yellow],#[fg=red]} _ "

set -g status-right-length 80
set -g status-right "#[fg=green]#[bg=black]#[fg=red] #{battery_icon} #{battery_percentage} | %a %d-%m-%y | %h | %H:%M:%S "

# Reload tmux conf
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"

set -g @batt_charged_icon ""
set -g @batt_charging_icon ""
set -g @batt_attached_icon ""
set -g @batt_full_charge_icon ""
set -g @batt_high_charge_icon ""
set -g @batt_medium_charge_icon ""
set -g @batt_low_charge_icon ""

# Give 256 colours
set -g default-terminal "screen-256color"

# Stop tmux waiting for escape seqeuence
set -s escape-time 0
set -g status-right "#[fg=green]#[bg=black]#[fg=red]%a %d-%m-%y | %h | %H:%M:%S "

# Refresh left and right more often
set -g status-interval 5
set -g display-time 4000
set -g history-limit 50000
# setw -g aggressive-resize on
# Status bar at top to the top
set-option -g status-position top

#set inactive/active window styles
set -g window-style 'fg=colour247,bg=colour236'
set -g window-active-style 'fg=white,bg=black'

# set the pane border colors
set -g pane-border-fg colour250
set -g pane-border-bg colour236
set -g pane-active-border-fg green
set -g pane-active-border-bg colour236

# search
set -g @open-B 'https://www.google.com/search?q='

# Renumber windows
set-option -g renumber-windows on
setw -g xterm-keys on
set-option -sg escape-time 10

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'jbnicolai/tmux-fpp'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Reload tmux conf
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"

0 comments on commit e242c47

Please sign in to comment.