[20241025]vim使用取词范围.txt

来源:这里教程网 时间:2026-03-03 20:44:16 作者:

[20241025]vim使用取词范围.txt --//事情的原因是由于执行写的zzdate用来查询当前时间,显示各种日期不同格式,方便以后的查询分析工作。 --//我做了一些修改缺省仅仅取第一部分。 $ zzdate trunc(sysdate)+15/24+24/1440+40/86400 --//但是如果鼠标双击,仅仅取其中一部分,如果3击取整行,但是带有回车符号,这不是我需要的。 --//总之要完整取全部内容,没有很快的方法实现拷贝和粘贴。 --//如果你的bash版本足够新可以在inputrc文件设置: Safe Pasting with Bracketed Paste If you copy commands from the web, you might have noticed that when you copy a newline, Bash will interpret that newline as an Enter and execute whatever it is in your input buffer at the moment. This is unsafe, because what you see might not be what you copy. You can be avoided by setting: set enable-bracketed-paste On This command puts an escape sequence around what you copy and paste, so Bash can tell the difference between what you, the user types and what you copied from somewhere. The default is Off. --//可惜我目前的版本不支持这个设置。 --//有点偏题了,再看看看vim的设置,实际上涉及vim的w取词的问题。 --//如果以上的输出直接按yw仅仅取一部分,涉及词如何分割的问题,这让我想起带小数点的数字 --//例如 99.111 ,实际上vim 按w分成3部分。我看了以前文档取决于iskeyword参数: --//我当前设置如下: :set iskeyword  iskeyword=@,48-57,_,128-167,224-235,. --//再追加+/(),就可以实现vim下鼠标双击取完整的内容了。 :set iskeyword+=.,+,/,),( --//测试完全通过!! 注如果重复执行以上命令设置就重复了。 set iskeyword=@,48-57,_,128-167,224-235,.,+,/,),( --//觉得加入/倒是一个不错的选择。这样选择目录时就能全部选上。

相关推荐