inputrc 文件的作用是告知系统应该以怎样的键盘布局处理键盘。此文件对于 readline(readline: GNU readline library,和输入紧密相关的库)或者是一些 shell (例如 bash 等)来说十分重要。
对于大部分用户来说,都不使用那些奇奇怪怪的键盘映射,所以,可以通过以下的命令建立一个全局的 /etc/inputrc 以供所有用户使用。如果需要更改某一个用户的键盘映射,仅需要在那个用户的 HOME 目录下建立一个 .inputrc 文件,然后修改对应的键盘映射就可以了。
下面显示的就是通用的 inputrc 文件,其中包含有 “#” 的都是注释行(需要注意的是,此文件不支持在设置后跟随注释)。
使用以下命令创建此文件:
cat > /etc/inputrc << "EOF" # Begin /etc/inputrc # Modified by Chris Lynn <roryo@roryo.dynup.net> # Allow the command prompt to wrap to the next line set horizontal-scroll-mode Off # Enable 8bit input set meta-flag On set input-meta On # Turns off 8th bit stripping set convert-meta Off # Keep the 8th bit for display set output-meta On # none, visible or audible set bell-style none # All of the following map the escape sequence of the value # contained in the 1st argument to the readline specific functions "\eOd": backward-word "\eOc": forward-word # for linux console "\e[1~": beginning-of-line "\e[4~": end-of-line "\e[5~": beginning-of-history "\e[6~": end-of-history "\e[3~": delete-char "\e[2~": quoted-insert # for xterm "\eOH": beginning-of-line "\eOF": end-of-line # for Konsole "\e[H": beginning-of-line "\e[F": end-of-line # End /etc/inputrc EOF
本次分享到此结束啦~
如果觉得文章对你有帮助,点赞、收藏、关注、评论,一键四连支持,你的支持就是我创作最大的动力。
❤️ 技术交流可以 关注公众号:Lucifer三思而后行 ❤️
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。