Skip to content

Commit

Permalink
init tmux.conf init
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKowalczyk1984 committed Dec 15, 2019
1 parent 814eca8 commit be5ede8
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions shells/tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# -- general -------------------------------------------------------------------# {{{

setw -g xterm-keys on
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
# set -s quiet on # disable various messages
set -s focus-events on

set -g prefix2 C-a # GNU-Screen compatible prefix
bind C-a send-prefix -2

set -g history-limit 10000 # boost history
set -g default-terminal "screen-256color"

set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
# edit configuration
bind e new-window -n '~/.tmux.conf.local' "sh -c '\${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"

# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
set-window-option -g mode-keys vi
# }}}
# -- display -------------------------------------------------------------------# {{{

set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows

setw -g automatic-rename on # rename window to reflect current program
# renumber windows when a window is closed
set -g renumber-windows on

set -g set-titles on # set terminal title
set -g set-titles-string '#h ❐ #S ● #I #W'

set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time

set -g status-interval 60 # redraw status line every 10 seconds
set-option -g status-position top

# 24 hour clock
setw -g clock-mode-style 24

# clear both screen and history
bind -n C-l send-keys C-l \; run 'tmux clear-history'

# activity
set -g monitor-activity on
set -g visual-activity off
# }}}
# -- navigation ----------------------------------------------------------------# {{{

# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'

# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one

# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2

# window navigation
unbind n
unbind p
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Tab last-window # move to last active window
# }}}
# -- edit mode -----------------------------------------------------------------# {{{

# bind -cTvi-edit H start-of-line
# bind -cTvi-edit L end-of-line
# bind -cTvi-edit q cancel
# }}}
# -- copy mode -----------------------------------------------------------------# {{{

bind Enter copy-mode # enter copy mode
bind b list-buffers # list paster buffers
bind p paste-buffer # paste from the top pate buffer
bind P choose-buffer # choose which buffer to paste from

# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
# bind -t vi-copy v begin-selection
# bind -t vi-copy C-v rectangle-toggle
# bind -t vi-copy y copy-selection
# bind-key -t vi-copy Y copy-pipe "xclip -selection clipboard -i"
# bind -t vi-copy H start-of-line
# bind -t vi-copy L end-of-line
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "xclip -selection clipboard -i"
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi 'V' send rectangle-toggle
# copy to Mac OSX pasteboard
if -b 'which -s reattach-to-user-namespace' 'bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# }}}
# -- user defined --------------------------------------------------------------# {{{
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
# }}}
# -- plugins---------------------------------------------------------------------# {{{
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'caiogondim/maglev'
set -g @plugin 'arcticicestudio/nord-tmux'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-battery'
# }}}
# -- reload of the config file-------------------------------------------------------# {{{
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
run '~/.tmux/plugins/tpm/tpm'
# }}}
# -- folding the .vimrc {{{
# vim:foldmethod=marker:foldlevel=0
# }}}

0 comments on commit be5ede8

Please sign in to comment.