2009-06-23 5 views
1

の行全体をヤンクしたとき、Vimは改行文字のためにヤンクしたテキストを入れるために新しい行を作成します。しかし、もし私がラインの一部をヤンクしたら、そのラインにヤンクしたテキストを置く方法がありますか?現在行っていますoESCpです。これが唯一の方法ですか?ここでVimにo-<esc> -pと同等の機能がありますか?

答えて

8

はVimのヘルプからあなたの答えです:あなたは常にあなたの中にいる間、レジスタから貼り付けることができますよう

:[line]pu[t] [x]  Put the text [from register x] after [line] (default 
         current line). This always works |linewise|, thus 
         this command can be used to put a yanked block as new 
         lines. 
         The cursor is left on the first non-blank in the last 
         new line. 
         The register can also be '=' followed by an optional 
         expression. The expression continues until the end of 
         the command. You need to escape the '|' and '"' 
         characters to prevent them from terminating the 
         command. Example: > 
           :put ='path' . \",/test\" 
<      If there is no expression after '=', Vim uses the 
         previous expression. You can see it with ":dis =". 

:[line]pu[t]! [x]  Put the text [from register x] before [line] (default 
         current line). 

しかしコロン-PU-入力するには、(CR)0 oをよりキーストロークとにかく=/

+0

良い答えです。頻繁に使用された場合、キーストロークを削減する別のキーシーケンスに確実にバインドすることができます。 –

+0

キーストロークが多いにもかかわらず、通常は少なくとも節約時間の出現を示す挿入モードの出入りを節約します(ESCの場合)。 –

6

Theresのです挿入モードのままにしておきたい場合にのみ使用します。

+0

その答えかどうか、それはフリークインクールです – bfabry

関連する問題