Add tmux examples

pull/282/head
Adrien Schaegis 2015-07-15 18:11:51 +01:00
parent 260b904a10
commit 071a90198d
2 changed files with 68 additions and 1 deletions

View File

@ -124,7 +124,12 @@ Notes:
- Use `man ascii` for a good ASCII table, with hex and decimal values. For general encoding info, `man unicode`, `man utf-8`, and `man latin1` are helpful.
- Use `screen` or [`tmux`](https://tmux.github.io/) to multiplex the screen, especially useful on remote ssh sessions and to detach and re-attach to a session. A more minimal alternative for session persistence only is `dtach`.
- Use `screen` or [`tmux`](https://tmux.github.io/) to multiplex the screen, especially useful on remote ssh sessions and to detach and re-attach to a session.
A more minimal alternative for session persistence only is `dtach`.
See `tmux` example in [here](examples/tmux.conf).
Uses example of `tmux`:
- __new__: `tmux -S /tmp/tm_session new`
- __get__: `tmux -S /tmp/tm_session attach -d`
- In ssh, knowing how to port tunnel with `-L` or `-D` (and occasionally `-R`) is useful, e.g. to access web sites from a remote server.

62
examples/tmux.conf Normal file
View File

@ -0,0 +1,62 @@
# File to put here: ~/.tmux.conf
##################################
# Keyboard hotkeys
##################################
# Change `ctrl + b` to `ctrl + x`
set -g prefix C-x
unbind C-b
bind C-x send-prefix
# Key mode 'vi'
set-window-option -g mode-keys vi
# Copy/Paste
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# We use `ctrl + {arrow}` to navigate through windows (terminal)
bind-key -n C-right next-window
bind-key -n C-left previous-window
# We use `alt + {arrow}` to navigate through panels
bind-key -n M-left select-pane -L
bind-key -n M-right select-pane -R
bind-key -n M-up select-pane -U
bind-key -n M-down select-pane -D
# Use `|` to split vertically and `-` to split horizontaly
bind | split-window -h
bind - split-window -v
##################################
# Usefull changes
##################################
# We force the mouse to be disabled on the panels
set -g mode-mouse off
# The windows starts a `1` instead of `0`
set -g base-index 1
##################################
# Visual changes
##################################
# We set the non-active pannels to grey
set -g pane-border-fg colour244
set -g pane-border-bg default
# We set the active panel to red
set -g pane-active-border-fg colour124
set -g pane-active-border-bg default
# We set the status bar to grey
set -g status-fg colour235
set -g status-bg colour250
set -g status-attr dim
# Overligned the active windows in the status bar (color = darken grey)
set-window-option -g window-status-current-fg colour15
set-window-option -g window-status-current-bg colour0