From 6c0de2cca59c9725a808a6418ccd5d7ba81c9186 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Thu, 7 May 2020 14:34:22 +0200 Subject: [PATCH] Added Tmux configuration --- Tmux.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++ dotfiles/tmux.conf | 27 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 Tmux.md create mode 100644 dotfiles/tmux.conf diff --git a/Tmux.md b/Tmux.md new file mode 100644 index 0000000..6296a0a --- /dev/null +++ b/Tmux.md @@ -0,0 +1,65 @@ +# tmux cheatsheet + +start new: + + tmux + +start new with session name: + + tmux new -s myname + +attach: + + tmux a # (or at, or attach) + +attach to named: + + tmux a -t myname + +list sessions: + + tmux ls + +kill session: + + tmux kill-session -t myname + +In tmux, hit the prefix `ctrl+b` and then: + +## Sessions + + :new new session + s list sessions + $ name session + +## Windows (tabs) + + c new window + , name window + w list windows + f find window + & kill window + . move window - prompted for a new number + :movew move window to the next unused number + +## Panes (splits) + + \ horizontal split + - vertical split + + o swap panes + q show pane numbers + x kill pane + ⍽ space - toggle between layouts + +## Misc + + d detach + t big clock + ? list shortcuts + : prompt + +Resources: + +* [Based on henrik config](https://gist.github.com/henrik/1967800) +* [cheat sheet](http://cheat.errtheblog.com/s/tmux/) diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf new file mode 100644 index 0000000..929df64 --- /dev/null +++ b/dotfiles/tmux.conf @@ -0,0 +1,27 @@ +# Start window and pane indices at 1. +set -g base-index 1 +set -g pane-base-index 1 + +# Status bar styling and content. +set -g status-bg black +set -g status-fg white +set -g status-left '#S ' + +# Highlight the active window in the status bar. +set-window-option -g window-status-current-bg cyan +set-window-option -g window-status-current-fg black + +# Don't prompt to kill panes/windows. +bind-key x kill-pane +bind-key & kill-window + +# More intuitive split-window mappings. +bind "\\" split-window -h +bind - split-window -v + +# Maximize pane, e.g. for copying. +bind-key z resize-pane -Z + +# Reload tmux conf. +unbind r +bind r source-file ~/.tmux.conf\; display "Reloaded conf."