From 071a90198d094881f8950c1a5f9edea2c837e466 Mon Sep 17 00:00:00 2001 From: Adrien Schaegis Date: Wed, 15 Jul 2015 18:11:51 +0100 Subject: [PATCH] Add tmux examples --- README.md | 7 +++++- examples/tmux.conf | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 examples/tmux.conf diff --git a/README.md b/README.md index 3a41294..a077c92 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/examples/tmux.conf b/examples/tmux.conf new file mode 100644 index 0000000..98f00fc --- /dev/null +++ b/examples/tmux.conf @@ -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