Skip to content

Commit 6079ef1

Browse files
committed
Minor .bashrc and .profile clean up
1 parent 59050f4 commit 6079ef1

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

stowed-files/bash/.aliases

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ fi
7171
if command_exists bat; then
7272
alias batcat='bat'
7373
fi
74+
if command_exists eza; then
75+
alias exa='eza'
76+
fi
7477

7578
if command_exists code; then
7679
# Override Mac's default storage dir to match Linux
@@ -79,5 +82,6 @@ fi
7982

8083
# Load local file if present
8184
if [ -f ~/.aliases.local ]; then
85+
# shellcheck source=/dev/null
8286
. ~/.aliases.local
8387
fi

stowed-files/bash/.bashrc

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
# vim: ft=sh
22

3-
# If not running interactively, don't do anything
3+
# If not running interactively, don't do anything here. Anything
4+
# needed in non-interactive shells goes in `.profile`
45
case $- in
56
*i*) ;;
67
*) return;;
78
esac
89

9-
# Glorious editor
10-
set -o vi
11-
1210
# Make sure we have always loaded ~/.profile, which can get lost
1311
# shellcheck source=/dev/null
1412
source "$HOME/.profile"
1513

1614
# make less more friendly for non-text input files, see lesspipe(1)
1715
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
1816

19-
# Clear C-w binding in order to re-bind in .inputrc
20-
stty werase undef
21-
2217
HISTFILE=$HOME/.bash_history
2318
# Never forget
2419
HISTFILESIZE=-1
@@ -156,20 +151,27 @@ if command_exists zoxide; then
156151
eval "$(zoxide init bash --hook pwd)"
157152
fi
158153

159-
FD_COMMAND="fd"
160-
if ! command_exists "${FD_COMMAND}"; then
161-
# Debian uses `fdfind`
162-
FD_COMMAND="fdfind"
163-
fi
164-
export FD_COMMAND
165-
166154
BAT_COMMAND="bat"
167155
if ! command_exists "${BAT_COMMAND}"; then
168156
# Debian uses `batcat`
169157
BAT_COMMAND="batcat"
170158
fi
171159
export BAT_COMMAND
172160

161+
EZA_COMMAND="eza"
162+
if ! command_exists "${EZA_COMMAND}"; then
163+
# Debian uses `exa` until `eza` is available
164+
EZA_COMMAND="exa"
165+
fi
166+
export EZA_COMMAND
167+
168+
FD_COMMAND="fd"
169+
if ! command_exists "${FD_COMMAND}"; then
170+
# Debian uses `fdfind`
171+
FD_COMMAND="fdfind"
172+
fi
173+
export FD_COMMAND
174+
173175
fzf_preview_command=""
174176
if command_exists pistol; then
175177
fzf_preview_command="'pistol {}'"
@@ -188,12 +190,14 @@ if command_exists "${FD_COMMAND}"; then
188190
export FZF_CTRL_T_COMMAND="fd_with_git"
189191
export FZF_ALT_C_COMMAND="${FD_COMMAND} --type directory --hidden --color always"
190192
fi
191-
if command_exists exa; then
193+
194+
if command_exists "${EZA_COMMAND}"; then
192195
# Show tree structure in preview window
193196
export FZF_ALT_C_OPTS="
194-
--preview 'exa --tree --all {}'
197+
--preview '${EZA_COMMAND} --tree --all {}'
195198
"
196199
fi
200+
197201
export FZF_DEFAULT_OPTS="
198202
--ansi
199203
--bind 'ctrl-alt-a:select-all'
@@ -209,9 +213,6 @@ export FZF_CTRL_T_OPTS="
209213
"
210214
export FZF_COMPLETION_OPTS='--smart-case'
211215

212-
# Use wayland for Firefox
213-
export MOZ_ENABLE_WAYLAND=1
214-
215216
# FZF keybindings (Debian)
216217
source_if_exists "/usr/share/doc/fzf/examples/key-bindings.bash"
217218
# FZF keybindings (Homebrew)
@@ -221,9 +222,6 @@ if command_exists fnm; then
221222
eval "$(fnm env)"
222223
fi
223224

224-
# Opt-out of Eternal Terminal telemetry
225-
export ET_NO_TELEMETRY=1
226-
227225
# Load system bash completion
228226
source_if_exists "/etc/bash_completion"
229227
# Load Homebrew bash completion, see https://docs.brew.sh/Shell-Completion

stowed-files/bash/.profile

+9-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ fi
5656
# Locally-installed packages belong in path
5757
add_to_path "$HOME/.local/bin"
5858

59-
# Make sure to use system for virsh by default
60-
export LIBVIRT_DEFAULT_URI="qemu:///system"
61-
6259
if [ -z "${XDG_CONFIG_HOME:-}" ]; then
6360
export XDG_CONFIG_HOME="$HOME/.config"
6461
fi
@@ -71,6 +68,15 @@ if [ -z "${XDG_DOWNLOAD_DIR:-}" ]; then
7168
fi
7269
fi
7370

71+
# Opt-out of Eternal Terminal telemetry
72+
export ET_NO_TELEMETRY=1
73+
74+
# Make sure to use system for virsh by default
75+
export LIBVIRT_DEFAULT_URI="qemu:///system"
76+
77+
# Use wayland for Firefox
78+
export MOZ_ENABLE_WAYLAND=1
79+
7480
# Rg, for whatever reason, needs to manually specify location for config
7581
export RIPGREP_CONFIG_PATH="$XDG_CONFIG_HOME/ripgrep/rc"
7682

0 commit comments

Comments
 (0)