mirror of
https://mau.dev/andreijiroh-dev/dotfiles.git
synced 2025-01-19 06:56:39 +00:00
Some maintenance work around bashrc files
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
This commit is contained in:
parent
e34c3dd5ed
commit
094b8a0009
10 changed files with 44 additions and 35 deletions
|
@ -3,3 +3,11 @@
|
||||||
Host-specifics (including in `~vern`), maybe bash-specific functions.
|
Host-specifics (including in `~vern`), maybe bash-specific functions.
|
||||||
Global configs are at [`~/.bashrc`](../../.bashrc),
|
Global configs are at [`~/.bashrc`](../../.bashrc),
|
||||||
[`~/.bash_login`](../../.bash_login) and [POSIX-compliant `~/.profile`](../../.profile).
|
[`~/.bash_login`](../../.bash_login) and [POSIX-compliant `~/.profile`](../../.profile).
|
||||||
|
|
||||||
|
## Directories and files
|
||||||
|
|
||||||
|
* `completions`
|
||||||
|
* `hosts`
|
||||||
|
* `shell-prompts`
|
||||||
|
* `tools`
|
||||||
|
* `aliases`
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
# General
|
# General
|
||||||
alias clear="printf '\033c'" # faster than ncurses clear by a lot
|
alias clear="printf '\033c'" # faster than ncurses clear by a lot
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
alias bashrc="vim ~/.bashrc && source ~/.bashrc"
|
alias bashrc="nano ~/.bashrc && source ~/.bashrc"
|
||||||
# LS
|
# LS
|
||||||
alias ls='ls --color=auto -FAh'
|
alias ls='ls --color=auto -FAh'
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
alias la='ls'
|
alias la='ls'
|
||||||
alias l.='ls | egrep "^\."'
|
alias l.='ls | egrep "^\."'
|
||||||
alias l=ls
|
alias l=ls
|
||||||
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
|
alias dir='dir --color=auto'
|
||||||
|
alias vdir='vdir --color=auto'
|
||||||
# GREP
|
# GREP
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
# for examples
|
# for examples
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
case $- in
|
#case $- in
|
||||||
*i*) ;;
|
# *i*) ;;
|
||||||
*) return;;
|
# *) return;;
|
||||||
esac
|
#esac
|
||||||
|
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
# don't put duplicate lines or lines starting with space in the history.
|
||||||
# See bash(1) for more options
|
# 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)
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
#[ -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)
|
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
xterm-color|*-256color) color_prompt=yes;;
|
xterm-color|*-256color) color_prompt=yes;;
|
||||||
|
@ -56,13 +51,6 @@ if [ -n "$force_color_prompt" ]; then
|
||||||
fi
|
fi
|
||||||
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
|
# If this is an xterm set the title to user@host:dir
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
xterm*|rxvt*)
|
xterm*|rxvt*)
|
||||||
|
@ -72,25 +60,8 @@ xterm*|rxvt*)
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
# colored GCC warnings and errors
|
||||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
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'
|
|
||||||
|
|
||||||
# Alias definitions.
|
# Alias definitions.
|
||||||
# You may want to put all your additions into a separate file like
|
# You may want to put all your additions into a separate file like
|
||||||
|
|
11
.config/bash/completions/gopass.bash
Normal file
11
.config/bash/completions/gopass.bash
Normal 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
|
4
.config/bash/hosts/btwscar-wsl-Alpine.bashrc
Normal file
4
.config/bash/hosts/btwscar-wsl-Alpine.bashrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
alias generate-hash="abuild checksum && abuild -r"
|
||||||
|
export GIT_EDITOR="code-insiders --wait"
|
0
.config/bash/shell-prompts/.gitkeep
Normal file
0
.config/bash/shell-prompts/.gitkeep
Normal file
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
__sig() {
|
__sig() {
|
||||||
# Giant switch case for getting the name of the signal (`kill -l`)
|
# Giant switch case for getting the name of the signal (`kill -l`)
|
||||||
a=0
|
a=0
|
5
.config/bash/tools/brew.bashrc
Normal file
5
.config/bash/tools/brew.bashrc
Normal 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"
|
5
.config/bash/tools/nvm.bashrc
Normal file
5
.config/bash/tools/nvm.bashrc
Normal 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
|
Loading…
Reference in a new issue