Skip to content

Instantly share code, notes, and snippets.

@bucker
Last active May 16, 2021 17:31

Revisions

  1. bucker revised this gist Sep 7, 2019. No changes.
  2. bucker renamed this gist Dec 31, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. bucker revised this gist Dec 31, 2014. No changes.
  4. bucker renamed this gist Dec 31, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. bucker created this gist Dec 31, 2014.
    41 changes: 41 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    To Use the option (⌥) key, set it as meta key

    ## Moving the cursor
    * `⌃a`: Go to the beginning of the line
    * `⌃e`: Go to the end of the line
    * `⌃p`: Previous command (Up arrow)
    * `⌃n`: Next command (Down arrow)
    * `⌃f`: Forward one character
    * `⌃b`: Backward one character
    * `⌃xx`: Toggle between the start of line and current cursor position
    * `⌥f`: Forward one word
    * `⌥b`: Backward one word

    ## Editing
    * `⌃L`: Clear the screen, similar to the `clear` command
    * `⌥Del`: Delete the word before the cursor
    * `⌥d`: Delete the word after the cursor
    * `⌃d`: Delete character under the cursor
    * `⌃w`: Cut the word before the cursor to the clipboard
    * `⌃k`: Cut the line after the cursor to the clipboard
    * `⌃u`: Cut/delete the line before the cursor position
    * `⌃y`: Paste (yank)
    * `⌥t`: Swap current word with previous
    * `⌃t`: Swap the last two characters before the cursor
    * `Esc + t`: Swap the last two words before the cursor
    * `⌥u`: UPPER capitalize every character from the cursor to the end of the current word
    * `⌥c`: Capitalize the character under the cursor and move to the end of the word
    * `⌃-`: Undo

    ## History
    * `⌃r`: Recall the last command including the specified character(s) searches the command history as you type. Equivalent to : vim ~/.bash_history
    * `⌃p`: Previous command
    * `⌃n`: Next command in history
    * `⌥.`: Use the last word of the previous command

    ## Process control
    * `⌃c`: Interrupt/Kill running process
    * `⌃s`: Stop output to the screen (for long running verbose commands)
    * `⌃q`: Allow output to the screen
    * `⌃d`: Send an EOF marker, unless disabled by an option, this will close the current shell
    * `⌃z`: Send th signal SIGTSTP to the current task, which suspends it. To return to it later enter `fg 'process name'`