bash設定vi為預設的編輯模式

來源:互聯網
上載者:User

bash設定vi為預設的編輯模式 編輯 /etc/inputrc 檔案,設定全域readline配置,加入以下指令:  www.2cto.com  # I like vi mode,設定預設的編輯模式為viset editing-mode vi # emacs mode settings,emacs模式配置指令$if mode=emacs # ... # vi mode settings,vi模式配置指令$else # Ctrl+l : clear screen ,清屏"\C-l": clear-screen  # Ctrl+p : previous-history,前一條曆史命令"\C-p": previous-history # Ctrl+n : next-history,後一條曆史命令"\C-n": next-history # Ctrl+e : press esc,ESC鍵,你懂的"\C-e": "\e" $endif 說明:/etc/inputrc 檔案是 libreadline 的全域設定檔,個人的設定檔為 ~/.inputrc   www.2cto.com  關於libreadline 的介紹如下:The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands. The history facilites are also placed into a separate library, the History library, as part of the build process. The History library may be used without Readline in applications which desire its capabilities. Readline is free software, distributed under the terms of the GNU General Public License, version 3. This means that if you want to use Readline in a program that you release or distribute to anyone, the program must be free software and have a GPL-compatible license. If you would like advice on making your license GPL-compatible, contact licensing@gnu.org. bash就是通過readline library 來提供命令列的方便快捷的編輯功能,包括各種用於命令編輯的快速鍵,命令曆史操作等功能。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.