aliases/general: cleanup

- use `-A` instead of `-a` for `ls`,
- quote variable expansions,
- don’t *assign* default expansions,
- don’t alias `piano` without `pianobar`,
- enable `bash-it` aliases in the default profile…
pull/2095/head
John D Pell 2022-02-17 21:26:00 -08:00 committed by John D Pell
parent fdff1d81cd
commit 8e78294920
2 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,5 @@
# shellcheck shell=bash # shellcheck shell=bash
# shellcheck source-path=SCRIPTDIR
about-alias 'general aliases' about-alias 'general aliases'
if command ls --color -d . &> /dev/null; then if command ls --color -d . &> /dev/null; then
@ -9,16 +10,16 @@ fi
# List directory contents # List directory contents
alias sl=ls alias sl=ls
alias la='ls -AF' # Compact view, show hidden alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al' alias ll='ls -Al'
alias l='ls -a' alias l='ls -A'
alias l1='ls -1' alias l1='ls -1'
alias lf='ls -F' alias lf='ls -F'
alias _='sudo' alias _='sudo'
# Shortcuts to edit startup files # Shortcuts to edit startup files
alias vbrc='${VISUAL:-vim} ~/.bashrc' alias vbrc='"${VISUAL:-vim}" ~/.bashrc'
alias vbpf='${VISUAL:-vim} ~/.bash_profile' alias vbpf='"${VISUAL:-vim}" ~/.bash_profile'
# colored grep # colored grep
# Need to check an existing file for a pattern that will be found to ensure # Need to check an existing file for a pattern that will be found to ensure
@ -35,11 +36,11 @@ alias c='clear'
alias cls='clear' alias cls='clear'
alias edit='${EDITOR:-${ALTERNATE_EDITOR?}}' alias edit='${EDITOR:-${ALTERNATE_EDITOR?}}'
alias pager='${PAGER:=less}' alias pager='${PAGER:-less}'
alias q='exit' alias q='exit'
alias irc='${IRC_CLIENT:=irc}' alias irc='${IRC_CLIENT:-irc}'
# Language aliases # Language aliases
alias rb='ruby' alias rb='ruby'
@ -47,8 +48,9 @@ alias py='python'
alias ipy='ipython' alias ipy='ipython'
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
if _command_exists pianobar; then
alias piano='pianobar' alias piano='pianobar'
fi
alias ..='cd ..' # Go up one directory alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory alias cd..='cd ..' # Common misspelling for going up one directory
@ -72,8 +74,8 @@ alias rd='rmdir'
alias xt='extract' alias xt='extract'
# sudo editors # sudo editors
alias svim='sudo ${VISUAL:-vim}' alias svim='sudo "${VISUAL:-vim}"'
alias snano='sudo nano' alias snano='sudo "${ALTERNATE_EDITOR:-nano}"'
# Display whatever file is regular file or folder # Display whatever file is regular file or folder
function catt() { function catt() {
@ -92,5 +94,4 @@ function catt() {
# aliases and enable just the ones for Bash-it explicitly: # aliases and enable just the ones for Bash-it explicitly:
# bash-it disable alias general # bash-it disable alias general
# bash-it enable alias bash-it # bash-it enable alias bash-it
# shellcheck source-path=SCRIPTDIR
source "$BASH_IT/aliases/available/bash-it.aliases.bash" source "$BASH_IT/aliases/available/bash-it.aliases.bash"

View File

@ -10,3 +10,4 @@ completion system
# aliases # aliases
aliases general aliases general
aliases bash-it