feat(Bash): support bash

This commit is contained in:
2026-04-03 16:15:31 +08:00
parent e384a4ad0c
commit d6e7b8b81f
13 changed files with 409 additions and 0 deletions

13
bash/settings/exports.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Preferred editor for local and remote sessions.
if command -v helix >/dev/null 2>&1; then
export EDITOR="helix"
elif command -v nvim >/dev/null 2>&1; then
export EDITOR="nvim"
else
export EDITOR="vim"
fi
export OS="$(uname -s)"
export BASH_POLYJUICE_DEFAULT_PYTHON_VENV="$HOME/.default_pyvenv/.venv"

21
bash/settings/history.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
export HISTFILE="${HISTFILE:-$HOME/.bash_history}"
export HISTSIZE=50000
export HISTFILESIZE=10000
export HISTCONTROL="ignoreboth:erasedups"
export HISTTIMEFORMAT="%F %T "
shopt -s histappend
shopt -s cmdhist
shopt -s lithist
# Keep history synchronized across interactive shells.
if [[ -z "${BASH_POLYJUICE_HISTORY_INITIALIZED:-}" ]]; then
export BASH_POLYJUICE_HISTORY_INITIALIZED=1
if [[ -n "${PROMPT_COMMAND:-}" ]]; then
PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
else
PROMPT_COMMAND="history -a; history -n"
fi
fi