guest@dotshare [~/groups/terms/tmux] $ ls kalterfives-tmux-config/ | cat

kalterfive's tmux config (scrot) (+3 likes)

kalterfive Aug 27, 2015 (terms/tmux)

.tmux.conf(raw, dl)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
##
## Basic Options
##

# UTF-8
set -g utf8 on
set -g status-utf8 on

# Mouse
set -g mouse-select-pane off
set -g mode-mouse off
set -g mouse-select-window off
set -g mouse-resize-pane off

# Shut up!
set -g bell-action none
set -g bell-on-alert off
set quiet off

# Fix terminal name issues
set -s escape-time 1

# Enable status bar
bind-key b set status


##
## Copy mode
##

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


##
## Key bindings
##

unbind b
set -g prefix C-k

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

# Panel splites and selection
unbind %
bind g split-window -h
unbind '"'
bind v split-window -v
unbind o
bind-key -n C-g last-window
bind-key -n C-b previous-window
bind-key -n C-n next-window
bind n next-window
bind b previous-window

# Move around panes with hjkl, as one would in vim after pressing ctrl-w
unbind Left
unbind Right
unbind Up
unbind Down
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

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

# Kill
bind q kill-window
bind Q kill-session


##
## Appearance
##

# Status bar
set -g status-position bottom
set -g status-interval 4
set -g status-left ''
set -g status-right ''
set -g status-justify centre # center align window list

setw -g status-bg default
setw -g window-status-current-bg default
setw -g window-status-current-fg default
setw -g window-status-bg default
setw -g window-status-fg white
setw -g window-status-format '#[bg=black]#[fg=black,bold] #I #[bg=default] #[fg=black]#W  '
setw -g window-status-current-format '#[fg=white]#[bg=cyan] #I #[fg=cyan]#[bg=default] #W  '

# Panel borders
set -g pane-active-border-fg cyan
set -g pane-active-border-bg default
set -g pane-border-fg black
set -g pane-border-bg default

# Message text
set-option -g message-bg default
set-option -g message-fg default

CLICK TO VIEW

x

tmx(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

# ------------------------------------------------------------------------------
#
# Modified TMUX start script from:
#	 http://forums.gentoo.org/viewtopic-t-836006-start-0.html
#
# Store it to `~/bin/tmx` and issue `chmod +x`.
#
# ------------------------------------------------------------------------------

function check_session() {
	local postfix="$1"
	shift

	"${tmux[@]}" -L "session-$postfix" list-sessions -F "#S" 2>/dev/null | grep -q "$base_session-$postfix"
}

tmux=( "tmux" )
base_session="$USER"

if [[ "$XDG_SESSION_ID" ]] && check_session "$XDG_SESSION_ID"; then
	tmux+=( "-L" "session-$XDG_SESSION_ID" )
	base_session+="-$XDG_SESSION_ID"
fi

# ------------------------------------------------------------------------------


new_session="${base_session}-$$"

# Count tmux sessions (1 master + N slaves).
# If there are no slave sessions, do not create new windows.
if (( $("${tmux[@]}" ls | wc -l) > 1 )); then
	NEW_WINDOW_COMMAND=("new-window" "$*" ";")
fi

# Create a new session (without attaching it) and link to base session to share windows
# Attach to the new session & kill it once orphaned
exec "${tmux[@]}" new-session -d -t "$base_session" -s "$new_session" \; \
                  attach-session -t "$new_session" \; \
                  "${NEW_WINDOW_COMMAND[@]}" \
                  set-option destroy-unattached
 

x