Weekend fun. A small plugin for my daily use. #kak-todo

I decided to create a simple plugin for todo management.
link for the plugin, if someone finds it useful :stuck_out_tongue:

-------
Girish

2 Likes

That’s pretty cool, and a good example of how you can get something convenient and easy-to-use without writing much code.

Some suggestions, if you’re interested:

  • Rather than displaying an info box with keybindings every time the mode changes, you might consider adding a custom user mode instead, since the user can bring up those whenever they like instead of having to enter and exit insert mode to get the reminder back
  • Rather than using <esc> in an Insert mapping to get back to normal mode and i to re-enter insert mode, you might want to use <a-;> which adds a new temporary Normal mode to the stack that exits back to the previous Insert mode after a single command. This means you don’t lose the distinction between append and insert mode, you don’t fire any ModeChange mappings that depend on leaving Insert mode, etc.
  • Rather than clobbering the "z register to save and restore selections, you should use the -draft flag to execute-keys or evaluate-commands. Not only does it automatically save and restore selections without clobbering a user register, it keeps other things tidy too.

@alexherbo2, maybe these tips might be useful for that best-practices document you were talking about?

3 Likes

Welcome Girish ! Pretty cool plugin :slight_smile:

Thanks for the suggestions, using all three :slight_smile:

I was aware of <a-;> but didn’t knew about the stack part.

This is new info for me :slight_smile: