簡體   English   中英

VIM:命令行模式下的單詞補全?

[英]VIM : word completion in command-line mode?

在命令行模式下在緩沖區中用另一個單詞替換一個單詞時, :%s/verylongword/newword/g ,有沒有辦法從緩沖區的內容中以某種方式完成“verylongword”?

如果做不到這一點,是否可以在鍵入:%s/verylongword/newword/g時從緩沖區復制粘貼“verylongword”?

命令行窗口

鍵入命令時按Ctrl F打開命令行窗口,請參閱:h c_CTRL-f

在命令行窗口中,您可以使用所有常用的 vim 命令來編輯命令行。


從寄存器粘貼

要在命令行模式下從緩沖區粘貼,請按Ctrl R后跟寄存器名稱。

例如,按Ctrl R 0從寄存器0粘貼以粘貼上次拉出的文本。

有關更多信息,請參閱:h c_CTRL-R


光標下的對象

Ctrl R還允許以下補全(引用自 vim 幫助):

CTRL-R CTRL-F                           c_CTRL-R_CTRL-F c_<C-R>_<C-F>
CTRL-R CTRL-P                           c_CTRL-R_CTRL-P c_<C-R>_<C-P>
CTRL-R CTRL-W                           c_CTRL-R_CTRL-W c_<C-R>_<C-W>
CTRL-R CTRL-A                           c_CTRL-R_CTRL-A c_<C-R>_<C-A>
                Insert the object under the cursor:
                        CTRL-F  the Filename under the cursor
                        CTRL-P  the Filename under the cursor, expanded with
                                'path' as in gf
                        CTRL-W  the Word under the cursor
                        CTRL-A  the WORD under the cursor; see WORD

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM