2009-04-20 19 views
16

私は特定のvimセッションのために:コマンド履歴がどこに格納されているか知りたいと思う。スクロールして履歴を検索することができます。私の目的は、試行錯誤して実行したコマンドの一部を取り出し、vimソースファイルを作成することです。:コマンド履歴はどこに保存されていますか?

答えて

15

は、それは、vimのhelpコマンドから$ HOME/.viminfo

に格納されています。

The viminfo file is used to store: 
- The command line history. 
- The search string history. 
- The input-line history. 
- Contents of registers. 
- Marks for several files. 
- File marks, pointing to locations in files. 
- Last search/substitute pattern (for 'n' and '&'). 
- The buffer list. 
- Global variables. 
+0

私が探していたことはありがたいことに感謝します...私はvimのインストールディレクトリでそれを探していました – xshyamx

1

それは.viminfoファイルにあります(またはWindows上である場合_viminfo)。それは、あなたのホームディレクトリに渡すものでなければなりません。

2

機能histget(),histadd()およびhistdel()を探しています。

EDIT:viminfoファイルには、あなたの質問を策定した方法に従って、あなたがすでに認識していたと思われるいくつかのセッションの履歴データが含まれます。あなたはこの窓の周りに移動し、同じようにコピーすることができます。また、q:または:<CTRL-F>コマンド

OPEN 

There are two ways to open the command-line window: 
1. From Command-line mode, use the key specified with the 'cedit' option. 
    The default is CTRL-F when 'compatible' is not set. 
2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?* 
    This starts editing an Ex command-line ("q:") or search string ("q/" or 
    "q?"). Note that this is not possible while recording is in progress (the 
    "q" stops recording then). 

When the window opens it is filled with the command-line history. The last 
line contains the command as typed so far. The left column will show a 
character that indicates the type of command-line being edited, see 
|cmdwin-char|. 

を使ってミニバッファで最近のコマンド履歴を開くことができます:-)

1
:h viminfo-file-name 

HTH通常のバッファコマンドの上で<Enter>を押すとそれが実行されます。

関連する問題