diff --git a/.config/bash/README.md b/.config/bash/README.md index d531aa4..d1c64c4 100644 --- a/.config/bash/README.md +++ b/.config/bash/README.md @@ -3,3 +3,11 @@ Host-specifics (including in `~vern`), maybe bash-specific functions. Global configs are at [`~/.bashrc`](../../.bashrc), [`~/.bash_login`](../../.bash_login) and [POSIX-compliant `~/.profile`](../../.profile). + +## Directories and files + +* `completions` +* `hosts` +* `shell-prompts` +* `tools` +* `aliases` diff --git a/.config/bash/aliases b/.config/bash/aliases index 219b81d..308e1d8 100644 --- a/.config/bash/aliases +++ b/.config/bash/aliases @@ -1,13 +1,16 @@ # General alias clear="printf '\033c'" # faster than ncurses clear by a lot alias c='clear' -alias bashrc="vim ~/.bashrc && source ~/.bashrc" +alias bashrc="nano ~/.bashrc && source ~/.bashrc" # LS alias ls='ls --color=auto -FAh' alias ll='ls -l' alias la='ls' alias l.='ls | egrep "^\."' alias l=ls +test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" +alias dir='dir --color=auto' +alias vdir='vdir --color=auto' # GREP alias grep='grep --color=auto' alias egrep='egrep --color=auto' diff --git a/.config/bash/bashrc b/.config/bash/bashrc index bee6660..3e136fe 100644 --- a/.config/bash/bashrc +++ b/.config/bash/bashrc @@ -3,10 +3,10 @@ # for examples # If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac +#case $- in +# *i*) ;; +# *) return;; +#esac # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options @@ -30,11 +30,6 @@ shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color|*-256color) color_prompt=yes;; @@ -56,13 +51,6 @@ if [ -n "$force_color_prompt" ]; then fi fi -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) @@ -72,25 +60,8 @@ xterm*|rxvt*) ;; esac -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - #alias grep='grep --color=auto' - #alias fgrep='fgrep --color=auto' - #alias egrep='egrep --color=auto' -fi - # colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -#alias ll='ls -l' -#alias la='ls -A' -#alias l='ls -CF' +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # Alias definitions. # You may want to put all your additions into a separate file like diff --git a/.config/bash/completions/gopass.bash b/.config/bash/completions/gopass.bash new file mode 100644 index 0000000..a3ea75e --- /dev/null +++ b/.config/bash/completions/gopass.bash @@ -0,0 +1,11 @@ +_gopass_bash_autocomplete() { + local cur opts base + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) + local IFS=$'\n' + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + } + +complete -F _gopass_bash_autocomplete gopass diff --git a/.config/bash/hosts/btwscar-wsl-Alpine.bashrc b/.config/bash/hosts/btwscar-wsl-Alpine.bashrc new file mode 100644 index 0000000..f1bcffd --- /dev/null +++ b/.config/bash/hosts/btwscar-wsl-Alpine.bashrc @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +alias generate-hash="abuild checksum && abuild -r" +export GIT_EDITOR="code-insiders --wait" diff --git a/.config/bash/shell-prompts/.gitkeep b/.config/bash/shell-prompts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.config/bash/prompt b/.config/bash/shell-prompts/psflt.bashrc similarity index 99% rename from .config/bash/prompt rename to .config/bash/shell-prompts/psflt.bashrc index 884b78e..788f2f7 100644 --- a/.config/bash/prompt +++ b/.config/bash/shell-prompts/psflt.bashrc @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + __sig() { # Giant switch case for getting the name of the signal (`kill -l`) a=0 diff --git a/.config/bash/prompt.old b/.config/bash/shell-prompts/vern.bashrc similarity index 100% rename from .config/bash/prompt.old rename to .config/bash/shell-prompts/vern.bashrc diff --git a/.config/bash/tools/brew.bashrc b/.config/bash/tools/brew.bashrc new file mode 100644 index 0000000..e39dcca --- /dev/null +++ b/.config/bash/tools/brew.bashrc @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export HOMEBREW_HOME=${HOMEBREW_HOME:-"/home/linuxbrew/.linuxbrew"} +test -d "$HOMEBREW_HOME" && eval "$($HOMEBREW_HOME/bin/brew shellenv)" +[[ -r "$HOMEBREW_HOME/etc/profile.d/bash_completion.sh" ]] && . "$HOMEBREW_HOME/etc/profile.d/bash_completion.sh" \ No newline at end of file diff --git a/.config/bash/tools/nvm.bashrc b/.config/bash/tools/nvm.bashrc new file mode 100644 index 0000000..491a024 --- /dev/null +++ b/.config/bash/tools/nvm.bashrc @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion \ No newline at end of file