Components ⟡
Shortcuts ⌨
Reference I • Reference II
Default Mode → Emacs
Shorcuts’ Meaning
Key | Meaning | |
---|
C | Control | C-c → Control+c |
M | Alt | M-a → Alt+a |
S | Shift | S-o → Shift+o |
Super | Windows | Super-s → Windows+s |
Return | Enter | C-S-Return → Control+Shift+Enter |
- | + | C-z → Control+z |
{a,b,c,d} | a b c d | C-{a,b,c,d} → C-a C-b C-c C-d |
Emacs
Motion
Action | Shorcut |
---|
Move to the Beginning/End of the Line | C-a C-e |
Move Backward/Forward One Character | C-b C-f |
Move Backward/Forward One Word | M-b M-f |
Move to the Beginning of the line Return to the previous Position | C-x C-x |
Edition
Action | Shortcut |
---|
Delete all Characters Before/After the Cursor | C-u C-k |
Delete One Word Backward/Forward | C-w M-d |
Delete One Character Backward/Forward | C-h C-d |
Yank (Paste the last element Deleted or Cut) | C-y |
Convert Word to Uppercase/Lowercase | M-u M-l |
History
Action | Shortcuts |
---|
Move to Previous/Next Command | C-p C-n |
Reverse/Forward Search (History Searching Mode) | C-r C-s |
Leave History Searching Mode | C-g |
Reverse Search - Run the Current Command | C-o |
Misc
Action | Shortcuts |
---|
Execute Command (Sames as Return ) | C-j C-m |
Clear the Screen | C-l |
Interrupt Current Process (SIGINT) | C-c |
Suspend Current Process (SIGTSTP) | C-z |
Last Command Repetition (History Expansion) | !! |
Paste Previous Command’s Last Argument | M-dot !$ $_ |
Paste N Command’s Last Argument | !-N:$ |
Toogle to Command Line Editor | C-x C-e |
Code Snippet
$ nvim foo.bash
#!/usr/bin/env bash
bash()
{
case $( /bin/ps -p "$PPID" -o comm= ) in
*bash) return 0
;;
*) printf "Shell is not a Bash. Exiting...\n" 1>&2
return 1
;;
esac
}
bash || exit 99
$ chmod u+x foo.bash
$ dash -c './foo.bash'
Shell is not Bash. Exiting...