2016-05-12 102 views
0

我已經在我的~/.inputrc如下:自定義〜/ .inputrc定義不正確?

set input-meta on 
set output-meta on 
set convert-meta off 

# To use these in ITerm2 you may also need to configure preferences to send the correct escape 
# code for the key combination. 

# Option + Arrows to jump words. 
"\e[1;5C": forward-word 
"\e[1;5D": backward-word 


# The following are other escape sequences that can be configured in Iterm2 preferences. 
#  ESC ^H Delete previous word (backspace key) [n] 
#  ESC DEL Delete previous word (delete key) [n] 
#  ESC SP Set the mark (space key); see ^X^X and ^Y above 
#  ESC . Get the last (or [n]'th) word from previous line 
#  ESC ? Show possible completions; see below 
#  ESC < Move to start of history 
#  ESC > Move to end of history 
#  ESC b Move backward a word [n] 
#  ESC d Delete word under cursor [n] 
#  ESC f Move forward a word [n] 
#  ESC l Make word lowercase [n] 
#  ESC u Make word uppercase [n] 
#  ESC y Yank back last killed text 
#  ESC v Show library version 
#  ESC w Make area up to mark yankable 
#  ESC nn Set repeat count to the number nn 
#  ESC C Read from environment variable ``_C_'', where C is 
#     an uppercase letter 

然而,當我源,這是發生了什麼:

me (~/Desktop) $ . ~/.inputrc 
-bash: \e[1;5C:: command not found 
-bash: \e[1;5D:: command not found 

是怎麼回事?

編輯:另外上iTerm2

回答

0

.inputrc不是外殼腳本;它是一個由Readline庫使用的配置文件,bash使用該配置文件。 X控制 - - [R(默認爲re-read-init-file的ReadLine功能綁定),使用通過鍵入控制可以重新讀取該文件。

把鍵綁定在.inputrc的好處是,這個文件是由讀取使用的ReadLine,而不僅僅是bash任何程序。您可以使用bind命令將綁定放入您的.bashrc中。

bind '"\e[1;5C": forward-word' 

(當然,這樣的綁定將bash可用。)

相關問題