Skip to content

Instantly share code, notes, and snippets.

@andersonsp
Last active June 11, 2021 13:30
Show Gist options
  • Save andersonsp/30e1e10e302d304e61785143cda4aefa to your computer and use it in GitHub Desktop.
Save andersonsp/30e1e10e302d304e61785143cda4aefa to your computer and use it in GitHub Desktop.

Commands

Insert

  • 'i': Insert text before cursor
  • 'I': Insert at beginning of line
  • 'a': Append text after cursor
  • 'A': Append thext at end of line
  • 'o': Add new line after current
  • 'O': Add new line before current

Change

  • '~': Swap case
  • 'c': Change
  • 'C': Change to end of line
  • 'r': Replace with next typed character
  • 's': Delete character and continue typing (di)
  • 'S': Delete current line and continue typing (ddi)

Delete, Move

  • 'x': Delete character
  • 'X': Delete character left of the cursor
  • 'd': Delete
  • 'D': Delete to end of line
  • 'p': Put deleted text before cursor
  • 'P': Put deleted text after the cursor

Yank (copy)

  • 'y': Yank
  • 'Y': Yank current line

Mark

  • 'm': Set mark

Scrolling

  • 'z':
    • '\n':
    • '.':
    • '-':
    • 'l':
    • 'r':
    • 'L':
    • 'R':
    • 'e':
    • 'f':
  • TK_CTL('b'):
  • TK_CTL('f'):
  • TK_CTL('e'):
  • TK_CTL('y'):
  • TK_CTL('u'):
  • TK_CTL('d'):

Line number

  • 'g': Go to line ?
    • '~'
    • 'u'
    • 'U'
    • 'a'

Other commands

  • TK_CTL('l'): Redraw screen
  • TK_CTL('r'): Redraw screen
  • 'u': Undo
  • 'J': Join lines
  • '.': Repeat command

Exit and save

  • 'Z':
    • 'Z' Quit and save

Uncategorized

  • TK_CTL('z'):

  • TK_CTL('g'):

  • TK_CTL('^'):

  • ':': Ex command

  • '!': Force ?

  • '>':

  • '<':

Motions

Character

  • 'h': Left
  • 'j': Down
  • 'k': Up
  • 'l': Right

Text

  • 'e': Till end of word
  • 'E': End of word
  • 'B': Backward by word
  • 'b': Backward by word
  • 'W': Forward by word
  • 'w': Forward by word
  • '{': Beginning of previous paragraph
  • '}': Beginning of next paragraph
  • '[[': Beginning of previous section
  • ']]': Beginning of next section Missing (, ) Beginning, End of sentence

Lines

  • '0': Beginning of line
  • '^': First non-blank character of current line
  • '$': End of line Missing +, -. H, M, L

Searches

  • '|':

  • '/': Search forward

  • '?': Search backward

  • 'n': Repeat search in forward direction

  • 'N': Repeat search in oposite direction

  • 'f': Search forward for character in current line

  • 'F': Search backward for character in current line

  • 't': Search forward for character before x in current line

  • 'T': Search backward for character after x in current line

  • ';': Repeat previous current-line search

  • ',': Repeat previous current-line search in opposite direction

  • '%': Search for next matching special character

Uncategorized

  • TK_CTL('a'):
  • TK_CTL('h'):
  • 127:
  • ' ':
  • '`':
  • '@':

Ex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment