Move inline .bashrc config into modular .bash.d/ scripts

Extracted history, shell options, dircolors, rbenv, ~/.local/bin PATH,
and Maestro PATH from ~/.bashrc into dedicated .bash.d/ files, reducing
.bashrc from 126 lines to a minimal 23-line loader.

New files:
- 10-local-path: ~/.local/bin via path_prepend
- 10-maestro-path: ~/.maestro/bin via path_append
- 20-rbenv: rbenv init with existence guard
- 30-shell-options: history, checkwinsize, dircolors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-10 17:09:39 +01:00
commit 6cc9123807
5 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,3 @@
# shellcheck shell=bash
# Add Bun (a fast JavaScript runtime and package manager) to PATH
# Bun — fast JavaScript runtime and package manager
path_append "$HOME/.bun/bin"

3
10-local-path Executable file
View file

@ -0,0 +1,3 @@
# shellcheck shell=bash
# Add ~/.local/bin to PATH (pip, pipx, user-installed tools)
path_prepend "$HOME/.local/bin"

3
10-maestro-path Executable file
View file

@ -0,0 +1,3 @@
# shellcheck shell=bash
# Add Maestro (mobile UI testing framework) to PATH
path_append "$HOME/.maestro/bin"

5
20-rbenv Executable file
View file

@ -0,0 +1,5 @@
# shellcheck shell=bash
# Initialize rbenv (Ruby version manager)
if [[ -x "$HOME/.rbenv/bin/rbenv" ]]; then
eval "$("$HOME/.rbenv/bin/rbenv" init - --no-rehash bash)"
fi

21
30-shell-options Executable file
View file

@ -0,0 +1,21 @@
# shellcheck shell=bash
# Shell options: history, window size, and color support
# History
HISTCONTROL=ignoredups
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
# Update LINES and COLUMNS after each command
shopt -s checkwinsize
# Enable color support for ls
if command -v dircolors &>/dev/null; then
if [[ -r ~/.dircolors ]]; then
eval "$(dircolors -b ~/.dircolors)"
else
eval "$(dircolors -b)"
fi
alias ls='ls --color=auto'
fi