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/shell/bashrc
Daniel Flanagan d33fa3f5dc Fix a few things
* vim as git difftool
* don't use ale completion (we use deoplete)
* normal Iosevka font
* fix a var name collision
* rename home directory to `.home` to hide better
* fix warning with `c` function for going to $NICE_HOME
* improve fsw command
2018-10-19 01:17:08 -05:00

81 lines
2.2 KiB
Bash

#!/usr/bin/env bash
# bashrc is executed when a bash process starts
# these are all paths used across all the dotfiles and should be assumed to be
# loaded and properly set by every script - this means you are responsible for
# making sure they're loaded!
export XDG_CONFIG_HOME="$HOME/.config"
export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles"
export NICE_HOME="$HOME"
[[ $(basename "${HOME}") = "usr" ]] && export NICE_HOME="$HOME/.."
[[ $(basename "${HOME}") = ".home" ]] && export NICE_HOME="$HOME/.."
# TODO: nice home on a per-device basis
# set our PATH
source "$DOTFILES_PATH/shell/paths"
# import our aliases
source "$DOTFILES_PATH/shell/aliases"
# import our global shell functions
source "$DOTFILES_PATH/shell/funcs"
# import our autocompletions
source "$DOTFILES_PATH/shell/autocompletions"
# load our key binds
bind -f "$DOTFILES_PATH/shell/inputrc"
# less tab size of 2 spaces
LESS="-x2"
# stop parsing on a non-interactive shell
[ -z "$PS1" ] && return
# load our vconsole colors
if [ "${TERM%%-*}" = 'linux' ]; then
BASE16_SHELL="$DOTFILES_PATH/scripts/colors/vconsole"
[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL"
fi
# load our terminal colors
BASE16_SHELL="$DOTFILES_PATH/scripts/colors/shell"
[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL"
# disable ctrl-s terminal freeze
[[ $- == *i* ]] && stty -ixon
# allow ** recursive wildcard globbing
shopt -s globstar
# import our prompt
source "$DOTFILES_PATH/shell/prompt"
# prevents binds or commands pulling from history from insta-sending, and
# instead places them in the readline for editing
shopt -s histverify
# prevents some Java GUI apps from not working or rendering properly due to
# using bspwm
export _JAVA_AWT_WM_NONREPARENTING=1
# load a per-device config last so anything can be overridden
if [ -a "$HOME/.env_bashrc" ]; then
source "$HOME/.env_bashrc"
fi
# we assume the user uses "$HOME" to just store their mess of dotfiles and other
# nonsense that clutters it up and that they have a preferred starting
# directory where they keep the stuff they actually care about
# we only do this if the user is opening a shell at $HOME
if [ "$PWD" = "$HOME" ]; then
cd "$NICE_HOME"
fi
LS_COLORS='ow=01;36;40'
export LS_COLORS
[ -f ~/.fzf.bash ] && source ~/.fzf.bash