Need help moving around

I’m learning Rust and an extra editor (after neovim) for fun. Compared to neovim, I have some trouble moving around.

I usually refer to the “normal mode commands” page:

In neovim, I use { and } to jump across paragraphs, which means empty lines in practice. Most people including myself use empty lines to separate classes, methods, functions etc. Vim also has motions like ]], ]M for end of method etc. I know both editors have “select a object you’re inside of” (alt-a and alt-i in kak) but I would like some more, like jump to next { object, next [ object, etc. Vim has a plugin for this (i haven’t tried yet).

In vim, I can press o in visual mode to jump to the opposite corner of the visual selection. What are the kakoune equivalents? How do I conveniently move screen with a large selection(s)? I can use v-key, but that’s not flexible for me - either a line or by pages. My code is not structured by pages.

1 Like

alt+;

]p - move one paragraph forward
[p - move one paragraph backwards

1 Like

I feel your pain a lot on this, using ]p [p feels very “bad” to me, so I have tried various things to fix it.

I’m surprised [p, ]p even work. The dialog box says it’s for surrounding object begin/end. How is next paragraph surrounding the current one?

Bonus points for keys being consistent between ]p, alt-i p, and alt-a p (same letter p, or x, always stands for the same thing).

However I think making the keys ][ select to next surrounding object begin/end is a waste of key. Just drop the “surrounding”. For surrounding there are already 2 other keys. How often do you need half a brace/text object, and ONLY if it’s a surrounding one?

Even then the old Street Fighter / Mortal Kombat wisdom remains. It’s easier/faster to press a combination of keys which your fingers can roll over than press the same/nearly the same key repeatedly. ]p is placed very inconveniently. You press it with weakest fingers of your right palm if it rests on the home row. }{ in vim is not consistent with a few other things, but I can spread the load across 2 palms.

In similar vein, I hate having to press alt-shift-w repeatedly to select several words for deleting. Here, I think vim’s approach… wins. vww(w)wwd is much easier on my fingers, and I can press it in the time it takes my left palm’s fingers to align on alt-shift-w. t, f (find in line) can’t always be used.

“surrounding” in this case means “surrounding the cursor”. If you’re in the middle of a paragraph and you hit ]p, the cursor moves to the end of the paragraph it’s in. It’s a bit weird for paragraphs specifically, since they can’t be nested, but the “surrounding” label is more relevant to (), [], {}, <> pairs. As you saw, the same options are available for movement, <a-i>, and <a-a>, which is convenient but means not all options are equally useful in all contexts.

As for selecting multiple words, if you’re using w in Vim, you can just use w in Kakoune. Kakoune’s <a-w> is Vim’s W, which can be faster in a punctuation-heavy context, but “to select several words for deleting” sounds like prose, so the speed advantage of <a-w> is probably cancelled out by the disadvantage of pressing Alt.