@andreyorst how about your Mapping sequence of keys in insert mode to trigger kak’s register → execute-keys → snippets.
With snippets being the work of the below.
Would this work Andrey??
Mate, I had no idea. Thank you for the info.
So here is where I’m at and currently stuck. As my kakoune register skills need improvement.
The sequence of events are:
- activate snippet trigger on .keyword
- escape to normal mode
- extend to previous . inclusive
- delete
- select to previous word start
- save to register
- delete selected text
- do snippet
- paste saved register into first tabstop position
- if next tabstop then advance
- else advance to end of line
- enter insert mode
- end sequence
Main.class<esc><a-f>.db"0y
do snippet
<c-r>0 paste saved register into first slot
<tab> advance onto next tab position
where *.class snippets is:
class ${1:Name} {
${0:// body}
}
If I can get one going then I’m off and running to postfix glory . Grateful for any help guys. Bye
I’m thinking that wrapping the snippets function will allow a way to define a subset of snippets as a trigger and or alternate sequence of execute-keys on a subset of those snippets.
define-command postfix-snippets-wrap %{
execute-keys '<a-t>."syHdb"kyc'
execute-keys '<a-;>: snippets-expand-or-jump %val{main_reg_s}'
execute-keys '<a-;>d<c-r>k'
execute-keys '<tab><a-;>d'
}
To be continued…
How are your travels going with the tangent @robertmeta?