Skip to content

Instantly share code, notes, and snippets.

@lrusev
Last active December 11, 2016 00:52
Show Gist options
  • Select an option

  • Save lrusev/95038037317eacb4792dab3d36066edf to your computer and use it in GitHub Desktop.

Select an option

Save lrusev/95038037317eacb4792dab3d36066edf to your computer and use it in GitHub Desktop.

Revisions

  1. lrusev revised this gist Dec 11, 2016. 1 changed file with 2 additions and 7 deletions.
    9 changes: 2 additions & 7 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D

    set display-panes-time 2000
    set -g display-panes-time 2000
    set -g pane-base-index 1

    # Shift arrow to switch windows
    @@ -119,12 +119,7 @@ set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: #(

    #Evil mouse settings
    ##scroll buffer
    setw -g mode-mouse on
    set -g mouse-select-pane on
    set -g mouse-resize-pane on
    set -g mouse-select-window on
    #setw -g mode-mouse off

    set -g mouse on
    # Toggle mouse on with ^B m
    bind m \
    set -g mode-mouse on \;\
  2. lrusev revised this gist Nov 8, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -60,6 +60,9 @@ bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D

    set display-panes-time 2000
    set -g pane-base-index 1

    # Shift arrow to switch windows
    bind -n S-Left previous-window
    bind -n S-Right next-window
  3. lrusev revised this gist Nov 8, 2016. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -161,10 +161,23 @@ bind p paste-buffer
    bind-key -t vi-copy 'v' begin-selection
    bind-key -t vi-copy 'y' copy-selection
    bind-key -t vi-copy 'r' rectangle-toggle
    #bind -t vi-copy y copy-pipe "xclip -sel clip -i"
    #bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"


    #https://powerline.readthedocs.io/en/latest/installation.html
    #run-shell "~/powerline-daemon -q"
    source ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf


    # List of plugins
    set -g @plugin 'tmux-plugins/tpm'
    set -g @plugin 'tmux-plugins/tmux-sensible'

    set -g @plugin 'tmux-plugins/tmux-resurrect'
    set -g @plugin 'tmux-plugins/tmux-continuum'
    set -g @plugin 'tmux-plugins/tmux-yank'
    set -g @plugin 'tmux-plugins/tmux-open'
    set -g @plugin 'tmux-plugins/tmux-copycat'

    set -g @continuum-restore 'on'
    # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
    run '~/.tmux/plugins/tpm/tpm'
  4. lrusev revised this gist Oct 27, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -162,6 +162,7 @@ bind-key -t vi-copy 'v' begin-selection
    bind-key -t vi-copy 'y' copy-selection
    bind-key -t vi-copy 'r' rectangle-toggle
    #bind -t vi-copy y copy-pipe "xclip -sel clip -i"
    #bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"


    #https://powerline.readthedocs.io/en/latest/installation.html
  5. lrusev revised this gist Oct 27, 2016. 1 changed file with 45 additions and 23 deletions.
    68 changes: 45 additions & 23 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -17,12 +17,13 @@ set-option -g set-titles on
    set -g status-keys vi
    set -g history-limit 10000


    # use vim keybindings in copy mode
    setw -g mode-keys vi
    #setw -g mode-mouse on
    setw -g monitor-activity on

    bind-key v split-window -h
    bind-key s split-window -v
    #bind-key v split-window -h
    #bind-key s split-window -v

    bind-key J resize-pane -D 5
    bind-key K resize-pane -U 5
    @@ -35,8 +36,8 @@ bind-key M-h resize-pane -L
    bind-key M-l resize-pane -R

    # use PREFIX | to split window horizontally and PREFIX - to split vertically
    bind | split-window -h
    bind - split-window -v
    #bind | split-window -h
    #bind - split-window -v

    # Make the current window the first window
    bind T swap-window -t 1
    @@ -66,27 +67,13 @@ bind -n S-Right next-window
    # No delay for escape key press
    set -sg escape-time 0

    # ---------------------
    # Copy & Paste
    # ---------------------
    # provide access to the clipboard for pbpaste, pbcopy
    #set-option -g default-command "reattach-to-user-namespace -l zsh"
    set-window-option -g automatic-rename on

    # use vim keybindings in copy mode
    setw -g mode-keys vi

    # setup 'v' to begin selection as in Vim
    bind-key -t vi-copy v begin-selection
    bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

    # update default binding of 'Enter' to also use copy-pipe
    unbind -t vi-copy Enter
    bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

    bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
    bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '

    # move x clipboard into tmux paste buffer
    bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
    # move tmux copy buffer into x clipboard
    bind C-y run "tmux show-buffer | xclip -i"

    # Reload tmux config
    bind r source-file ~/.tmux.conf
    @@ -135,12 +122,47 @@ set -g mouse-resize-pane on
    set -g mouse-select-window on
    #setw -g mode-mouse off

    # Toggle mouse on with ^B m
    bind m \
    set -g mode-mouse on \;\
    set -g mouse-resize-pane on \;\
    set -g mouse-select-pane on \;\
    set -g mouse-select-window on \;\
    display 'Mouse: ON'

    # Toggle mouse off with ^B M
    bind M \
    set -g mode-mouse off \;\
    set -g mouse-resize-pane off \;\
    set -g mouse-select-pane off \;\
    set -g mouse-select-window off \;\
    display 'Mouse: OFF'


    unbind +
    bind + \
    new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
    swap-pane -s tmux-zoom.0 \;\
    select-window -t tmux-zoom

    unbind -
    bind - \
    last-window \;\
    swap-pane -s tmux-zoom.0 \;\
    kill-window -t tmux-zoom


    # update default binding of 'Enter' to also use copy-pipe

    unbind [
    bind Escape copy-mode
    unbind p
    bind p paste-buffer
    bind-key -t vi-copy 'v' begin-selection
    bind-key -t vi-copy 'y' copy-selection
    bind-key -t vi-copy 'r' rectangle-toggle
    #bind -t vi-copy y copy-pipe "xclip -sel clip -i"


    #https://powerline.readthedocs.io/en/latest/installation.html
    #run-shell "~/powerline-daemon -q"
  6. lrusev revised this gist Oct 26, 2016. 1 changed file with 87 additions and 10 deletions.
    97 changes: 87 additions & 10 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # use UTF8
    set -g utf8
    set-window-option -g utf8 on

    set -g prefix C-a
    unbind C-b
    bind C-a send-prefix
    @@ -30,6 +34,13 @@ bind-key M-k resize-pane -U
    bind-key M-h resize-pane -L
    bind-key M-l resize-pane -R

    # use PREFIX | to split window horizontally and PREFIX - to split vertically
    bind | split-window -h
    bind - split-window -v

    # Make the current window the first window
    bind T swap-window -t 1

    # Vim style pane selection
    bind h select-pane -L
    bind j select-pane -D
    @@ -55,16 +66,82 @@ bind -n S-Right next-window
    # No delay for escape key press
    set -sg escape-time 0

    # ---------------------
    # Copy & Paste
    # ---------------------
    # provide access to the clipboard for pbpaste, pbcopy
    #set-option -g default-command "reattach-to-user-namespace -l zsh"
    set-window-option -g automatic-rename on

    # use vim keybindings in copy mode
    setw -g mode-keys vi

    # setup 'v' to begin selection as in Vim
    bind-key -t vi-copy v begin-selection
    bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

    # update default binding of 'Enter' to also use copy-pipe
    unbind -t vi-copy Enter
    bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

    bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
    bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '


    # Reload tmux config
    bind r source-file ~/.tmux.conf

    # THEME
    set -g status-bg black
    set -g status-fg white
    set -g window-status-current-bg white
    set -g window-status-current-fg black
    set -g window-status-current-attr bold
    set -g status-interval 60
    set -g status-left-length 30
    set -g status-left '#[fg=green](#S) #(whoami)'
    set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
    # ----------------------
    # Status Bar
    # -----------------------
    set-option -g status on # turn the status bar on
    set -g status-utf8 on # set utf-8 for the status bar
    set -g status-interval 5 # set update frequencey (default 15 seconds)
    set -g status-justify centre # center window list for clarity
    # set-option -g status-position top # position the status bar at top of screen

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

    # set color for status bar
    set-option -g status-bg colour235 #base02
    set-option -g status-fg yellow #yellow
    set-option -g status-attr dim

    # set window list colors - red for active and cyan for inactive
    set-window-option -g window-status-fg brightblue #base0
    set-window-option -g window-status-bg colour236
    set-window-option -g window-status-attr dim

    set-window-option -g window-status-current-fg brightred #orange
    set-window-option -g window-status-current-bg colour236
    set-window-option -g window-status-current-attr bright

    # show host name and IP address on left side of status bar
    set -g status-left-length 70
    set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "

    # show session name, window & pane number, date and time on right side of
    # status bar
    set -g status-right-length 60
    set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: #(date | awk '{print $4}') ::"

    #Evil mouse settings
    ##scroll buffer
    setw -g mode-mouse on
    set -g mouse-select-pane on
    set -g mouse-resize-pane on
    set -g mouse-select-window on
    #setw -g mode-mouse off

    unbind [
    bind Escape copy-mode
    unbind p
    bind p paste-buffer
    bind-key -t vi-copy 'v' begin-selection
    bind-key -t vi-copy 'y' copy-selection

    #https://powerline.readthedocs.io/en/latest/installation.html
    #run-shell "~/powerline-daemon -q"
    source ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
  7. lrusev revised this gist Oct 26, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion tmux.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    set -g prefix C-a
    unbind C-b
    bind C-a send-prefix

    # 0 is too far from ` ;)
    set -g base-index 1

    @@ -63,4 +67,4 @@ set -g window-status-current-attr bold
    set -g status-interval 60
    set -g status-left-length 30
    set -g status-left '#[fg=green](#S) #(whoami)'
    set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
    set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
  8. lrusev created this gist Oct 26, 2016.
    66 changes: 66 additions & 0 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    # 0 is too far from ` ;)
    set -g base-index 1

    # Automatically set window title
    set-window-option -g automatic-rename on
    set-option -g set-titles on

    #set -g default-terminal screen-256color
    set -g status-keys vi
    set -g history-limit 10000

    setw -g mode-keys vi
    #setw -g mode-mouse on
    setw -g monitor-activity on

    bind-key v split-window -h
    bind-key s split-window -v

    bind-key J resize-pane -D 5
    bind-key K resize-pane -U 5
    bind-key H resize-pane -L 5
    bind-key L resize-pane -R 5

    bind-key M-j resize-pane -D
    bind-key M-k resize-pane -U
    bind-key M-h resize-pane -L
    bind-key M-l resize-pane -R

    # Vim style pane selection
    bind h select-pane -L
    bind j select-pane -D
    bind k select-pane -U
    bind l select-pane -R

    # Use Alt-vim keys without prefix key to switch panes
    bind -n M-h select-pane -L
    bind -n M-j select-pane -D
    bind -n M-k select-pane -U
    bind -n M-l select-pane -R

    # Use Alt-arrow keys without prefix key to switch panes
    bind -n M-Left select-pane -L
    bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D

    # Shift arrow to switch windows
    bind -n S-Left previous-window
    bind -n S-Right next-window

    # No delay for escape key press
    set -sg escape-time 0

    # Reload tmux config
    bind r source-file ~/.tmux.conf

    # THEME
    set -g status-bg black
    set -g status-fg white
    set -g window-status-current-bg white
    set -g window-status-current-fg black
    set -g window-status-current-attr bold
    set -g status-interval 60
    set -g status-left-length 30
    set -g status-left '#[fg=green](#S) #(whoami)'
    set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'