isovector / cornelis

agda-mode for neovim
BSD 3-Clause "New" or "Revised" License
130 stars 22 forks source link

Provide snippets for unicode selection #108

Closed 4e554c4c closed 1 year ago

4e554c4c commented 1 year ago

it would be nice to have a plugin-independent way to get insert-mode bindings for agda. For example, I use https://github.com/L3MON4D3/LuaSnip which allows for importing vscode-like or SnipMate-like shortcuts, or can be configured in lua.

isovector commented 1 year ago

What do you have in mind? It's not immediately clear to me how insert-mode bindings would tie into a snippet. Perhaps cornelis#bind_input could invoke a callback for being tied into any other system?

4e554c4c commented 1 year ago

snippets don't need to contain additional cursor locations, or even "expand" text. They can just be mappings like \n to to see an example, here are my snippets in the vscode style for lean: https://git.sr.ht/~pounce/dotfiles/tree/main/item/private_dot_config/nvim/snippets

the benefit of non defining how input-mode text is expanded in cornelis is that users would be able to integrate it with their own completion engine, such as nvim-cmp.

isovector commented 1 year ago

Sorry for being dense, but I don't know what a resolution to this issue would look like. Could you walk me through, in excruciating detail, what you'd like cornelis to do (or not do)?

4e554c4c commented 1 year ago

Yes, sorry. Being able to hook cornelis#bind_input would be fine, I think.

isovector commented 1 year ago

Implemented in 10984fbc48fc3a8825e835e42eeef21c787a60a2.