- maim
- xclip
Set this on your i3 config file ~/.i3/config
# Screenshots
| function mc | |
| set SHELL_PID %self | |
| set MC_PWD_FILE "/tmp/mc-$USER/mc.pwd.$SHELL_PID" | |
| /usr/bin/mc -P $MC_PWD_FILE $argv | |
| if test -r $MC_PWD_FILE | |
| set MC_PWD (cat $MC_PWD_FILE) | |
| if test -n "$MC_PWD" |
Normally git diff would color additions green and deletions red. This is cool, but it would be even cooler if it adds syntax highlighting to those lines. This is a git pager that does so.
It parses the diff output and picks up the SHAs of files with additions and deletions. It uses [CodeRay][coderay] to highlight each file and then it extracts the lines that are shown in the diff. It then uses [term/ansicolor][color] to make a gradient from the CodeRay color and the diff color (red for deletion, green for addition) and uses it to replace the original.
I tried using rugged instead of shelling out to git show – it was faster overall, but it did incur a noticeable start up time.
Check out the image below for a demo.
| banner | |
| ### ### | |
| # # # # # ###### ## #### #### # # ### | |
| # # # # # # # # # # # # # ### | |
| # # # #### ##### # # #### # # # # | |
| # # # # # # ###### # # # # | |
| # # # # # # # # # # # # # # ### | |
| ### ###### # # # ###### # # #### #### # # ### | |
| # GNU Screen - main configuration file | |
| # All other .screenrc files will source this file to inherit settings. | |
| # Author: Christian Wills - [email protected] | |
| # Allow bold colors - necessary for some reason | |
| attrcolor b ".I" | |
| # Tell screen how to set colors. AB = background, AF=foreground | |
| termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' |