Last active
June 6, 2020 09:44
-
-
Save IbanMM/c5fb365df7f001495e91b51f898b7403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Selection | |
yw - Copy word | |
yy - Copy current line | |
y$ - Copy from cursor to the end of the line | |
yG - Copy from cursor to the end of the file | |
dit - Remove all inside a html tag | |
yi" - Copy every thing inside quotes | |
# Navigation | |
G - Go to the end of the document | |
gg - Go to the start of the document | |
23gg - Go to line 23 | |
_ - Go to the first non blank character of the line | |
0 - Go to the start of the line | |
$ - Go to the end of the line | |
f - Go to the next matching character | |
F - Go to the previous matching character | |
; - Repeat | |
# Indentation | |
g=GG - Reindent the entire buffer | |
>> - Indent line by shiftwidth spaces | |
<< - De-indent line by shiftwidth spaces | |
5>> - Indent 5 lines | |
5== - Re-indent 5 lines | |
>% - Increase indent of a braced or bracketed block (place cursor on brace first) | |
=% - Reindent a braced or bracketed block (cursor on brace) | |
<% - Decrease indent of a braced or bracketed block (cursor on brace) | |
]p - Paste text, aligning indentation with surroundings | |
=i{ - Re-indent the 'inner block', i.e. the contents of the block | |
=a{ - Re-indent 'a block', i.e. block and containing braces | |
=2a{ - Re-indent '2 blocks', i.e. this block and containing block | |
>i{ - Increase inner block indent | |
<i{ - Decrease inner block indent | |
# Other shit | |
u - Undo | |
~ - Switch case | |
Alt+o - New empty line below | |
:w !sudo tee % - Save as sudo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment