From d4286056d3e48dc3a44bc51adb1a1b6da80c990c Mon Sep 17 00:00:00 2001 From: kaernyk Date: Tue, 2 Sep 2014 18:24:41 -0400 Subject: [PATCH 1/4] Create LearnTmux.txt Quick write-up of using tmux --- LearnTmux.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 LearnTmux.txt diff --git a/LearnTmux.txt b/LearnTmux.txt new file mode 100644 index 00000000..a86e36f4 --- /dev/null +++ b/LearnTmux.txt @@ -0,0 +1,61 @@ +--- +category: tool +tool: tmux +contributors: + - ["kaernyk", "http://github.com/kaernyk"] +filename: LearnTmux.txt +--- + + tmux is a terminal multiplexer: it enables a number of terminals to be +created, accessed, and controlled from a single screen. tmux may be detached +from a screen and continue running in the background, then later reattached. + + This will be a quick walkthough detailing the basic method of controlling tmux +for users to get acclimated quickly. Once you feel comfortable manipulating +tmux to suit your needs, I strongly suggest you read the man pages. + + +### Session Management +```bash + tmux new Create new session + -s "Session" Create named session + -n "Window" Create named Window + -c "/dir" Start in target directory + + ex: tmux new -c "~/Documents" -s "" -n "" + ----------------------------------------------------------------------------- + C^b d Detach current session + C^b D Select session to detach + ----------------------------------------------------------------------------- + tmux attach Attach last/available session + -t "#" Attach target session + -d Detach the session from other instances + ----------------------------------------------------------------------------- + tmux ls List open sessions + C^b s Select new session for attached client interactively + ----------------------------------------------------------------------------- + kill-session Kill current session + -t "#" Kill target session + -a Kill all sessions + -a -t "#" Kill all sessions but the target + ----------------------------------------------------------------------------- +``` + +### Window Management +```bash + ----------------------------------------------------------------------------- + C^b c Create another window + C^b " Split Horizontally + C^b % Split Vertically + ----------------------------------------------------------------------------- + C^b q Briefly display pane indexes + C^b w Choose current window interactively + ----------------------------------------------------------------------------- + + Detaching Windows + + ----------------------------------------------------------------------------- + + Killing Windows + +``` From fd2cf1606fb13ce506e0fdee0123269cf6023522 Mon Sep 17 00:00:00 2001 From: kaernyk Date: Tue, 2 Sep 2014 18:52:29 -0400 Subject: [PATCH 2/4] Update LearnTmux.txt clean up in prep for markdown --- LearnTmux.txt | 92 ++++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/LearnTmux.txt b/LearnTmux.txt index a86e36f4..e73d1485 100644 --- a/LearnTmux.txt +++ b/LearnTmux.txt @@ -15,47 +15,55 @@ for users to get acclimated quickly. Once you feel comfortable manipulating tmux to suit your needs, I strongly suggest you read the man pages. -### Session Management -```bash - tmux new Create new session - -s "Session" Create named session - -n "Window" Create named Window - -c "/dir" Start in target directory - - ex: tmux new -c "~/Documents" -s "" -n "" - ----------------------------------------------------------------------------- - C^b d Detach current session - C^b D Select session to detach - ----------------------------------------------------------------------------- - tmux attach Attach last/available session - -t "#" Attach target session - -d Detach the session from other instances - ----------------------------------------------------------------------------- - tmux ls List open sessions - C^b s Select new session for attached client interactively - ----------------------------------------------------------------------------- - kill-session Kill current session - -t "#" Kill target session - -a Kill all sessions - -a -t "#" Kill all sessions but the target - ----------------------------------------------------------------------------- -``` - -### Window Management -```bash - ----------------------------------------------------------------------------- - C^b c Create another window - C^b " Split Horizontally - C^b % Split Vertically - ----------------------------------------------------------------------------- - C^b q Briefly display pane indexes - C^b w Choose current window interactively - ----------------------------------------------------------------------------- - - Detaching Windows - - ----------------------------------------------------------------------------- - - Killing Windows +``` +# Session Management + + tmux new Create new session + -s "Session" Create named session + -n "Window" Create named Window + -c "/dir" Start in target directory + ex: $ tmux new -c "~/" -s "Name" -n "Name" + + C^b $ Rename current session + + C^b d Detach current session + C^b D Select session to detach + + tmux attach Attach last/available session + -t "#" Attach target session + -d Detach the session from other instances + tmux ls List open sessions + C^b s Select new session for attached client interactively + + kill-session Kill current session + -t "#" Kill target session + -a Kill all sessions + -a -t "#" Kill all sessions but the target + + +# Window Management + + C^b c Create another window + C^b " Split Horizontally + C^b % Split Vertically + + exit or C^b x Kill the current pane + + C^b q Briefly display pane indexes + C^# Choose current window by # + C^b w Choose current window interactively + C^b n Change to next window + C^b p Change to previous window + C^b Up, Right Change to pane in selected direction + Down, left + + C^b { Swap current/previous pane + C^b } Swap current/next pane + + C^b C-Up, Right Resize in steps of one cell + Down, left + + C^b M-Up, Right resize in steps of five cells + Down, left ``` From 4347222876022e98d6ce8f0e1f6ab9a60159c653 Mon Sep 17 00:00:00 2001 From: kaernyk Date: Thu, 4 Sep 2014 14:30:25 -0400 Subject: [PATCH 3/4] Update LearnTmux.txt --- LearnTmux.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/LearnTmux.txt b/LearnTmux.txt index e73d1485..3396989f 100644 --- a/LearnTmux.txt +++ b/LearnTmux.txt @@ -23,16 +23,15 @@ tmux to suit your needs, I strongly suggest you read the man pages. -s "Session" Create named session -n "Window" Create named Window -c "/dir" Start in target directory - ex: $ tmux new -c "~/" -s "Name" -n "Name" - + C^b $ Rename current session - C^b d Detach current session C^b D Select session to detach tmux attach Attach last/available session -t "#" Attach target session -d Detach the session from other instances + tmux ls List open sessions C^b s Select new session for attached client interactively @@ -48,8 +47,6 @@ tmux to suit your needs, I strongly suggest you read the man pages. C^b " Split Horizontally C^b % Split Vertically - exit or C^b x Kill the current pane - C^b q Briefly display pane indexes C^# Choose current window by # C^b w Choose current window interactively @@ -57,13 +54,18 @@ tmux to suit your needs, I strongly suggest you read the man pages. C^b p Change to previous window C^b Up, Right Change to pane in selected direction Down, left - - C^b { Swap current/previous pane - C^b } Swap current/next pane - + C^b { Swap current/previous window + C^b } Swap current/next window C^b C-Up, Right Resize in steps of one cell Down, left - C^b M-Up, Right resize in steps of five cells Down, left + C^b M-(1-5) 1 - Tile vertically + 2 - Tile horizontally + 3 - Tile Vertically /w large horizontal + 4 - Tile horizontally /w large vertical + 5 - Tile all windows evenly + + exit or C^b x Kill the current window + ``` From 9f791e1e66c1ff2e42d7fa9ac5ad42e36037176e Mon Sep 17 00:00:00 2001 From: kaernyk Date: Thu, 4 Sep 2014 14:45:44 -0400 Subject: [PATCH 4/4] re-order commands I'm trying to perfect the order so that learning how to use tmux can be reasonably accomplished in one sitting. I feel like I may be leaving out some things that power users would be interested in, but for the sake of someone attempting to find out if they enjoy using tmux I believe it is in decent shape. --- LearnTmux.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/LearnTmux.txt b/LearnTmux.txt index 3396989f..eaf3fd25 100644 --- a/LearnTmux.txt +++ b/LearnTmux.txt @@ -6,13 +6,13 @@ contributors: filename: LearnTmux.txt --- + tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. - This will be a quick walkthough detailing the basic method of controlling tmux -for users to get acclimated quickly. Once you feel comfortable manipulating -tmux to suit your needs, I strongly suggest you read the man pages. + Once you feel comfortable manipulating tmux to suit your needs, I strongly +suggest you read the man pages. @@ -46,26 +46,26 @@ tmux to suit your needs, I strongly suggest you read the man pages. C^b c Create another window C^b " Split Horizontally C^b % Split Vertically - + C^b M-(1-5) 1) Tile vertically + 2) Tile horizontally + 3) Tile Vertically /w large horizontal + 4) Tile horizontally /w large vertical + 5) Tile all windows evenly + C^b q Briefly display pane indexes C^# Choose current window by # C^b w Choose current window interactively C^b n Change to next window C^b p Change to previous window C^b Up, Right Change to pane in selected direction - Down, left + Down, left C^b { Swap current/previous window C^b } Swap current/next window + C^b C-Up, Right Resize in steps of one cell Down, left C^b M-Up, Right resize in steps of five cells Down, left - C^b M-(1-5) 1 - Tile vertically - 2 - Tile horizontally - 3 - Tile Vertically /w large horizontal - 4 - Tile horizontally /w large vertical - 5 - Tile all windows evenly - + exit or C^b x Kill the current window - ```