From 6463bb95a9264961e062d0d211122f6dda755d17 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Thu, 8 Jan 2026 13:21:58 -0800 Subject: [PATCH] Migrating from direnv to Mise Oh, and fixed an obscure bug that has caused me great consternation. --- ha-config.org | 2 +- ha-programming.org | 26 ++++++++++++++++++++++++++ zshell.org | 3 ++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ha-config.org b/ha-config.org index cb6038a..061fd99 100644 --- a/ha-config.org +++ b/ha-config.org @@ -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). diff --git a/ha-programming.org b/ha-programming.org index cdbae45..b2ae4d0 100644 --- a/ha-programming.org +++ b/ha-programming.org @@ -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 diff --git a/zshell.org b/zshell.org index a772385..96bb636 100644 --- a/zshell.org +++ b/zshell.org @@ -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).