premier update stack trace
parent
e38696a0ac
commit
2ff8e6c5a1
|
|
@ -9,4 +9,4 @@ about-alias 'the silver searcher (ag) aliases'
|
|||
# -F (-F or --quit-if-one-screen) Auto exit if <1 screen
|
||||
# -X (-X or --no-init) Disable termcap init & deinit
|
||||
|
||||
alias ag='ag --smart-case --pager="less -MIRFX"'
|
||||
alias ag=$("ag --smart-case --pager="less -MIRFX")
|
||||
|
|
|
|||
|
|
@ -6,8 +6,15 @@ cite 'about-alias'
|
|||
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
|
||||
|
||||
# set apt aliases
|
||||
function _set_pkg_aliases() {
|
||||
if _command_exists apt; then
|
||||
function _set_pkg_aliases()
|
||||
{
|
||||
############ STACK_TRACE_BUILDER #####################
|
||||
Function_Name="${FUNCNAME[0]}"
|
||||
Function_PATH="${Function_PATH}/${Function_Name}"
|
||||
######################################################
|
||||
|
||||
if _command_exists apt
|
||||
then
|
||||
alias apts='apt-cache search'
|
||||
alias aptshow='apt-cache show'
|
||||
alias aptinst='sudo apt-get install -V'
|
||||
|
|
@ -22,6 +29,10 @@ function _set_pkg_aliases() {
|
|||
|
||||
alias pkgfiles='dpkg --listfiles'
|
||||
fi
|
||||
|
||||
############### Stack_TRACE_BUILDER ################
|
||||
Function_PATH="$( dirname ${Function_PATH} )"
|
||||
####################################################
|
||||
}
|
||||
|
||||
_set_pkg_aliases
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@
|
|||
about-alias 'Curl aliases for convenience.'
|
||||
|
||||
# set apt aliases
|
||||
function _set_pkg_aliases() {
|
||||
if _command_exists curl; then
|
||||
function _set_pkg_aliases()
|
||||
{
|
||||
############ STACK_TRACE_BUILDER #####################
|
||||
Function_Name="${FUNCNAME[0]}"
|
||||
Function_PATH="${Function_PATH}/${Function_Name}"
|
||||
######################################################
|
||||
|
||||
if _command_exists curl
|
||||
then
|
||||
# follow redirects
|
||||
alias cl='curl -L'
|
||||
# follow redirects, download as original name
|
||||
|
|
@ -17,6 +24,10 @@ function _set_pkg_aliases() {
|
|||
# see only response headers from a get request
|
||||
alias clhead='curl -D - -so /dev/null'
|
||||
fi
|
||||
|
||||
############### Stack_TRACE_BUILDER ################
|
||||
Function_PATH="$( dirname ${Function_PATH} )"
|
||||
####################################################
|
||||
}
|
||||
|
||||
_set_pkg_aliases
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ case $OSTYPE in
|
|||
;;
|
||||
esac
|
||||
|
||||
if _bash-it-component-item-is-enabled plugin docker; then
|
||||
if _bash-it-component-item-is-enabled plugin docker
|
||||
then
|
||||
# Function aliases from docker plugin:
|
||||
alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container
|
||||
alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
about-alias 'fuck/please to retry last command with sudo'
|
||||
|
||||
# Play nicely with 'thefuck' plugin
|
||||
if ! _command_exists fuck; then
|
||||
if ! _command_exists fuck
|
||||
then
|
||||
alias fuck='sudo $(fc -ln -1)'
|
||||
fi
|
||||
alias please=fuck
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'general aliases'
|
||||
|
||||
if command ls --color -d . &> /dev/null; then
|
||||
if command ls --color -d . &> /dev/null
|
||||
then
|
||||
alias ls='ls --color=auto'
|
||||
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
|
||||
fi
|
||||
|
|
@ -23,11 +24,13 @@ 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 command 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
|
||||
|
||||
if _command_exists gshuf; then
|
||||
if _command_exists gshuf
|
||||
then
|
||||
alias shuf=gshuf
|
||||
fi
|
||||
|
||||
|
|
@ -60,7 +63,8 @@ alias -- -='cd -' # Go back
|
|||
alias h='history'
|
||||
|
||||
# Tree
|
||||
if ! _command_exists tree; then
|
||||
if ! _command_exists tree
|
||||
then
|
||||
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
|
||||
fi
|
||||
|
||||
|
|
@ -72,14 +76,25 @@ alias rd='rmdir'
|
|||
alias xt='extract'
|
||||
|
||||
# Display whatever file is regular file or folder
|
||||
function catt() {
|
||||
for i in "$@"; do
|
||||
if [[ -d "$i" ]]; then
|
||||
function catt()
|
||||
{
|
||||
############ STACK_TRACE_BUILDER #####################
|
||||
Function_Name="${FUNCNAME[0]}"
|
||||
Function_PATH="${Function_PATH}/${Function_Name}"
|
||||
######################################################
|
||||
|
||||
for i in "${@}"; do
|
||||
if [[ -d "$i" ]]
|
||||
then
|
||||
ls "$i"
|
||||
else
|
||||
cat "$i"
|
||||
fi
|
||||
done
|
||||
|
||||
############### Stack_TRACE_BUILDER ################
|
||||
Function_PATH="$( dirname ${Function_PATH} )"
|
||||
####################################################
|
||||
}
|
||||
|
||||
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
|
||||
|
|
@ -89,4 +104,4 @@ function catt() {
|
|||
# bash-it disable alias general
|
||||
# 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"
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ alias ggui='git gui'
|
|||
# home
|
||||
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
|
||||
# appendage to ghm
|
||||
if ! _command_exists gh; then
|
||||
if ! _command_exists gh
|
||||
then
|
||||
alias gh='ghm'
|
||||
fi
|
||||
|
||||
|
|
@ -199,14 +200,35 @@ case $OSTYPE in
|
|||
esac
|
||||
|
||||
# functions
|
||||
function gdv() {
|
||||
git diff --ignore-all-space "$@" | vim -R -
|
||||
function gdv()
|
||||
{
|
||||
############ STACK_TRACE_BUILDER #####################
|
||||
Function_Name="${FUNCNAME[0]}"
|
||||
Function_PATH="${Function_PATH}/${Function_Name}"
|
||||
######################################################
|
||||
|
||||
git diff --ignore-all-space "${@}" | vim -R -
|
||||
|
||||
############### Stack_TRACE_BUILDER ################
|
||||
Function_PATH="$( dirname ${Function_PATH} )"
|
||||
####################################################
|
||||
}
|
||||
|
||||
function get_default_branch() {
|
||||
if git branch | grep -q '^. main\s*$'; then
|
||||
function get_default_branch()
|
||||
{
|
||||
############ STACK_TRACE_BUILDER #####################
|
||||
Function_Name="${FUNCNAME[0]}"
|
||||
Function_PATH="${Function_PATH}/${Function_Name}"
|
||||
######################################################
|
||||
|
||||
if git branch | grep -q '^. main\s*$'
|
||||
then
|
||||
echo main
|
||||
else
|
||||
echo master
|
||||
fi
|
||||
|
||||
############### Stack_TRACE_BUILDER ################
|
||||
Function_PATH="$( dirname ${Function_PATH} )"
|
||||
####################################################
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'kubectl aliases'
|
||||
|
||||
if _command_exists kubectl; then
|
||||
if _command_exists kubectl
|
||||
then
|
||||
alias kc='kubectl'
|
||||
alias kcgp='kubectl get pods'
|
||||
alias kcgd='kubectl get deployments'
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ alias skype='open -a Skype'
|
|||
alias mou='open -a Mou'
|
||||
alias subl='open -a "Sublime Text"'
|
||||
|
||||
if [[ -s /usr/bin/firefox ]]; then
|
||||
if [[ -s /usr/bin/firefox ]]
|
||||
then
|
||||
unalias firefox
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'uuidgen aliases'
|
||||
|
||||
if _command_exists uuid; then # Linux
|
||||
if _command_exists uuid
|
||||
then # Linux
|
||||
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
|
||||
alias uuidl=uuid
|
||||
elif _command_exists uuidgen; then # macOS/BSD
|
||||
elif _command_exists uuidgen
|
||||
then # macOS/BSD
|
||||
alias uuidu="uuidgen"
|
||||
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
|
||||
alias uuidl=uuid
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ alias vimh='vim -c ":h | only"'
|
|||
|
||||
# open vim in new tab is taken from
|
||||
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
|
||||
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
|
||||
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
|
||||
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "${@}" || command mvim "${@}"; }
|
||||
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "${@}" || command gvim "${@}"; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue