-
Notifications
You must be signed in to change notification settings - Fork 21
Title IDs #10
Comments
This affects |
Also see |
I’m finding myself always renaming files with UID file names to something that reflects the note’s topic, usual skewer-cased. Realistically this means I don’t use Would a config option to use skewer-case suffixed with a UID be possible? Something like “and then, an aeroplane” would generate |
Yes, that is possible, but what happens if someone else comes here tomorrow and ask for a different algorithm? Maybe I should allow you to specify your own name function on your .vimrc? |
That would definitely work for me—it seems like a good balance for the project too. |
I’m happy to attempt this, but I haven’t worked with Vimscript before, so it may not be fast or the cleanest code. Would you like me to try, or would you prefer to handle this yourself? |
I ended up doing it. This was quite weird. I also have no experience with VimScript and had never seen any Vim plugin expose a function like that. Maybe there is something wrong with it but it seems to work fine. I added a note here with some brief usage information: https://github.com/fiatjaf/neuron.vim#customization Please let me know how that works for you. |
Thanks for that--I'm testing it out, and it's working great. The only issue is that on loading vim, I get errors about duplicated bareword definitions, when I'm overriding the function. (I'm running Neovim 0.4.3 if it matters) Would you be open to a PR that changed the function! g:GenerateNeuronID(title)
if exists('*g:CustomNeuronIDGenerator')
return g:CustomNeuronIDGenerator(title)
else
# existing default implementation
endfunction (PR would also update documentation) It seems like it'd be safer for the project if people aren't overriding a probably important function, and the plugin is in control of when (and whether, in case something big changes) the custom generator is called. It also makes things cleaner for users, without the errors. Edit:Looking closer at the code, seems like we might be able to get away with just updating the assignment to |
Yes, I think your suggested changes make sense. |
[[Some note, with puctuation]]
is now a valid link in neuron.cf.
The text was updated successfully, but these errors were encountered: