从上一个命令输出中获取标识符、名称、路径、url和单词,并将它们用于xonsh中的下一个命令。
xontrib-output-search的Python项目详细描述
从上一个命令输出中获取标识符、名称、路径、url和单词,并将它们用于xonsh中的下一个命令。 在
Save time. Forget about using mouse, touchpad or trackball to get any words from output to the next command. | Secure. The xontrib-output-search is not writing any output on the hard disk. Only latest not empty output stored in the memory. It works the same way as xonsh shell and the security level is the same. | Universal. Forget about searching autocomplete plugins for every app you use and get the identifiers from the output. |
如果你喜欢这个主意,点击⭐ 在回购和保持密切关注发布。 在
安装
xpip install -U xontrib-output-search echo'xontrib load output_search' >> ~/.xonshrc # Reload xonsh
使用
在xontrib load output_search
之后,有两种方法可以从最新的非空输出中选择标记:
- 按Alt+F热键
- 键入
f__
,然后按Tab键
如果你用这个组合键完成另一个功能,而你的肌肉记忆很强,那就改变一下 前面的key combination 加载xontrib:
^{pr2}$用例
从输出获取URL
$ echo"Try https://github.com/xxh/xxh" Try https://github.com/xxh/xxh $ git clone xx<Alt+F> $ git clone https://github.com/xxh/xxh
从JSON、Python dict和JavaScript对象获取键或值
$ echo'{"Try": "xontrib-output-search"}'{"Try": "xontrib-output-search"} $ echo I should try se<Alt+F> $ echo I should try xontrib-output-search
从环境中获取路径
$ env | grep ^PATH=PATH=/one/two:/three/four $ ls fo<Alt+F> $ ls /three/four
完成复数前缀
键入git+
后从上一个输出获取URL:
$ echo"Try https://github.com/tokenizer/xontrib-output-search" Try https://github.com/tokenizer/xontrib-output-search $ pip install git+xo<Alt+F> $ pip install git+https://github.com/tokenizer/xontrib-output-search
键入URL时从上一个输出中获取端口号:
$ echo"The port number is 4242" The port number is 4242 $ curl http://127.0.0.1:4<Alt+F> $ curl http://127.0.0.1:4242
从命令帮助获取参数
$ lolcat -h
...
$ lolcat --s<Alt+F>
$ lolcat --seed=SEED
发展
xontrib输出搜索正在使用tokenize-output进行标记化。在
正在检查output_search
xontrib是否已加载:
$ xontrib list output_search
output_search installed loaded
$ completer list | grep output_search
xontrib_output_search
已知问题
cat file
未捕获(xonsh/issues/3744)
解决方法:cat file | head
或{
Alt+F组合在PyCharm终端中可能不起作用
解决方法:f__
+选项卡。在
readline中的Alt+F将向前移动
解决方法:在xontrib load output_search
之前设置$XONTRIB_OUTPUT_SEARCH_KEY='i'
。在
链接
- 这个包是ergopack-人体工程学xontribs包的一部分。在
- 此包是用xontrib cookiecutter template创建的。在
- 我的灵感来自xontrib-histcpy。谢谢@con-f-use!在
- 项目
标签: