Fork me on GitHub
#vim
<
2022-12-29
>
fuad15:12:45

I’m looking for a convenient way to move across sibling forms. Consider the following code (where | is the cursor position):

(comment
 (|form1 abc
         def
         ghi
         jkl)
 (form2 foo bar)
 (form3 baz zaz))
I want to move to the beginning of form2 and from then to the beginning of form3 without having to repeat j . I looked up vim-sexp and it seems like none of the motions offered by it cover this particular case. Does anyone have a good solution for this?

3
Noah Bogart15:12:55

Using vim-sexp-for-regular-humans or whatever that tpope plugin is called, i would use “(“ to move up to the surrounding paren, then “W” to move to the next-by-current-list element, then “w” to move to the next-by-word-boundary element.

clojure-spin 2
fuad16:12:26

ah! this is gold, thanks!

fuad16:12:46

I tried using the <M-b> and <M-w> mappings from vim-sexp originally and they didn’t work but that’s because my meta key was not set properly. Regardless, W makes a lot more sense to me

👍 1