Skip to content

Commit

Permalink
new configs for tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiobotaro committed Oct 4, 2016
1 parent e10aeec commit 3d007e2
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 49 deletions.
109 changes: 63 additions & 46 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -1,63 +1,44 @@
# 256 colors
set -g default-terminal "screen-256color"
# utf-8
set -g utf8
set-window-option -g utf8 on

# settings 256 colors
set -g default-terminal "screen-256color"

# Remove ctrl + b prefix and set it to ctrl + a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# setting delay to avoid interfering with vim
set -sg escape-time 1
# shell
set-option -g default-shell /bin/zsh

# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# split panels binds
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# enabling mouse and allowing it to select pane
set-option -g mouse on
set-option -g status-position top
# send prefix to other applications
bind C-a send-prefix

set-option -g repeat-time 0
# changing indexing, base 1
set-option -g base-index 1
setw -g pane-base-index 1

# OPTIONS
set -g history-limit 5000
# add keybinding to reload .tmux file
bind r source-file ~/.tmux.conf \; display "Reloaded!"

# STATUS BAR
set -g status-bg black
set -g status-fg white
set -g window-status-current-fg 'yellow'
set -g status-left '#[fg=green]#{session_name} #[fg=white]|'
set -g status-right-length 60
set -g status-right 'Online: #{online_status} batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h %d %H:%M'

set -g @batt_charged_icon ""
set -g @batt_charging_icon ""
set -g @batt_discharging_icon ""
set -g @batt_attached_icon ""

# tmux plugin manager: github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @plugin 'tmux-plugins/tmux-sidebar'

# install tpm if not already installed
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"

run '~/.tmux/plugins/tpm/tpm'
# move like Vim with panels
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# resize panels with vim keys style
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

# copy/past with vim style
setw -g mode-keys vi
Expand All @@ -67,3 +48,39 @@ unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-pipe "xclip -in -selection clipboard"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "xclip -in -selection clipboard"

# escape time
set-option -g escape-time 1

# OPTIONS
set -g history-limit 5000

# Status bar on top
set-option -g status-position top

# customizing status bar
set -g status-fg green
set -g status-bg black

# coloring window status
setw -g window-status-fg green
setw -g window-status-current-fg blue

# Active pane border is green while the others are white
set -g pane-border-fg white
set -g pane-active-border-fg green

# message colors
set -g message-fg green
set -g message-bg black
set -g message-attr bright

set -g status-left " #S"
set -g window-status-current-format " #I:#W "
set -g window-status-format "#I:#W"
set -g status-right "#[fg=green]%R #[fg=green]%d/%m/%y"
set -g status-justify centre
set-option -g allow-rename off
setw -g automatic-rename off
4 changes: 1 addition & 3 deletions scripts_ubuntu/install_tmux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
sudo apt install tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cp ../.tmux.conf ~/
tmux source ~/.tmux.conf
echo "Now type \"tmux\" and install plugins."
echo "Press prefix + I (capital I, as in Install) to fetch the plugins."
echo "Tmux is ok! "

0 comments on commit 3d007e2

Please sign in to comment.