-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodify_dot_bashrc
More file actions
105 lines (81 loc) · 3.13 KB
/
modify_dot_bashrc
File metadata and controls
105 lines (81 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{{- /* chezmoi:modify-template */ -}}
# Set byobu config directory to XDG compliant location
export BYOBU_CONFIG_DIR="$HOME/.config/byobu"
{{- if eq .chezmoi.os "linux" }}
# Ubuntu/Debian default bashrc configuration
{{ includeTemplate "ubuntu_bashrc.tmpl" . }}
{{- else }}
# Default minimal bash configuration for non-Linux systems
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Basic history settings
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
# Basic shell options
shopt -s checkwinsize
{{- end }}
### User Customizations
# Byobu integration (must be loaded BEFORE atuin so byobu's PROMPT_COMMAND
# modifications don't overwrite atuin's precmd hook for history recording)
[ -r ~/.config/byobu/prompt ] && source ~/.config/byobu/prompt #byobu-prompt#
# Load common shell configuration (shared with zsh)
# This includes add_to_path function, atuin init, and other shared utilities
# Must be loaded AFTER byobu prompt to ensure atuin's PROMPT_COMMAND hooks survive
{{ includeTemplate "shell_common.tmpl" . }}
# Vi mode for command line editing
set -o vi
# Extended history settings (override default HISTSIZE=1000)
HISTSIZE=9999
# WSL (Windows Subsystem for Linux) specific settings
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
# Windows Explorer alias
alias e='explorer.exe'
# X11 display for WSL (GWSL configuration)
# Note: Adjust IP range according to your network setup
export DISPLAY=$(ipconfig.exe /all | grep -a IPv4 | grep -o -e "192.168.11.[0-9]\{1,3\}"):0.0
fi
# Development tools are now configured in shared template
# Environment Configuration
# Load user-specific environment variables
if [[ -f "$HOME/.env" ]]; then
set -a; source "$HOME/.env"; set +a
fi
# External Tools Integration
[[ -f ~/bin/tmux-xpanes/activate.sh ]] && source ~/bin/tmux-xpanes/activate.sh
# Version Managers Initialization
{{- if eq .chezmoi.os "android" }}
# Android/Termux: Use system packages instead of version managers
# Install: pkg install python nodejs
# For global packages: npm install -g <package> or pip install <package>
{{- else }}
{{- end }}
# Common configuration now handled in shell_common.tmpl
# Prompt Customization
# Add virtual environment and Node.js version to prompt (after vi mode indicator from .inputrc)
PS1='$(show_dev_env)'$PS1
# Node.js local modules PATH
add_to_path "node_modules/bin"
# Additional Tool Configuration
# fzf completions for various commands
if command -v _fzf_setup_completion >/dev/null 2>&1; then
_fzf_setup_completion path ag git kubectl ll vim "chezmoi edit"
_fzf_setup_completion dir tree
fi
# mosh: use same completion as ssh (hostnames from ~/.ssh/config)
if command -v mosh >/dev/null 2>&1 && declare -F _ssh >/dev/null 2>&1; then
complete -F _ssh mosh
fi
# Disable Ctrl+S/Ctrl+Q flow control (allows Ctrl+S for search)
stty -ixon
# Cargo environment is now handled in shell_common.tmpl
# PATH cleanup is now handled in shell_common.tmpl
# chezmoi:managed-end
{{ $parts := splitList "# chezmoi:managed-end" .chezmoi.stdin -}}
{{ if gt (len $parts) 1 -}}
{{ index $parts 1 | trimPrefix "\n" -}}
{{ end -}}