更聪明的传呼机
KitchenSink的Python项目详细描述
厨房水槽寻呼机是一种功能更强大的寻呼机,但它的主要功能是 向git diff添加每文件语法突出显示
安装
pip安装厨房水槽
示例
# use it for paging. sometimes, it can even figure out # the filetype and add syntax highlighting. (press 's') cat some_file.py | kk # Use it as a quick file jumper for grep results. # Press 'lf' to quickly view a file in the current buffer grep * -Rn my_string | kk # Use it as a git log viewer. # press 'lo' to [l]ist all git [o]bjects # press 'lf' to [list] [f]iles in the buffer git log | kk # it does git diff highlighting, too # press 's' to toggle highlighting git log --color -n1 -p | kk # if there are numbers in the buffer, # the kitchen sink math them with 'm' cat lots_of_numbers.txt | kk
屏幕截图
KitchenSink语法突出显示
Kitchensink语法突出显示与传统的Git Diff突出显示相比
更改语法颜色
如果语法着色样式不是您的样式或显示不好,您可以 通过设置KK U STYLE环境变量,使用任何pygments其他可用样式。
# listing the styles
python -c “import pygments.styles; print pygments.styles.STYLE_MAP.keys()”
# changing the style to vim. put this in .bashrc if you always want it
export KK_STYLE=vim
为什么要另一个传呼机?
为什么不呢?在管道输出上操作是我工作流程中速度较慢的部分之一。 这是为了让它更容易忍受。