alias/general: `shellcheck`
parent
5748aa20a7
commit
11aa32387e
|
|
@ -1,10 +1,9 @@
|
|||
cite about-alias
|
||||
# shellcheck shell=bash
|
||||
about-alias 'general aliases'
|
||||
|
||||
if ls --color -d . &> /dev/null; then
|
||||
if command ls --color -d . &> /dev/null; then
|
||||
alias ls="ls --color=auto"
|
||||
elif ls -G -d . &> /dev/null; then
|
||||
alias ls='ls -G' # Compact view, show colors
|
||||
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
|
||||
fi
|
||||
|
||||
# List directory contents
|
||||
|
|
@ -18,13 +17,13 @@ alias lf='ls -F'
|
|||
alias _="sudo"
|
||||
|
||||
# Shortcuts to edit startup files
|
||||
alias vbrc="vim ~/.bashrc"
|
||||
alias vbpf="vim ~/.bash_profile"
|
||||
alias vbrc="${VISUAL:-vim} ~/.bashrc"
|
||||
alias vbpf="${VISUAL:-vim} ~/.bash_profile"
|
||||
|
||||
# colored grep
|
||||
# Need to check an existing file for a pattern that will be found to ensure
|
||||
# that the check works when on an OS that supports the color option
|
||||
if grep --color=auto "a" "${BASH_IT}/"*.md &> /dev/null; then
|
||||
if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null; then
|
||||
alias grep='grep --color=auto'
|
||||
fi
|
||||
|
||||
|
|
@ -36,12 +35,12 @@ alias c='clear'
|
|||
alias k='clear'
|
||||
alias cls='clear'
|
||||
|
||||
alias edit="$EDITOR"
|
||||
alias pager="$PAGER"
|
||||
alias edit='${EDITOR:-${ALTERNATE_EDITOR?}}'
|
||||
alias pager='${PAGER:=less}'
|
||||
|
||||
alias q='exit'
|
||||
|
||||
alias irc="${IRC_CLIENT:=irc}"
|
||||
alias irc='${IRC_CLIENT:=irc}'
|
||||
|
||||
# Language aliases
|
||||
alias rb='ruby'
|
||||
|
|
@ -74,13 +73,13 @@ alias rd='rmdir'
|
|||
alias xt="extract"
|
||||
|
||||
# sudo editors
|
||||
alias svim="sudo vim"
|
||||
alias svim="sudo ${VISUAL:-vim}"
|
||||
alias snano="sudo nano"
|
||||
|
||||
# Display whatever file is regular file or folder
|
||||
catt() {
|
||||
function catt() {
|
||||
for i in "$@"; do
|
||||
if [ -d "$i" ]; then
|
||||
if [[ -d "$i" ]]; then
|
||||
ls "$i"
|
||||
else
|
||||
cat "$i"
|
||||
|
|
@ -94,5 +93,5 @@ catt() {
|
|||
# aliases and enable just the ones for Bash-it explicitly:
|
||||
# bash-it disable alias general
|
||||
# bash-it enable alias bash-it
|
||||
# shellcheck source=./bash-it.aliases.bash
|
||||
# shellcheck source-path=SCRIPTDIR
|
||||
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
|
||||
|
|
|
|||
Loading…
Reference in New Issue