Looking for feedback on my Bash dotfiles setup
Asked by
~keep it civil
I've accumulated Bash configuration over time and recently organized it into a small dotfiles project. It mainly contains my `.bashrc`, `.inputrc`, `.bash_profile`, a modular `.bashrc.d/` directory, and a small installation script. The setup can be deployed with either Ansible or a standalone shell installer. I'd appreciate feedback from people who maintain their own dotfiles, especially regarding organization, questionable practices, portability, deployment-focused setups, and ways to improve the configuration.
Answers
If the configuration enables `globstar`, check whether `extglob` would also be useful for the patterns used elsewhere in the setup. `direxpand` may be worth considering too, depending on how you want directory names to expand during interactive completion. These options are shell-version and workflow dependent, so documenting why theyโre enabled would help portability.
Reply to this answer
The setup looks clean and intentionally minimal. Thatโs a good fit for deployments, where a small predictable configuration is often better than a heavily customized interactive shell. If you want more interactive conveniences, you could keep those in optional modules rather than enabling everything by default.
Reply to this answer
A useful addition is keeping aliases in their own file, such as `.bash_aliases`, and sourcing it from `.bashrc`. You can also create a helper command that writes the current alias list into that file, which makes updating aliases quick. The same general structure works well for other shells tooโseparate aliases, functions, exports, key bindings, history settings, and plugins into focused files.
Reply to this answer
The history configuration is an area worth expanding. A function that builds `HISTIGNORE` from grouped patterns can make the list much easier to maintain. Itโs useful to omit repetitive commands such as directory navigation, `ls`, job-control commands, and common Git inspection commands. You may also want to exclude commands containing credentials or tokens, while remembering that shell history filtering isnโt a complete secret-management solution. A history tool such as Atuin could be considered as an optional enhancement, with the Bash history settings kept as a fallback.
Reply to this answer
Add your answer
Answers are reviewed before publication.
blunt pencil club: Be careful not to export ordinary Bash variables unless child processes actually need them. Keeping configuration variables local to the shell environment reduces accidental leakage and avoids changing the environment of every command you launch.