从上一个命令输出中获取标识符、名称、路径、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_searchxontrib是否已加载:

$ 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'。在

链接

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用Spring和JSF向客户端授予临时权限   java除了Array/ArrayList之外,还有其他保存矩阵元素的方法吗   java BeanValidation不适用于单选按钮   通过java程序连接到配置单元数据库时出错   java如何使用maven解决二级依赖关系   JfreeChart/Java中带有图例的数据表   合并数组时发生java运行时错误   安全性如何在JavaEE中保护WebSocket端点?   java有没有一种方法可以使用insert方法为树插入值   java编程“静态”的另一种方式:代码可以吗?   java阅读文本文件时如何跳过3行   %04X在C中的含义以及如何在java中编写   java我如何验证一个方法不是仅在一个测试范围内对模拟调用的?   java如何在mac中使用启动appium desktop 1.6.1。球棒   仅匹配最多10位小数的java正则表达式