Skip to content

Instantly share code, notes, and snippets.

@jonschlinkert
Last active October 26, 2019 02:02
Show Gist options
  • Save jonschlinkert/a5284f250e98cfeb76edc8f223eb06ae to your computer and use it in GitHub Desktop.
Save jonschlinkert/a5284f250e98cfeb76edc8f223eb06ae to your computer and use it in GitHub Desktop.

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
or ctrl+b Move cursor back one character
or ctrl+f Move cursor forward one character
esc+b Move cursor back one word
esc+f Move cursor forward one word

Windows

command description
alt+b Move cursor back one word
alt+f Move cursor forward one word

Cut/paste

command description
ctrl+_ Undo
ctrl+c Cancel the current command
ctrl+k Cut everything after the cursor position
ctrl+w Cut a word to the left of the cursor position
ctrl+y Paste the last deleted command
ctrl+d Clear one character to the right of the cursor position. Or, when no input exists in the terminal,
ctrl+l Clear the entire terminal
ctrl+u Clear the current line
ctrl+x Toggle between first and cursor position

Windows

command description
alt+< Cut a word to the left of the cursor
alt+d Cut a word to the right of the cursor

Search/history

command description
ctrl+r Search for a command in history (type a search term)
ctrl+g Cancel the search and restore original line
ctrl+j End the search at current history entry
ctrl+n Get next command from history
ctrl+ Get next command from history
ctrl+p Get previous command from history
ctrl+ Get previous command from history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment