You can add things conditionally with paths+=( /another/dir ), and most critically you don’t need to figure out where to put colons: it happens automatically.
Fzf is the best. I’m also a huge fan of alias g=git in the bash config, then managing l=log subcommands in git’s config. It just feels right to me to delegate the aliases to their own binaries’ config.
I use McFly for my ctrl-R replacement https://github.com/cantino/mcfly because it has some useful intelligence built-in, but fzf is definitely simpler.
I like the j function. Again, simple!
I also have similar git aliases such as gs. also “push” and “pull” just do a git push/pull
I love reading about other people’s configs, and sometimes pick up bits and pieces to add it to my own config.
However, it is rare to actually integrate those into my daily workflow, mostly because it tends to be dev/leadership-focused rather than something where I’m using the shell extensively through the workday. Really, I need a shell for project management stuff. Dev workflows are in a decent spot now overall.
I only did this recently, but I kind of tried to replicate VS Code’s integrated terminal and git UI in wezterm using splits and gitui, so that when I’m editing a file in Helix and press Ctrl+` it’ll toggle a split horizontal terminal, and if I press Alt+g it opens a fullscreen split running gitui.
Another thing I use quite frequently is just a Nushell script I wrote to run nixos-rebuild or nix-darwin rebuild depending on the hostname of the current machine, and a wrapper to nix search that shows the results in a Nushell table. I have a half-baked wrapper for some docker commands as well but it’s far from being complete so I haven’t committed it yet.
In a ./link script in my dotfiles repo, it adds a symlink to all versioned dotfiles directly to the home directory:
list_versioned_dotfiles |
while read line ; do
ln -s ~/.dotfiles/$line ~/$line
done
This lets me view/edit files I want to be version controlled directly in my home directory without managing the home directory as a repo. I honestly forgot which ones are versioned as I edit them directly from ~/, but every few months I can check in with a git diff in the .dotfiles directory and see what I have changed. It is usually multi-os config differences.
I’ve got a lot of configs useful to me, but only one I’ve tried to document as a blog post: using broot with Zsh, especially as an argument completer for partially typed paths.
Anyone care to share the most useful bits of their config?
My terminal is Wezterm because it’s fairly hugely configurable (albeit all via a config file)
A snippet of bash that I have found useful in the construction of PATH variables:
You can add things conditionally with
paths+=( /another/dir ), and most critically you don’t need to figure out where to put colons: it happens automatically.that’s a little nicer than my method.
here’s my pathconfig file https://github.com/pmarreck/dotfiles/blob/master/.pathconfig
and here’s the function(s) I wrote to “safely” manipulate it https://github.com/pmarreck/dotfiles/blob/master/bin/functions/prepend_path.bash
Includes test coverage
It was definitely the conclusion of many years of code golf on the specific topic haha
I think I thought about doing it the array way but then wanted something that was POSIX-compatible in case I ever switched shells, or something
Honestly, my most useful bits are very simple:
ctrl-rusesfzffor history recallj projectto jump to$PROJECTS/project. No tomfoolery/dependencies/learning involved.gsfor short-formgit status,glforgit logNot going to tell people how to work, but that’s all I need. It is very simple, keeps on working, and doesn’t need maintenance.
Fzf is the best. I’m also a huge fan of
alias g=gitin the bash config, then managingl=logsubcommands in git’s config. It just feels right to me to delegate the aliases to their own binaries’ config.Definitely a fan of KISS!
I use McFly for my ctrl-R replacement https://github.com/cantino/mcfly because it has some useful intelligence built-in, but fzf is definitely simpler.
I like the
jfunction. Again, simple!I also have similar git aliases such as gs. also “push” and “pull” just do a git push/pull
I love reading about other people’s configs, and sometimes pick up bits and pieces to add it to my own config.
However, it is rare to actually integrate those into my daily workflow, mostly because it tends to be dev/leadership-focused rather than something where I’m using the shell extensively through the workday. Really, I need a shell for project management stuff. Dev workflows are in a decent spot now overall.
The extra four characters is just enough to keep me from making a drastic mistake.
I only did this recently, but I kind of tried to replicate VS Code’s integrated terminal and git UI in wezterm using splits and
gitui, so that when I’m editing a file in Helix and press Ctrl+` it’ll toggle a split horizontal terminal, and if I press Alt+g it opens a fullscreen split running gitui.https://kirarin.hootr.club/git/steinuil/flakes/src/commit/d64ccb507f6181c4009dbde31f801b9bfe2cfba5/modules/scripts/wezterm.lua#L105
Another thing I use quite frequently is just a Nushell script I wrote to run
nixos-rebuildornix-darwin rebuilddepending on the hostname of the current machine, and a wrapper tonix searchthat shows the results in a Nushell table. I have a half-baked wrapper for somedockercommands as well but it’s far from being complete so I haven’t committed it yet.In a
./linkscript in my dotfiles repo, it adds a symlink to all versioned dotfiles directly to the home directory:This lets me view/edit files I want to be version controlled directly in my home directory without managing the home directory as a repo. I honestly forgot which ones are versioned as I edit them directly from ~/, but every few months I can check in with a
git diffin the .dotfiles directory and see what I have changed. It is usually multi-os config differences.I’ve got a lot of configs useful to me, but only one I’ve tried to document as a blog post: using broot with Zsh, especially as an argument completer for partially typed paths.
I use
_SHLVL=$(printf '\$%.0s' $(seq 1 $SHLVL))to tell how many subshells deep I am.hmmm, this only prints \$ for me, times the levels of depth
also, doesn’t SHLVL already tell you how many subshells deep you are?
I stick this in my
PS1, so if I enter shells it stacks the$.that’s pretty neat! will have to consider that
invoking @okaleniuk so author could see the reaction to his piece of text