TMUX-SESSIONS
New session:
tmux
List session:
tmux list, Ctrl + b s
TMUX-PANES
Horizontal split:
Ctrl + b %
Vertical split:
Ctrl + b “
Swap panes:
Ctrl + b o
Kill pane:
Ctrl + b x
TMUX-WINDOWS
Create window:
Ctrl + b c
Close window:
Ctrl + b &
Move windows:
Ctrl + b p, Ctrl + b n
Move cursor to beginning of line:
Ctrl-a
Move cursor to end of line:
Ctrl-e
Move cursor back one word:
Ctrl-b
Move cursor forward one word:
Ctrl-f
Cut the last word:
Ctrl-w
Cut everything after the cursor:
Ctrl-k
Cut everything before the cursor:
Ctrl-u
Paste the last thing to be cut:
Ctrl-y
Undo:
Ctrl-_
The Up Arrow and Down Arrow keys go back in the command history
See:
Master Mac/Linux Terminal Shortcuts Like a Ninja
Show all the buffers:
:ls
Open a file in the list of buffers (you can use Tab key):
:buffer filename
Open a file in a new buffer:
:edit filename
Open a buffer:
:bufferN (N is buffer number)
Go to next buffer:
:bnext
Go back to the previous buffer
:bprev
Show all the tabs:
:tabs
Open file.txt in a new tab:
:tabnew file.txt
Close current tab:
:tabclose
Go to next tab:
:tabnext
Go to previous tab:
:tabprev
Split window horizontally:
:split
:split filename
Split window vertically:
:vsplit
:vsplit filename
Create new window:
:new filename
Close a window:
Move the cursor to left/bottom/top/right:
Move the cursor to another window:
Focus on Top/Middle/Bottom:
zt/zz/zb
Copy and save the content to a register:
“ay
Paste the content:
“p
Display the content of the registers:
:reg
Start recording on a dedicated key using q
Execute commands you want to reproduce (move, replace, append, …)
Stop recording using q
Replay as needed using **@**
See:
You can talk to Vim or Neovim in Verb Modifier Object sentences. Here are some of verbs, modifiers and objects.
Verbs:
v (visual), c (change), d (delete), y (yank/copy)
Modifiers:
i (inside), a (around), t (till..finds a character), f (find..like till except including the char), / (search..find a string/regex)
Objects:
w (word), s (sentence), p (paragraph), b (block/parentheses), t (tag, works for html/xml)
See:
delete the current word:
diw
delete the current word and enter insert mode after:
ciw
change current sentence:
cis
change a string inside quotes:
ci”
change until next occurrence of ‘foo’:
c/foo
change everything from here to the letter X:
ctX
visually select this paragraph
vap
Let’s add ” ” to multiple words using the small delete register (CTRL+r) and .
a: yiwciw”” ESC P
b: ciw”CTRL+r
-“, and ESCw.
Open Nvim Tree Toggle:
:NvmTreeToggle or , + n
Rename or Move:
r
Copy the name:
y
Copy the relative path:
Y
Copy the absolute path:
gy
Delete the file:
d
Open the file with default system application:
s
Open the file in a vertical split:
<Ctrl + v>
Open the file in a horizontal split:
<Ctrl + x>
Open the file in a new tab:
<Ctrl + t>
Open the file as a preview (keeping the cursor in the tree):
Refresh the tree:
R
Toggle the help to see all the commands:
g?
Find files:
:Telescope find_files (, + ff in my key mapping)
Grep search:
:Telescope live_grep (, +fg in my key mapping)
j/k Next/previous (in normal mode):tabnextNext/previous (in normal mode)
H/M/L Select High/Middle/Low (in normal mode)
gg/G Select the first/last item (in normal mode)
You can see the key mappings here:
Open Ranger with the following command in the terminal when Ranger often freeze:
ranger –clean
Shows or hides the floating window:
:RnvimrToggle (in Neovim)
Delete multiple files:
Select files with Space bar or V
d + D + Enter + y
Delete files with trash-cli using Shell:
:shell trash-put file_name1 file_name2
Go to the top of the list:
gg
Preview file:
i
Open file:
r
View hidden files:
zh
Rename current file:
cw
Copy file:
yy
Cut file:
dd
Undo:
u
Change settings:
z
Delete file:
dD
Move a file:
dd (cut)
pp (paste)
Move a file using Shell:
:shell -f mv %f /foo/bar
Move multiple files using Shell:
Select multiple files with Space bar
:shell mv %s /foo/bar
See:
Ranger on Linux – A Complete Terminal File Manager For Linux