This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/shell/bash/rc

71 lines
2.4 KiB
Text
Raw Normal View History

2020-01-20 13:09:31 -06:00
#!/usr/bin/env bash
2017-02-07 16:16:45 -06:00
export XDG_CONFIG_HOME="$HOME/.config"
export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles"
2020-01-17 03:02:53 -06:00
. "$DOTFILES_PATH/bin/prelude"
2020-01-17 03:02:53 -06:00
[[ ! $- == *i* ]] && return # stop parsing on a non-interactive shell
2017-02-07 16:16:45 -06:00
2020-01-20 12:43:55 -06:00
. "$DOTFILES_PATH/apps/shell/bash/aliases.bash"
2020-01-17 03:02:53 -06:00
. "$DOTFILES_PATH/apps/shell/bash/autocompletions"
. "$DOTFILES_PATH/apps/shell/bash/prompt"
2017-02-20 18:31:28 -06:00
2020-01-17 03:02:53 -06:00
stty -ixon # disable ctrl-s terminal freezing
bind -f "$DOTFILES_PATH/apps/shell/inputrc" # load our key
# load our vconsole colors if in a tty
if [[ "${TERM%%-*}" = 'linux' ]]; then
c="$DOTFILES_PATH/bin/lib/colors/vconsole"
[[ -s "$c" ]] && . "$c"
fi
2017-02-07 16:16:45 -06:00
# prevents some Java GUI apps from not working or rendering properly due to
2018-11-08 09:34:17 -06:00
# using wacky window managers
2017-02-07 16:16:45 -06:00
export _JAVA_AWT_WM_NONREPARENTING=1
2020-01-17 03:02:53 -06:00
export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_file_bytes 1024000"
has_command fd && export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export LS_COLORS='ow=01;36;40'
export LESS="-x2" # less tab size of 2 spaces
export TERMINAL="urxvtc"
export BROWSER="firefox-developer-edition"
export HISTFILESIZE="10000000" # "unlimited" history
export HISTSIZE="10000000" # "unlimited" history
export HISTCONTROL=ignoreboth # ignore duplicates and commands starting with space (" ")
shopt -s globstar # allow ** recursive wildcard globbing
# prevents binds or commands pulling from history from insta-sending, and
# instead places them in the readline for editing
shopt -s histverify
shopt -s histappend # always _append_ to bash history
shopt -s cmdhist # ensure command history is comprised of single lines
HISTIGNORE='ls:ll:la' # ignore certain commands
2018-11-08 09:34:17 -06:00
# set our EDITOR to neovim if we've got it
export EDITOR="vim"
2020-01-17 03:02:53 -06:00
if has_command nvim; then
2018-11-08 09:34:17 -06:00
alias vim="nvim"
alias ovim="\\vim"
export EDITOR="nvim"
fi
2017-02-07 16:16:45 -06:00
# load a per-device config last so anything can be overridden
2020-01-20 10:49:06 -06:00
. maybe_source_env_file bashrc
. maybe_source_env_file .hidden/bashrc
2017-02-07 16:16:45 -06:00
2020-01-17 03:02:53 -06:00
# create paths we kind of expect to exist in some scripts
2020-01-20 14:01:06 -06:00
mkdir -p "$NOTES_PATH" "$SCROTS_PATH" "$USER_LOGS_PATH"
2019-06-09 09:49:32 -05:00
2020-01-17 03:02:53 -06:00
# open nice home instead if we're opening at home
2020-01-20 09:12:52 -06:00
if [ "$PWD" = "$HOME" ] || [ "$PWD" = "$NICE_HOME" ]; then
cd "$NICE_HOME" || cd || return
fi
2018-11-03 14:06:15 -05:00
2020-01-17 03:02:53 -06:00
[ -f "$HOME/.fzf.bash" ] && . "$HOME/.fzf.bash"
2019-12-31 10:15:01 -06:00
2020-01-17 03:02:53 -06:00
if [[ -d "$HOME/.asdf/" ]] && [[ -f "$HOME/.asdf/asdf.sh" ]]; then
. "$HOME/.asdf/asdf.sh"
2019-12-31 10:15:01 -06:00
elif [[ -d /opt/asdf-vm/ ]] && [[ -f /opt/asdf-vm/asdf.sh ]]; then
2020-01-17 03:02:53 -06:00
. "/opt/asdf-vm/asdf.sh"
2019-12-31 10:15:01 -06:00
fi
2020-01-20 09:12:52 -06:00
[ -f ~/.fzf.bash ] && source ~/.fzf.bash