Insert mode mappings that emulate Readline

I wasn’t happy with the Readline mappings from kakoune-extra, and I wanted them as a separate ‘plugin’ so I rewrote them myself. They’re still not perfect – for example word boundaries are not always consistent with Readline’s behaviour – but my muscle memory is quite pleased with the result. If, like me, you feel as if your hands are tied without line-editing shortcuts, then you might like it too.

I’m relatively new to configuring Kakoune, so if anyone has a better solution for any of these mappings, do comment below or make a pull request :slight_smile:


1 Like

Why are you putting tabs in the file, just before -docstring?

Alt + Tab is for people who have mapped Tab to something else? If that’s the case, maybe tabs should be inserted with hooks disabled or with Control + v, Tab.

No reason, really. I’ll change them to spaces.

Well, the goal is to emulate Readline as closely as possible, and Alt+Tab in Readline is tab-insert. Readline uses Tab for complete, but I wasn’t sure how best to implement that. Perhaps map global insert <tab> <c-n>? Or <c-p>? Either way it’s not quite the same. I haven’t looked into it all that much.

I’m not sure what you mean … could you explain?

Remapping Tab is too intrusive imo.

Check space-indent.kak to see your Alt + Tab will not produce a tab character with it.

Fixed (I think):

	map global insert <a-tab> '<a-;>: execute-keys <lt>tab<gt><ret>' -docstring tab-insert
1 Like

An Alt + \ command to disable hooks could be nice to add.

Would look like:

map global insert <a-tab> <a-\><tab>