banacorn / agda-mode

agda-mode on Atom
https://atom.io/packages/agda-mode
MIT License
58 stars 14 forks source link

Custom unicode character codes #79

Closed junewunder closed 5 years ago

junewunder commented 5 years ago

Hey! Thank you for maintaining this package.

My team is using agda, and we have our own character codes for certain unicode characters. I'm wondering if you have any suggestions for how would be best for me to add custom character codes.

I notice you're using a Trie data structure so I wonder what you did you use to create your static trie file? I think a nice short term solution is for me to use my own trie created from our config.

Thank you!

banacorn commented 5 years ago

This is the repo where the trie was generated. It's written in Haskell. The source code looks bad, but it shouldn't be difficult to add your own characters.

After you have generated your own copy of the keymap, replacing the original one sitting in the package and reload everything should work!

banacorn commented 5 years ago

Seems like there's no need of modifying the code or anything. All you have to do is just drop your custom characters like this in assets/ and run the program to generate the new keymap! :D

junewunder commented 5 years ago

Thank you for helping! I'll look use this as the short term solution 😄

Would you be open to a PR that allows for overrides and generates a trie from a config given by the user? That would make make this functionality builtin.

banacorn commented 5 years ago

I think generating a trie from some config on site would be a bit too much for now, as I'm currently rewriting this project from TypeScript to Reason (OCaml).

But it's a good functionality to have, we shall leave this issue open until it's implemented.

In the meanwhile, perhaps allowing the user to custom the path to some generated trie in the config would be a good idea?

markokoleznik commented 5 years ago

Hey, a bit offtopic but I’m really curious... Is there any special reason why rewrite it in Reason (pun intended 😀)? Didn’t you already rewrite (at least part of the program) from CoffeeScript to TypeScript? 😂 Other than that, great job!

junewunder commented 5 years ago

@banacorn, I'll add a path to the trie in the config, that's a good temp solution until you finish the rewrite.

banacorn commented 5 years ago

@markokoleznik because I still get errors like Uncaught TypeError: undefined is not a function 💢, and then Reason caught my attention. Gosh I hate JavaScript (and TypeScript) so much.

banacorn commented 5 years ago

Voila

Extending keymap

junewunder commented 5 years ago

wow!! great work! this looks fantastic

junewunder commented 5 years ago

Hey has this feature been published yet? It seems to be in the changelog for the package but this is what my settings looks like for agda-mode:

image

banacorn commented 5 years ago

Gosh you are right, sorry I forgot to rebuild the distribution bundle so basically the v0.9.9 update is completely the same as v0.9.8 😅

banacorn commented 5 years ago

Please update to v0.9.10 and you should see something new 😅