Skip to content
Snippets Groups Projects
Commit 31a6b3ab authored by nimrod's avatar nimrod
Browse files

- Run Bash specifics at the end of .bashrc, otherwise some Bash

completions aren't working properly.
- Added direnv bash completion.
parent cd0695db
Branches
No related tags found
No related merge requests found
#!/bin/sh
if which direnv > /dev/null
then
[ -f "$HOME/.bash_completion.d/.direnv" ] || direnv hook bash > "$HOME/.bash_completion.d/.direnv"
# shellcheck disable=SC1090
. "$HOME/.bash_completion.d/.direnv"
fi
...@@ -2,32 +2,6 @@ ...@@ -2,32 +2,6 @@
# If not running interactively, don't do anything # If not running interactively, don't do anything
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
if [ -n "${BASH:-}" ]
then
shopt -s histappend
shopt -s checkwinsize
shopt -s cmdhist
export PROMPT_COMMAND="history -a"
[ -f /etc/bash_completion ] && . /etc/bash_completion
# shellcheck disable=SC1090
for sourcefile in $HOME/.bash_completion.d/*
do
[ ! -f "$sourcefile" ] || . "$sourcefile"
done
fi
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='diff --color=auto'
fi
export LANG=en_US.UTF8 export LANG=en_US.UTF8
export HISTFILE="$HOME/.history" export HISTFILE="$HOME/.history"
export HISTCONTROL=ignoreboth:erasedups export HISTCONTROL=ignoreboth:erasedups
...@@ -218,4 +192,31 @@ __prompt () { ...@@ -218,4 +192,31 @@ __prompt () {
# shellcheck disable=SC1090 # shellcheck disable=SC1090
. "$HOME/Documents/Shore/bundle_certs/bundle_certs" . "$HOME/Documents/Shore/bundle_certs/bundle_certs"
if [ -n "${BASH:-}" ]
then
shopt -s histappend
shopt -s checkwinsize
shopt -s cmdhist
export PROMPT_COMMAND="history -a"
[ -f /etc/bash_completion ] && . /etc/bash_completion
# shellcheck disable=SC1090
for sourcefile in $HOME/.bash_completion.d/*
do
[ ! -f "$sourcefile" ] || . "$sourcefile"
done
fi
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='diff --color=auto'
fi
prune_prerun prune_prerun
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment