:%le
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
mv !(fileOne) ~/path/newFolder |
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
:se nonu |
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
Shift + V for visual line to select the lines in visual mode | |
If all that is wanted is to display the name of the current file, type Ctrl-G (or press 1 then Ctrl-G for the full path). |
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
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' | |
The first line changes the bash prompt to be colorized, and rearranges the prompt to be “username@hostname:cwd $” | |
The next two lines enable command line colors, and define colors for the ‘ls’ command | |
Finally, we alias ls to include a few flags by default. -G colorizes output, -h makes sizes human readable, and -F throws a / after a directory, * after an executable, and a @ after a symlink, making it easier to quickly identify things in directory listings. |
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
show ith of a: a & 1 << i | |
reset ith of a: a &= ~(1 << i) | |
populate the result: result |= 1 << i | |
(-i) & i; //NOTE from right to left, get first '1' and other bits is '0' | |
n & (n - 1) == 0 check if n is power of 2 |
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
1. git log -1 --stat |
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
1. Type gg to move the cursor to the first line of the file, if it is not already there. | |
2. Type dG to delete all the lines. |
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
Up Ctrl+P | |
Down Ctrl+N | |
Left Ctrl+B | |
Right Ctrl+F | |
Home Ctrl+A | |
End Ctrl+E | |
Delete Ctrl+D | |
Search Ctrl+R |
NewerOlder