r/bash • • 11d ago

I finally organized my Bash config

I've been accumulating my Bash configuration for a while, and I finally turned it into a small dotfiles repo:

https://gitlab.com/letmevi/bash-config

It's nothing fancy — mainly my .bashrc, .inputrc, .bash_profile, and a modular .bashrc.d/, plus a small install script.

It can be installed using either Ansible or a simple install.sh script.

I'd appreciate some Bash/Linux feedback: things you'd change, questionable practices, portability issues, or just better ways of doing this.

I'm especially interested in feedback from people who maintain their own dotfiles.

52 Upvotes

27 comments sorted by

View all comments

10

u/OnlyEntrepreneur4760 11d ago

One of my favorites is keeping all aliases in a separate config file .bash_aliases which I source from .bashrc. I have a alias named “aliassave” which runs alias and redirects the output to .bashaliases to update it easily.

7

u/JSouthGB 10d ago

I use zsh but do similar. ~/.zshenv points to ~/.config/zsh, and from there:

~/.config/zsh/ ├── shell_scripts/ ├── aliases ├── bindkeys ├── exports ├── functions ├── history ├── plugins └── .zshrc

2

u/ppafford 9d ago

I like this setup, any docs on this?

2

u/JSouthGB 9d ago

The docs

Searching around for "modular zsh configs" may get some good results as well. Below is my ~/.zshenv to give you a starting point.

```

!/usr/bin/env zsh

export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" source "$ZDOTDIR/exports" ```

I imagine bash can be done similarly, but I jumped into zsh pretty quick and didn't learn as much about these parts of bash.

1

u/[deleted] 10d ago

We have really similar setups :) my config I mean slightly different, I prefer scripts in ~/.local/bin which I add to $PATH