Last active
January 8, 2019 22:08
-
-
Save zjrosen1/bf0ae7a5c0e11a3d8327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################### | |
# | |_ _ __ ___ _ ___ __ # | |
# | __| '_ ` _ \| | | \ \/ / # | |
# | |_| | | | | | |_| |> < # | |
# \__|_| |_| |_|\__,_/_/\_\ # | |
############################### | |
# 1 VIM ♥♥♥ 20:04 | |
# [ Reset Prefix ] {{{1 | |
set -g prefix C-a | |
bind-key a send-prefix # for nested tmux sessions | |
# }}} | |
# [ Global Options ] {{{1 | |
set-option -g history-limit 15000 # Longer history | |
set -s escape-time 1 | |
set -g base-index 1 # Windows start at 1 | |
set -g pane-base-index 1 # Panes start at 1 | |
set-window-option -g utf8 on | |
set-window-option -g xterm-keys on # for vim | |
set-window-option -g mode-keys vi # vi key | |
set-window-option -g monitor-activity on | |
#set-option -g status-position top # move status bar to the top | |
setw -g automatic-rename # Automatically set window title | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# [ Mouse ] {{{2 | |
# use mouse # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ | |
#set -g mode-mouse on | |
#set -g mouse-resize-pane on | |
#set -g mouse-select-window on | |
#set -g mouse-select-pane on | |
# since 2.1 | |
set -g mouse on | |
# }}} | |
# [ Colors ] {{{2 | |
set-option -g default-terminal "screen-256color" #"xterm-256color" # "screen-256color" | |
# Visual Copy | |
set-window-option -g mode-bg colour10 | |
set-window-option -g mode-fg colour0 | |
# Panes Border | |
#set-option -g pane-border-fg white | |
#set-option -g pane-active-border-fg white | |
set-option -g pane-active-border-fg black | |
set-option -g pane-border-fg black | |
# Clock | |
set-window-option -g clock-mode-colour colour250 | |
set-window-option -g clock-mode-style 24 | |
# }}} | |
# }}} | |
# [ Status Bar ] {{{ | |
set-option -g status-utf8 on | |
# https://github.com/tmux/tmux/issues/108 | |
set-option -g status-interval 0 | |
set-option -g visual-activity on | |
# Default Window Title Colors | |
set-option -g status-bg colour233 | |
set-option -g status-fg colour240 | |
# Active Window Title Colors | |
#set-window-option -g window-status-current-fg colour220 | |
#set-window-option -g window-status-current-bg colour233 | |
#set-window-option -g window-status-current-fg colour246 | |
#setw -g window-status-current-attr default | |
# New Activity Title Colors | |
set-option -gw window-status-activity-bg colour233 | |
set-option -gw window-status-activity-fg red | |
# Left Status | |
set-option -g status-left-length 30 | |
set-option -g status-left-bg colour233 | |
set-option -g status-left-fg colour220 | |
#set-option -g status-left '#S #[fg=colour220]#I #[fg=colour220]#P' | |
#set-option -g status-left '#[bg=colour178] #[default] ' | |
set-option -g status-left '' | |
# Gold Left Status | |
#set-option -g status-left '#[fg=colour220]#S #[fg=colour220]#I #[fg=colour220]#P' | |
# Gray Left Status | |
#set-option -g status-left '#[fg=colour240]#S #[fg=colour240]#I #[fg=colour240]#P' | |
# Window Status | |
set-option -g status-left-bg colour233 | |
#set-option -g status-justify centre | |
set-option -g status-justify left | |
setw -g window-status-current-format "#[fg=colour232]#[bg=colour245] #I #[fg=colour250]#[bg=colour232] #W #[fg=colour220]#[default] " | |
#setw -g window-status-current-format "#[fg=black]|#[default] #W #[fg=black]|#[default]" | |
# Right Status | |
set-option -g status-right-length 100 | |
set-option -g status-right 'Life: #(/var/www/bin/tmux_battery.sh)#[default] | Live Views: #[fg=colour220]#(curl -s https://www.livecoding.tv/livestreams/unicorn/stats.json | json views_live )#[default] | BTC: #[fg=colour220]#(curl -s https://coinbase.com/api/v1/prices/spot_rate | json amount)#[default] | #[fg=colour240]%R #[default]' | |
# Titles (window number, program name, active (or not) | |
#set-option -g set-titles on | |
#set-option -g set-titles-string '#H:#S.#I.#P #W #T' | |
#set-option -g set-titles-string '#W #T' | |
# message text | |
set-option -g message-bg colour233 | |
set-option -g message-fg colour220 | |
# }}} | |
# [ Unbindings ] {{{1 | |
#unbind [ # copy mode bound to escape key | |
unbind j | |
unbind C-b # unbind default leader key | |
unbind '"' # unbind horizontal split | |
unbind % # unbind vertical split | |
# }}} | |
# [ Bindings ] {{{1 | |
# reload tmux conf | |
bind-key R source-file ~/.tmux.conf \; display-message "Config reloaded..." | |
#bind Escape copy-mode | |
bind-key - split-window -v # split pane horizontally | |
bind-key \ split-window -h # split pane vertically | |
# list panes | |
bind-key Space list-panes | |
# break-pane | |
bind-key Enter break-pane | |
# join-pane [-dhv] [-l size | -p percentage] [-s src-pane] | |
# [-t:dst-window.dst-pane] (destination window (dot) destination pane | |
# (alias: joinp) | |
# | |
#bind C-j command-prompt "joinp" | |
#bind C-j command-prompt "join-pane" | |
#bind-key j command-prompt "join-pane -s '%%'" | |
#bind-key j command-prompt "joinp -t:0" | |
#bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split | |
# }}} | |
# [ Windows ] {{{1 | |
bind C-j previous-window | |
bind C-k next-window | |
bind-key C-a last-window # C-a C-a for last active window | |
bind r command-prompt "rename-window %%" | |
bind s command-prompt "rename-session %%" | |
# By default, all windows in a session are constrained to the size of the | |
# smallest client connected to that session, | |
# even if both clients are looking at different windows. | |
# It seems that in this particular case, Screen has the better default | |
# where a window is only constrained in size if a smaller client | |
# is actively looking at it. | |
setw -g aggressive-resize on | |
# [ Vim Tmux Navigator ] {{{2 | |
# Smart pane switching with awareness of vim splits | |
# See: https://github.com/christoomey/vim-tmux-navigator | |
#is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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 C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" | |
# }}} | |
# }}} | |
# [ Panes ] {{{1 | |
# [ Navigation ] {{{2 | |
# use the vim motion keys to move between panes | |
bind-key h select-pane -L | |
bind-key j select-pane -D | |
bind-key k select-pane -U | |
bind-key l select-pane -R | |
# }}} | |
# [ Resizing ] {{{2 | |
bind-key -r H resize-pane -L 5 | |
bind-key -r J resize-pane -D 5 | |
bind-key -r K resize-pane -U 5 | |
bind-key -r L resize-pane -R 5 | |
bind-key -r Y resize-pane -L 1 | |
bind-key -r U resize-pane -D 1 | |
bind-key -r I resize-pane -U 1 | |
bind-key -r O resize-pane -R 1 | |
# }}} | |
# [ Layouts ] {{{2 | |
bind o select-layout "active-only" | |
bind M-- select-layout "even-vertical" | |
bind M-\ select-layout "even-horizontal" | |
bind M-r rotate-window | |
# }}} | |
# }}} | |
# [ Extras ] {{{1 | |
# vi movement keys | |
# set-option -g status-keys vi | |
# }}} | |
# [ Bash Scripts ] {{{1 | |
# [ Colours ] {{{2 | |
# for i in {0..255} ; do | |
# printf "\x1b[38;5;${i}mcolour${i}\n" | |
# done | |
# }}} | |
# [ Battery ] {{{2 | |
# HEART='♥' | |
# | |
# if [[ `uname` == 'Linux' ]]; then | |
# current_charge=$(cat /proc/acpi/battery/BAT1/state | grep 'remaining capacity' | awk '{print $3}') | |
# total_charge=$(cat /proc/acpi/battery/BAT1/info | grep 'last full capacity' | awk '{print $4}') | |
# else | |
# battery_info=`ioreg -rc AppleSmartBattery` | |
# current_charge=$(echo $battery_info | grep -o '"CurrentCapacity" = [0-9]\+' | awk '{print $3}') | |
# total_charge=$(echo $battery_info | grep -o '"MaxCapacity" = [0-9]\+' | awk '{print $3}') | |
# fi | |
# | |
# charged_slots=$(echo "(($current_charge/$total_charge)*10)+1" | bc -l | cut -d '.' -f 1) | |
# if [[ $charged_slots -gt 10 ]]; then | |
# charged_slots=10 | |
# fi | |
# | |
# echo -n '#[fg=red]' | |
# for i in `seq 1 $charged_slots`; do echo -n "$HEART"; done | |
# | |
# if [[ $charged_slots -lt 10 ]]; then | |
# echo -n '#[fg=white]' | |
# for i in `seq 1 $(echo "10-$charged_slots" | bc)`; do echo -n "$HEART"; done | |
# fi | |
# }}} | |
# }}} | |
# vim: set foldmethod=marker: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment