Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: auto-replace a given character or string #2887

Open
dei-layborer opened this issue Aug 7, 2023 · 2 comments
Open

Feature Request: auto-replace a given character or string #2887

dei-layborer opened this issue Aug 7, 2023 · 2 comments

Comments

@dei-layborer
Copy link

A feature I'd love to see in micro is the ability to do "auto-replace" of arbitrary characters or strings. For example, having (c) in a file be replaced with ©, or being able to set an abbreviation that then gets expanded out into a full word. It'd be nice to also be able to do some additional replacements, such as curly quotes, -- to em-dash, etc. Presumably this would be enabled on a per-file-type basis?

I looked into the viability of doing this as a plugin, but I couldn't see a way to make it happen automatically, e.g. by intercepting key strokes.

I also realize that demand for this may not be huge, given that those of us using micro for plain text editing/markdown are probably often using some other kind of processor (e.g. TeX, pandoc, etc.). But I'm at least in the edge case where that's not consistently the case.

@JoeKar
Copy link
Collaborator

JoeKar commented Aug 7, 2023

I looked into the viability of doing this as a plugin, but I couldn't see a way to make it happen automatically, e.g. by intercepting key strokes.

A Lua plugin reacting on runes via onRune(rune) should perfectly fit to what you need. Now only someone needs to create this plugin. ;)

@dei-layborer
Copy link
Author

A Lua plugin reacting on runes via onRune(rune) should perfectly fit to what you need. Now only someone needs to create this plugin. ;)

Haha there we go. I don't know Lua in the slightest, but may be worth trying it out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants