A simple project switcher for Kakoune

22 points by bhoot a day ago on lobsters | 5 comments

ficd | a day ago

Very nice! I have a couple suggestions. First, instead of hardcoding ~/.config/kak, I recommend using $kak_config which guarantees you'll use the same directory that Kakoune itself resolved. Second, I'd recommend creating an option like declare-option str projects_dir %val{config}, so the user can optionally change where this information is stored (personally I don't like to have stuff like this in my config dir).

jmtd | a day ago

Lovely. I like a well-scoped, tidy solution. Two things that jumped out at me: duplicate projects; de-registering projects. For the latter I’d probably say it’s infrequent enough to just do by hand.

[OP] bhoot | a day ago

Thank you! I talk about de-registering projects as a potential :delete-project command at the end of my post. But, for now, my inclination is to edit the projects file manually, like you suggest.


To remove duplicates, my instinct is to not bother with updating the projects file, but to filter out duplicates from the completion interface instead. I updated in my kakrc:

complete-command project-pick \
  shell-script-candidates \
  %{ cat ~/.config/kak/projects }

to

complete-command project-pick \
  shell-script-candidates \
  %{ cat ~/.config/kak/projects | sort | uniq }

which works nicely.

[OP] bhoot | a day ago

I forgot to add a small video snippet to showcase the final result. Will do that (and also revise the post - I basically published the first draft to get it out) after I'm back home.

[OP] bhoot | a day ago