shell – Zsh zle shift选择
发布时间:2020-12-16 01:08:25 所属栏目:安全 来源:网络整理
导读:如何使用shift来选择命令行的一部分(就像许多文本编辑器一样)? shift-arrow() { ((REGION_ACTIVE)) || zle set-mark-command zle $1}shift-left() shift-arrow backward-charshift-right() shift-arrow forward-charshift-up() shift-arrow up-line-or-hist
如何使用shift来选择命令行的一部分(就像许多文本编辑器一样)?
shift-arrow() { ((REGION_ACTIVE)) || zle set-mark-command zle $1 } shift-left() shift-arrow backward-char shift-right() shift-arrow forward-char shift-up() shift-arrow up-line-or-history shift-down() shift-arrow down-line-or-history zle -N shift-left zle -N shift-right zle -N shift-up zle -N shift-down bindkey $terminfo[kLFT] shift-left bindkey $terminfo[kRIT] shift-right bindkey $terminfo[kri] shift-up bindkey $terminfo[kind] shift-down 这假设您的终端在Shift-Arrows上发送一个不同的转义序列来自Arrow发送的转发箭头,并且您的terminfo数据库已正确填充相应的kLFT和kRIT功能,并且您正在使用emacs样式键绑定. 或者,稍微分解代码: shift-arrow() { ((REGION_ACTIVE)) || zle set-mark-command zle $1 } for key kcap seq widget ( left LFT $'e[1;2D' backward-char right RIT $'e[1;2C' forward-char up ri $'e[1;2A' up-line-or-history down ind $'e[1;2B' down-line-or-history ) { functions[shift-$key]="shift-arrow $widget" zle -N shift-$key bindkey ${terminfo[k$kcap]-$seq} shift-$key } 上面是terminfo数据库没有信息的情况下的硬编码序列(使用xterm序列). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Bootstrap multiSelect 在页面POSTBack后不显示
- macos – 具有权限的文件夹树
- 如何使用angular-cli和webpack在angular2应用程序中导入xml
- vim – 通过病原体将标签生成到不同的位置
- angularjs – 我如何“拉出”我实际使用的十几个图标?
- dbca解决办法-bash: dbca: command not found
- Reactjs+BootStrap开发自制编程语言Monkey的编译器:创建简易
- macos – 为什么“echo $ – ”在man bash shell上输出“hi
- 在VIM中选择整行,不带新的行字符
- MEAN工程开发遇到的相关问题总结