So, I installed kak-snippets and was relatively impressed after I modified the regex’s for the base language a bit(to allow for any amount of whitespaces proceeding the syntax) as well as trailing whitespace(so
donut_flag=false) doesn’t trigger expansion. this did have the issue of the inserted code not respecting indentation, but that could be solved by using lookbehind as opposed to
It kind of gave me an idea how much coding could be sped up simply by having a fairly exclusive set of snippets for the base language, and I had a bunch of ideas on how to improve on it but I was thinking I’d start from scratch, mainly because if I can make it something cross-editor then that means a larger userbase(and hopefully more contributors)
I’m still really new to kakoune, as well as trying to write code intended to be used by other people, and currently I’m still trying to wrap my head around the syntax. anyway here are my questions
How is the execution of plugins being handled? in the case of kak-snippets is this being executed only as called and the entire directory structure being reparsed on each call or is it keeping some buffer of relevant regexes in memory tied to that kakoune session?
as far as performance is concerned, is a directory style structure containing regexes the best approach to take or are there better solutions for snippets?
NOTE: I actually was planning on reusing this, but creating a tmp ram directory for storing snippets relevant to the current buffer, partially because disk reads, partially because the relevant snippets were likely to change at the users discretion. I mainly wanted to know if there was a better alternative.
is the buffer being passed to the plugin limited to the current line? mainly curious because ideally
else ifshould only be triggered if proceeded by
}\nand I would rather have both options for users who need to adhere to a particular convention.
Not just limited to kak but when is it generally acceptable to break from a standard convention, such as the one for
lsps or in this case snippets? While I plan for the majority of my snippets will adhere to the current standard convention, my current idea was to have a subset of them will have features not available within those constraints (such as attached commands to be executed, loading a different snippet directory into the current snippet buffer or generating values).
somewhat related but not entirely… is there a good way to edit a directory as if it were a file? renaming regex based directories is a major PIA