You probably don't need x and X altogether

During my use of kakoune I had been remapping x many times. Sometimes to X other times to <a-x>. But recently I came to conclusion that core x and X primitives are redundant. Having said that here is my final mapping I use every day:

map global normal v <a-x>
map global normal <a-v> <a-X>

# not necessary, remap v where do you like
map global normal q v
map global normal Q V

# map x and X to something useful

To select two or more lines with default bindings there is need to engage xX..
With my suggested mappings J..v or K..v, i.e. to select 3 lines down I would press JJv or 2Jv.

PS: all mappings are meant to be applied to qwerty layout.

1 Like

I don’t use the view mode too, but I’ve utilized it for object selection since I find the default <a-i> and <a-a> cumbersome to use… and it sort of rings with Vim’s visual mode for me.

# repurpose visual mode keys for object selection
map global normal <a-v>     'v'
map global normal <a-V>     'V'
map global normal v         '<a-i>'
map global normal V         '<a-a>'

for x, i’ve just remapped it to do <a-x> instead.

4 Likes

I still use x to select the current line (I don’t use it to select lines down), but I remapped X to be “inner line”:

map global normal X "giGl"

It’s very useful.

I then mapped J and K to select entire lines, since I almost never want to select partial lines down:

# Always select entire lines
map global normal J "J<a-x>"
map global normal K "K<a-x>"
6 Likes