Per-project abbreviations using mise #167
henrebotha
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
|
That's really cool! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@henrebotha Do you happen to know a way to force mise to "reload" the file? Seems like when I change the config, I need to cd-out and cd back in to the directory for mise to pick up the changes |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
mise is a fantastic tool that combines direnv-style path-based environments, asdf-style polyglot tool version management, and task running. It has an experimental hooks feature that lets you run code when certain events occur.
We can use mise to create abbreviations scoped to a particular directory. I'm using this to save me from myself: One of our big monorepos at work is really big, and even simple commands like
git statustake a long time to complete. So I'd really like my usualgit s(which is a Git alias expanding togit status --short --branch) to expand togit s .while I'm in that monorepo. This way, at least some of the time, when I reflexively typegit s<Enter>, it will scope the command to just the subdirectory I'm in.We will scope these abbreviations to the session, so that they don't pollute other shells where we are not currently hanging out in the big repo.
Create (if you don't already have one) a
mise.local.tomlfile in the root of your enormous monorepo, and add the following to it.Now trust it.
Finally, try it out. (You will have to leave and re-enter the directory to make it happen; I don't have a workaround for this.)
Beta Was this translation helpful? Give feedback.
All reactions