2012-10-16 126 views
3

通常在我的機器上,我可以向後搜索R的歷史記錄,方法是輸入想要向後搜索的命令的所需首字符,然後使用PageUp或PageDown鍵遍歷R中的所有條目歷史。歷史向後搜索R

我現在在遠程集羣中作爲來賓工作,並且此選項在本機中不可用。

有沒有人有我可以在哪裏添加此功能的R的想法?

編輯:我感興趣的關鍵綁定,而不是如何重現此功能。

編輯2:我在Fedora 16機器上本地化;遠程CentOS版本5.3(最終)

+0

更具體的問題請問......你通常與什麼環境/ IDE交互,以及它是什麼作爲遠程訪客? – Thell

+0

對不起,謝謝你的評論。夠了嗎?或者其他類型的信息有用嗎? – pedrosaurio

回答

2

我發現在哪裏看,以告訴R如何表現。

關鍵是修改我的〜/ .inputrc文件,因爲它是R的輸入法的參考。

我從我的本地Fedora 16/etc/inputrc中使用了相同的文件,並將其作爲〜/ .inputrc複製到遠程羣集中。該文件看起來像這樣

# do not bell on tab-completion 
#set bell-style none 

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

# Completed names which are symbolic links to 
# directories have a slash appended. 
set mark-symlinked-directories on 

$if mode=emacs 

# for linux console and RH/Debian xterm 
"\e[1~": beginning-of-line 
"\e[4~": end-of-line 
# commented out keymappings for pgup/pgdown to reach begin/end of history 
#"\e[5~": beginning-of-history 
#"\e[6~": end-of-history 
"\e[5~": history-search-backward 
"\e[6~": history-search-forward 
"\e[3~": delete-char 
"\e[2~": quoted-insert 
"\e[5C": forward-word 
"\e[5D": backward-word 
"\e[1;5C": forward-word 
"\e[1;5D": backward-word 

# for rxvt 
"\e[8~": end-of-line 
"\eOc": forward-word 
"\eOd": backward-word 

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm 
"\eOH": beginning-of-line 
"\eOF": end-of-line 

# for freebsd console 
"\e[H": beginning-of-line 
"\e[F": end-of-line 
$endif 

"\e[5~": history-search-backward 
"\e[6~": history-search-forward 
1
history(pattern="lm\\(") # finds lines with lm or glm calls 

有各種各樣的歷史機制,它可能是你的控制檯看也不會是相同的,因爲這其中的歷史的通話將被訪問。閱讀「歷史記錄」頁面的「詳細信息」部分。