Migrating from direnv to Mise

Oh, and fixed an obscure bug that has caused me great consternation.
This commit is contained in:
Howard Abrams 2026-01-08 13:21:58 -08:00
parent 8af3329b73
commit 6463bb95a9
3 changed files with 29 additions and 2 deletions

View file

@ -1116,7 +1116,7 @@ Any time I create or delete a new tab, we can call =ha-tab-bar-update-names=:
(advice-add #'tab-bar-close-tab :after #'ha-tab-bar-update-names)
(advice-add #'tab-bar-close-other-tabs :after #'ha-tab-bar-update-names)
(add-hook desktop-after-read-hook #'ha-tab-bar-update-names)
(add-hook #'desktop-after-read-hook #'ha-tab-bar-update-names)
#+END_SRC
*** Add Numbers ot Tab Bar Mode
Christian Tietze had a [[https://christiantietze.de/posts/2022/02/emacs-tab-bar-numbered-tabs/][great idea]] for making the tab-bar numbers more distinguished from the labels on the tabs (he has a [[https://christiantietze.de/posts/2022/12/sf-symbols-emacs-tab-numbers/][follow up essay]] about using a different font, but since I need the portability of Unicode for Linux, I may need to synthesize both).

View file

@ -28,6 +28,32 @@ A literate programming file for helping me program.
Configuration for programming interfaces and workflows that behave similarly.
* General
The following work for all programming languages.
** Virtual Environments with Mise
The [[https://github.com/eki3z/mise.el][mise.el]] project overcomes the [[https://mise.jdx.dev/ide-integration.html#emacs][need for shims]] and other hoops when working with [[https://mise.jdx.dev/walkthrough.html][Mise]].
#+BEGIN_SRC emacs-lisp
(use-package mise
:straight (:type git :host github :repo "eki3z/mise.el")
:hook (after-init . global-mise-mode))
#+END_SRC
Now, per project, create a =mise.toml= that contains tools, environment variables, etc.
#+BEGIN_SRC toml
[env]
AWS_DEFAULT_REGION = "us-gov-east-1"
[tools]
python = {version='3', virtualenv='~/.venv/govcloud_lambda'}
#+END_SRC
Or create the entries by using CLI commands:
#+BEGIN_SRC sh :tangle no
mise set AWS_DEFAULT_REGION=us-gov-east-1
#+END_SRC
** Virtual Environments with direnv
Farm off commands into /virtual environments/:
#+begin_src emacs-lisp

View file

@ -246,6 +246,7 @@ Configure the plugins, making sure to not use =git=, as the aliases are a pain t
- [[https://github.com/hsienjan/colorize][colorize]] :: syntax-highlight file contents, so install [[https://pygments.org/download/][Pygments]] first. Then call =ccat= and =cless= (see [[Aliases]]).
- [[https://github.com/ptavares/zsh-direnv][direnv]] :: to support the [[https://direnv.net/][direnv]] virtual environment project.
- [[https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/mise/mise.plugin.zsh][mise]] :: to support the [[https://mise.jdx.dev/getting-started.html][mise]] virtual environment and tool project (instead of direnv). See the [[https://mise.jdx.dev/walkthrough.html][walk-through]].
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gnu-utils][gnu-utils]] :: bind the GNU flavor for standard utils, like =gfind= to the normal version, e.g. =find=.
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/iterm2][iterm2]] :: while fully configured below, configures the interaction with the MacOS application, [[https://www.iterm2.com/][iTerm2]].
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/macos][macos]] :: adds new functions that work better with MacOS terminals and the Finder. I like:
@ -258,7 +259,7 @@ Configure the plugins, making sure to not use =git=, as the aliases are a pain t
To have a plugin /install/, add its name to the =plugins= array variable /before/ we =source= the OMZ script:
#+begin_SRC zsh
plugins=(colorize direnv gnu-utils iterm2 macos virtualenv zbell zsh-syntax-highlighting)
plugins=(colorize direnv gnu-utils iterm2 macos mise virtualenv zbell zsh-syntax-highlighting)
#+END_SRC
Notice the =iterm2= plugin as well as the =macos= plugins that would be nice to figure out how to make them optionally added (although I believe they check themselves).