.tmux.conf 4.89 KB
Newer Older
Mohcine Chraibi's avatar
Mohcine Chraibi committed
1
# General settings
Mohcine Chraibi's avatar
Mohcine Chraibi committed
2
#ZSH=`which zsh`
Mohcine Chraibi's avatar
Mohcine Chraibi committed
3
set-option -g default-shell /usr/local/bin/zsh
Mohcine Chraibi's avatar
Mohcine Chraibi committed
4
set -g default-terminal "screen-256color"
Mohcine Chraibi's avatar
Mohcine Chraibi committed
5 6
set -g history-limit 100000
# --------- binding keys
Mohcine Chraibi's avatar
Mohcine Chraibi committed
7 8 9 10 11 12 13
# Change prefix key to Ctrl+a
unbind C-b
set -g prefix C-a
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind-key c  new-window -c "#{pane_current_path}"
# key bindings for splitting
unbind %
Mohcine Chraibi's avatar
Mohcine Chraibi committed
14
# Horizontal
Mohcine Chraibi's avatar
Mohcine Chraibi committed
15 16 17 18 19 20 21 22 23
bind v split-window -h -c "#{pane_current_path}"
unbind '"'
# Vertical
bind h split-window -v -c "#{pane_current_path}"
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# key binding for nested tmux
#unbind q
bind a send-prefix
Mohcine Chraibi's avatar
Mohcine Chraibi committed
24
#--------------------------
Mohcine Chraibi's avatar
Mohcine Chraibi committed
25 26 27 28 29 30 31 32 33

# Terminal emulator window title

####################### zenburn
setw -g clock-mode-colour colour117
set -g status-bg colour235
set -g status-fg colour248
################################

Mohcine Chraibi's avatar
Mohcine Chraibi committed
34 35 36
set -g status-left '#(/usr/local/bin/battery -t) #(~/.tmuxDir/getProc.sh)'
#set -g status-right "#(~/.tmuxDir/itunes_status.sh) #[fg=#57575e]│ #[fg=white]%d/%m/%Y %H:%M "
set -g status-right "#[fg=grey]%d/%m | %H:%M  "
Mohcine Chraibi's avatar
Mohcine Chraibi committed
37

Mohcine Chraibi's avatar
Mohcine Chraibi committed
38 39
# -- display -------------------------------------------------------------------
set -g window-status-current-format '#{?pane_in_mode,#[fg=white#,bg=black],#[fg=red#,bg=white]}#W #I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
Mohcine Chraibi's avatar
Mohcine Chraibi committed
40

Mohcine Chraibi's avatar
Mohcine Chraibi committed
41 42
set -g base-index 1           # start windows numbering at 1
setw -g pane-base-index 1     # make pane numbering consistent with windows
Mohcine Chraibi's avatar
Mohcine Chraibi committed
43

Mohcine Chraibi's avatar
Mohcine Chraibi committed
44 45
setw -g automatic-rename on   # rename window to reflect current program
set -g renumber-windows on    # renumber windows when a window is closed
Mohcine Chraibi's avatar
Mohcine Chraibi committed
46

Mohcine Chraibi's avatar
Mohcine Chraibi committed
47 48
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000      # slightly longer status messages display time
Mohcine Chraibi's avatar
Mohcine Chraibi committed
49

Mohcine Chraibi's avatar
Mohcine Chraibi committed
50 51 52 53 54 55 56 57 58 59 60
set -g status-interval 10     # redraw status line every 10 seconds
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'

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

# activity
set -g monitor-activity on
set -g visual-activity off
set -g bell-action none
Mohcine Chraibi's avatar
Mohcine Chraibi committed
61
#------------------------------
Mohcine Chraibi's avatar
Mohcine Chraibi committed
62
set-option -g status-position top
Mohcine Chraibi's avatar
Mohcine Chraibi committed
63 64 65
set-option -g status on
set-option -g status-interval 5
set-option -g status-justify "centre"
Mohcine Chraibi's avatar
Mohcine Chraibi committed
66 67
set-option -g status-left-length 60
set-option -g status-right-length 100
Mohcine Chraibi's avatar
Mohcine Chraibi committed
68 69
#------------------------------
# window options
Mohcine Chraibi's avatar
Mohcine Chraibi committed
70
#set -g mouse-select-pane on
Mohcine Chraibi's avatar
Mohcine Chraibi committed
71 72 73 74 75 76 77 78 79 80 81 82
setw -g automatic-rename

# Easier pane resize keybindings.
bind-key -n C-M-u resize-pane -U 1
bind-key -n C-M-d resize-pane -D 1
bind-key -n C-M-l resize-pane -L 1
bind-key -n C-M-r resize-pane -R 1


# To copy:
# bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c "

Mohcine Chraibi's avatar
Mohcine Chraibi committed
83 84 85
#bind-key -t emacs-copy y copy-pipe "reattach-to-user-namespace pbcopy"
#unbind -t emacs-copy Enter
#bind-key -t emacs-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
Mohcine Chraibi's avatar
Mohcine Chraibi committed
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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142

# # To paste:
# bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer"

# bind-key y   new-window -n "emacs"  "emacsclient -nw"
# bind-key C-y split-window "emacsclient -nw"

# ------------------------------------------------------------ #
# Key Bindings / Copy Mode
# ------------------------------------------------------------ #

# bind-key -t emacs-copy C-d page-down
# bind-key -t emacs-copy C-u page-up

# bind-key -t emacs-copy C-h cursor-left
# bind-key -t emacs-copy Enter copy-selection
# bind-key -t emacs-copy C-y scroll-up
# # bind-key -t emacs-copy $ end-of-line
# # bind-key -t emacs-copy C run-shell
# bind-key -t emacs-copy / search-forward
# bind-key -t emacs-copy B previous-space
# bind-key -t emacs-copy D copy-end-of-line
# bind-key -t emacs-copy E next-space-end
# bind-key -t emacs-copy F jump-backward
# bind-key -t emacs-copy G history-bottom
# bind-key -t emacs-copy H top-line
# bind-key -t emacs-copy J scroll-down
# bind-key -t emacs-copy K scroll-up
# bind-key -t emacs-copy L bottom-line
# bind-key -t emacs-copy M middle-line
# bind-key -t emacs-copy N search-reverse
# bind-key -t emacs-copy T jump-to-backward
# bind-key -t emacs-copy W next-space
# # bind-key -t emacs-copy ^ back-to-indentation
# bind-key -t emacs-copy b previous-word
# bind-key -t emacs-copy e next-word-end
# bind-key -t emacs-copy f jump-forward
# bind-key -t emacs-copy g history-top
# bind-key -t emacs-copy h cursor-left
# bind-key -t emacs-copy j cursor-down
# bind-key -t emacs-copy k cursor-up
# bind-key -t emacs-copy l cursor-right
# bind-key -t emacs-copy n search-again
# bind-key -t emacs-copy q cancel
# # bind-key -t emacs-copy t jump-to-forward
# bind-key -t emacs-copy v rectangle-toggle
# bind-key -t emacs-copy w next-word
# bind-key -t emacs-copy BSpace cursor-left
# bind-key -t emacs-copy NPage page-down
# bind-key -t emacs-copy PPage page-up
# bind-key -t emacs-copy Up cursor-up
# bind-key -t emacs-copy Down cursor-down
# bind-key -t emacs-copy Left cursor-left
# bind-key -t emacs-copy Right cursor-right
# bind-key -t emacs-copy C-Up scroll-up
# bind-key -t emacs-copy C-Down scroll-down