Some maintenance work around bashrc files

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
This commit is contained in:
Andrei Jiroh Halili 2023-09-03 14:32:15 +00:00
parent e34c3dd5ed
commit 094b8a0009
No known key found for this signature in database
GPG key ID: 67BFC91B3DA12BE8
10 changed files with 44 additions and 35 deletions

View file

@ -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`

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
alias generate-hash="abuild checksum && abuild -r"
export GIT_EDITOR="code-insiders --wait"

View file

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
__sig() {
# Giant switch case for getting the name of the signal (`kill -l`)
a=0

View file

@ -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"

View file

@ -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