2017-01-17 4 views
3

に現在の括弧ブロックの終わりまで削除します。私のカーソルが"b": {}bであるはvimの

{ 
    "a": {"language": "python"}, 
    "b": {}, 
    "c": {"language": "java"}, 
    "d": {"encoding": "utf-16"} 
} 

私はこのJSONを編集していますと言います。現在の末尾まで削除したい{}ブロック。だから、それは、のようになります

{ 
    "a": {"language": "python"}, 
    " 
} 

少し奇妙に見えます。しかし、私が欲しいものを説明します。

どうすればVimで行うことができますか?

答えて

7

d]}を使用できます。 :help ]}から
:あなたの例のための

The above four commands can be used to go to the start or end of the current 
code block. It is like doing "%" on the '(', ')', '{' or '}' at the other 
end of the code block, but you can do this from anywhere in the code block. 
2

、あまりにも動作しますd]]

        *]}* 
]}   go to [count] next unmatched '}'. 
      |exclusive| motion. 

ヘルプも、これは運動のユースケースの一つであると述べています。押すのが簡単です。 { or }がどちらの列にあっても機能するため、]}がより優れています。