在bash中更改单词定界符

编程入门 行业动态 更新时间:2024-10-10 08:21:04
本文介绍了在bash中更改单词定界符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想更改bash(或readline)用于分隔单词的定界符.具体来说,我想使'-'不分隔单词,以便如果我有文字

I want to change the delimiters bash (or readline) uses to separate words. Specifically I want to make '-' not delimit words, so that if I have the text

ls some-file

,然后按 Alt-Backspace ,它会删除整个 some-file 文本,而不仅仅是删除'-' char.这也将导致长标记的删除,例如-group-directories-first 更快,更轻松,只需按一次键即可.

and I press Alt-Backspace it deletes the entire some-file text and not just up to the '-' char. This will also cause deletions of long flags like --group-directories-first faster and easier, needing only one key-press.

我相信这是zsh的行为方式,我希望使bash行为相同.

I believe that this is how zsh behaves and I'd like to make bash behave in the same way.

推荐答案

ctrl-w确实可以满足您的要求.

ctrl-w does exactly what you want.

更多推荐

在bash中更改单词定界符

本文发布于:2023-11-13 02:33:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583180.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单词   定界   bash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!