Number-toggle.kak - Toggles between relative and absolute line numbers automatically based on the current mode

Just wanted to share my first Kakoune plugin here on the forum, since there’s more people on here than the subreddit. I’m just starting to make my switch from Vim to Kakoune, so please feel free to leave any constructive criticism or other feedback.

The plugin is essentially a reimplementation of similar line number toggle plugins from Vim, in Kakoune. It toggles between relative and absolute line numbers automatically based on the current mode. Absolute line numbers are displayed in insert mode, and relative line numbers are displayed in all other modes.

2 Likes

How about renaming the plugin to a more explicit and general name number-lines.kak and provide number-lines-toggle / number-lines-cycle commands?

I don’t see how number-lines.kak is more explicit name. It’s confusing to me, and makes me think that Kakoune do not support line numbers without such plugin. number-lines-toggle.kak is a more appropriate IMO.

It matches the name of the highlighter. Maybe adding highlighter in the name.

and exactly because of the fact that such highlighter already present it is confusing. Am I wrong? number-lines-toggle.kak also matches the highlighter name, and extends the meaning with an action that will be performed.

I’m open to changing the name if the current one isn’t good or someone thinks of a much better one. I went with number-toggle.kak because it’s similar to vim-numbertoggle.