-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdot_bashrc
More file actions
52 lines (45 loc) · 1.48 KB
/
dot_bashrc
File metadata and controls
52 lines (45 loc) · 1.48 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
#-----------------------------------------------------------
# @raisedadead's config files
# Copyright: Mrugesh Mohapatra <https://mrugesh.dev>
# License: ISC
#
# File name: .bashrc
#-----------------------------------------------------------
# Non-interactive bailout
[[ $- != *i* ]] && return
# --- History ---
HISTSIZE=50000
HISTFILESIZE=50000
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
# --- Shell options ---
shopt -s checkwinsize
shopt -s cdspell
shopt -s dirspell 2>/dev/null
shopt -s autocd 2>/dev/null
shopt -s globstar 2>/dev/null
# --- Environment ---
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export XDG_CONFIG_HOME="$HOME/.config"
export EDITOR="nvim"
export VISUAL="code"
export GIT_EDITOR="$EDITOR"
# --- PATH ---
export HOMEBREW_PREFIX="/opt/homebrew"
export PATH="$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin:$PATH"
[[ -d "$HOME/.cargo/bin" ]] && export PATH="$HOME/.cargo/bin:$PATH"
export GOPATH="$HOME/go"
[[ -d "$GOPATH/bin" ]] && export PATH="$GOPATH/bin:$PATH"
[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH"
[[ -d "$HOME/.bin" ]] && export PATH="$HOME/.bin:$PATH"
# --- Oh-My-Posh ---
export POSH_THEME="$XDG_CONFIG_HOME/oh-my-posh/config.toml"
eval "$(oh-my-posh init bash --config "$POSH_THEME")"
# --- tmux exit code (must be after OMP to prepend into its PROMPT_COMMAND) ---
__tmux_exit_code() {
local ec=$?
[[ -n "$TMUX" ]] && tmux set-option -qw @last_exit_code "$ec"
return $ec
}
PROMPT_COMMAND="__tmux_exit_code;${PROMPT_COMMAND}"