vim

fuad 2022-12-29T15:32:45.712219Z

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?

✅ 2
2022-12-29T15:56:55.606209Z

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.

1
fuad 2022-12-29T16:02:26.039299Z

ah! this is gold, thanks!

fuad 2022-12-29T16:03:01.271739Z

for reference: https://github.com/tpope/vim-sexp-mappings-for-regular-people#motion-mappings

👍 1
👍🏻 1
fuad 2022-12-29T16:06:46.438489Z

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