1

What is the fastest way to edit the content of braces in vim. I use the vimtex plugin.

I'm looking for a similiar way like 'cit' (change in tag) does for HTML editing.

For example:

\title{Some Title}   
\author{Example Name} 

My scenario: The cursor is somewhere in the line of \title. I want to delete 'Example Name' and get in insert mode inside of the braces as fast and easy as possible.

1
  • 2
    You might try ci{ or ci} -- both do what you want in MacVim
    – Thruston
    Oct 30, 2019 at 13:22

1 Answer 1

5

You need ci{ or ci} orciB. Vim has the notion of text-objects. From :he object-select

This is a series of commands that can only be used while in Visual mode or after an operator. The commands that start with "a" select "a"n object including white space, the commands starting with "i" select an "inner" object without white space, or just the white space. Thus the "inner" commands always select less text than the "a" commands.

These commands are not available when the +textobjects feature has been disabled at compile time. Also see gn and gN, operating on the last search pattern.

The commands include

  • w for word
  • W for WORD
  • s for sentence
  • p for paragraph
  • [ or ] for [] block
  • ( or ) or b for () block
  • < or > for <> block
  • t for tag block
  • { or } or B for {} block
  • " or ' or ` for quotes

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .