2017-09-24 8 views
0

cwを使用して単語を変更し、ciwを使用して内部単語を変更することができますが、私がしようとしているのは文字の後の単語を変更することです。vimで引用した後に単語を変更しますか?

は、例えば、私は私のカーソルが最初の引用符( ')である今、この

this.option('test'); 

を持っていると私は、単語テストを変更したいです。 cwを押すと、自分のカーソルが最初に表示されている引用符も削除されます。私はaモードを模倣するコマンドを探しています(カーソルの後ろに挿入されます)ので、私の場合はカーソルの後の単語を削除して挿入モードにしますか?

答えて

3

cwは、 "単語を変更"していないので、"次の単語に変更"です。

カーソルをシングルクォートのいずれかに置くと、ci'を使用して、 "シングルクォートの間で変更する"ことができます。最初の単一引用符にカーソルで

、あなたも行うことができます:

wciw   move to next word then change inner word 
wcw   move to next word then change to next word 
wct'   move to next word then change until next single quote 
wce   move to next word then change to end of the word 

lciw   move to next character then change inner word 
lcw   move to next character then change to next word 
lct'   move to next character then change until next single quote 
lce   move to next word then change to end of the word 

<Right>ciw move to next character then change inner word 
<Right>cw  move to next character then change to next word 
<Right>ct' move to next character then change until next single quote 
<Right>ce  move to next word then change to end of the word 

:help navigationを参照してください。

+0

修正と 'ci''コマンドのおかげで、これはまさに私が探していたものです! – supersan

0

あなたはテキストを削除します

ci' 

これを使用すると、変更を行うために挿入モードであなたを設定することができますよりも、カーソルが(")である場合。

'の内部に変更があります。

関連する問題