Loading ...
Sorry, an error occurred while loading the content.
 

Re: Jump to next unmatched square brackets?

Expand Messages
  • Yegappan Lakshmanan
    ... Another method is to use the searchpair() function: ... - Yegappan
    Message 1 of 4 , Oct 31, 2006
      On 10/31/06, Yegappan Lakshmanan <yegappanl@...> wrote:
      > Hi Tim,
      >
      > On 10/31/06, Tim Chase <vim@...> wrote:
      > > I occasionally use the
      > >
      > > ])
      > > ]}
      > > [{
      > > [(
      > >
      > > family of commands to jump to the associated unmatched
      > > paren/brace. However, I haven't found any such functionality for
      > > square brackets. Have I just overlooked something? I know that
      > > the "]]" command goes to the next code-block, so the command I
      > > would normally guess is already taken. Is there something
      > > similar for square brackets that I've missed? Or some way to
      > > compose such a command easily?
      > >
      >
      > You can try using the following command (it is a workaround)
      >
      > To jump to the inner-most unclosed '[':
      >
      > va[o<Esc>
      >
      > To jump to the inner-most unclosed ']':
      >
      > va]<Esc>
      >

      Another method is to use the searchpair() function:

      To jump to the inner-most unclosed '[':

      :call searchpair('\[', '', '\]', 'bW')

      To jump to the inner-most unclosed ']':

      :call searchpair('\[', '', '\]', 'W')

      - Yegappan
    Your message has been successfully submitted and would be delivered to recipients shortly.