Skip to content

Instantly share code, notes, and snippets.

@kranrao
Last active October 20, 2024 00:35
Show Gist options
  • Save kranrao/a7245ceec19a686c6aee to your computer and use it in GitHub Desktop.
Save kranrao/a7245ceec19a686c6aee to your computer and use it in GitHub Desktop.
Keyboard shortcuts
///// Terminal /////
ls - list of files in directory
ls -a - list of *all files in directory
cd - move into directory
ls -a subl .bash_profile - terminal shortcut editor
mkdir [dir name] - make new directory
touch [file name] - make new file
mv [file name] [new file name] - changes file name
cp [file name] - copies file or directory
rm [file name] - removes file or directory
rm -rf [file name] - removes everything*
subl - shortcut to open in sublime text
open - open file
Tab - autocomplete
Up - scroll through previous commands
ALIASES
git st - shortcut git status
git ci - shortcut git commit
git co - shortcut git checkout
git hist - shortcut for formatted git log
prof - open bash profile
reprof - save changes to bash profile
hr - navigate to HR curriculum folder
oc - open in Google Chrome
gb - git branch
gs - git status
ga - git add
gc - git commit
gl - git log
glo - git log --pretty=oneline
glu - git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
go - git checkout
gt - git tag
grs - git reset
grv - git revert
gm - git merge
gpom - git push origin master
gpum - git pull origin master
gd - git diff
grb - git rebase
gpo - git push origin
gob - git checkout -b
TEMPLATES
yo test - uses Yeoman to create testing suite in new directory
///// Sublime Text /////
Command W - close file
Command N - new file
Command P - open file
Command F - find
Command Shift F - massive find
Command Option Up or Down - moves blocks of code up or down
Command Option Left or Right - move through open tabs
Command Option / - comments out block of code
Command K Command B - hide/show navbar
Command Enter - new line from within previous line
Command Shift Enter - new line above previous line
Command Shift D - copy current line below
Command D - creates multiple cursors
Command Shift K - delete entire line
Command Shift F - search all files in a project
Command Shift P - search for file within project
Command C - copy block of code
Command X - cut and copy block of code
Command V - paste block of code
Command Shift V - paste block of code with proper indentation
Command [ - indent block of code left
Command ] - indent block of code right
Command Left or Right - move to left or rightmost in line of code
Shift Command Left or Right - same as above, but select all
Option Left or Right - move left or right, one character block at a time
Shift Option Left of Right - same as above, but select all
Copy Command D - highlight same instances of word
Copy Command K - unhighlight same instances of word
Copy Command K Command U - uppercase selection
Copy Command K Command L - lowercase selection
Command Ctrl F - toggle fullscreen
Command Ctrl Shift F - toggle distraction free
Command Option [number] - split screen
Control Shift [number] - move current file to pane
FN Delete - delete forward
Command Mouseclick - create multiple mouse cursors
///// Mac /////
FN Up of Down - page up or down
Command Space - open spotlight
Command Tab - switch through open applications
Command Option H - hide all other open applications
Command Option M - minimize current application
Command ' - switch between instances of the same appication
Command Shift / - search menu bar for shortcuts
FN Control F2 - access to menu bar
///// Chrome /////
Command T - new tab
Command W - close tab
Command N - new window
Command L - highlight address bar
Command R - refresh page
Command Shift N - new incognito window
Command Shift T - open last closed tab
Command 1 - 9 - jump to first or a later tab
Command Option Left or Right - move through open tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment