misc: dfm tweaks, documentation, code style

This commit is contained in:
2023-04-13 22:23:22 +03:00
parent dcd042262f
commit 5f5f79d270
5 changed files with 30 additions and 14 deletions

View File

@@ -22,4 +22,3 @@ exclude:
- ./dotbot-*/**
- ./config/astronvim/**
- ./config/nvim/**

View File

@@ -52,11 +52,16 @@ if [[ $(uname) == 'Darwin' ]]; then
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
fi
alias watchx='watch -dpbc' # watch with: differences, precise, beep and color
# watch with: differences, precise, beep and color
alias watchx='watch -dpbc'
# delete .DS_Store files
alias zapds='find . -name ".DS_Store" -print -delete'
alias t='tail -f' # tail with follow flag on
alias dn='du -chd1' # directory usage, return only the total
alias mirrorsite='wget -m -k -K -E -e robots=off' # Mirror site
# tail with follow flag on
alias t='tail -f'
# directory usage, return only the total
alias dn='du -chd1'
# Mirror site with wget
alias mirror_site='wget -m -k -K -E -e robots=off'
# Mirror stdout to stderr, useful for seeing data going through a pipe
alias peek='tee >(cat 1>&2)'

View File

@@ -41,4 +41,3 @@ source "$DOTFILES/config/exports-apps"
if command -v nvim &> /dev/null; then
export EDITOR="nvim"
fi

View File

@@ -66,17 +66,23 @@ function silent
"$@" >&/dev/null
}
# Remove directory from the PATH variable
# usage: path_remove ~/.local/bin
function path_remove
{
PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')
}
# Append directory to the PATH
# usage: path_append ~/.local/bin
function path_append
{
path_remove "$1"
PATH="${PATH:+"$PATH:"}$1"
}
# Prepend directory to the PATH
# usage: path_prepend ~/.local/bin
function path_prepend
{
path_remove "$1"
@@ -108,4 +114,3 @@ function x-default-antigen-bundles
hash python 2> /dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
hash rvm 2> /dev/null && antigen bundle unixorn/rvm-plugin
}

View File

@@ -15,6 +15,8 @@
SCRIPT=$(basename "$0")
VERSION_NVM="v0.39.3"
# shellcheck source=./../../scripts/shared.sh
source "$DOTFILES/scripts/shared.sh"
@@ -29,8 +31,9 @@ function section_install
$0 install starship
$0 brew install
$0 install composer
$0 install dotenv-linter
$0 install dotenv
$0 install gh
$0 install go
$0 install imagick
$0 install nvm
$0 install npm
@@ -45,7 +48,7 @@ function section_install
bash "$DOTFILES/scripts/install-composer.sh" \
&& msg_done "🎉 composer installed!"
;;
dotenv-linter)
dotenv)
curl -sSfL \
https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh \
| sh -s -- -b "$XDG_BIN_HOME" \
@@ -55,6 +58,10 @@ function section_install
bash "$DOTFILES/scripts/install-gh-extensions.sh" \
&& msg_done "🎉 github cli extensions installed!"
;;
go)
bash "$DOTFILES/scripts/install-go-packages.sh" \
&& msg_done "🎉 go packages installed!"
;;
imagick)
wget https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
&& msg_done "🎉 imagick installed!"
@@ -68,9 +75,9 @@ function section_install
&& msg_done "🎉 Brewfile defined apps has been installed!"
;;
nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \
&& git checkout "$HOME/.zshrc" \
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash \
&& nvm install --lts --latest-npm --default \
&& git checkout "$HOME/.zshrc" \
&& msg_done "🎉 nvm installed!"
;;
npm)
@@ -83,15 +90,16 @@ function section_install
;;
z)
bash "$DOTFILES/scripts/install-z.sh" \
&& msg_done "🎉 Z has been installed!"
&& msg_done "🎉 z has been installed!"
;;
*)
menu_section "$USAGE_PREFIX" "all | antigen | composer | dotenv-linter | imagick | starship | macos | nvm | npm"
menu_section "$USAGE_PREFIX" "all | antigen | composer | dotenv | gh | go | imagick | starship | macos | nvm | npm"
menu_item "all" "Installs macos defaults, antigen, starship, brew, nvm, npm packages and others"
menu_item "antigen" "Updates the antigen.zsh file"
menu_item "composer" "Install composer"
menu_item "dotenv-linter" "Install dotenv-linter"
menu_item "dotenv" "Install dotenv-linter"
menu_item "gh" "Install GitHub CLI Extensions"
menu_item "go" "Install Go Packages"
menu_item "imagick" "Install ImageMagick CLI"
menu_item "starship" "Install starship.rs"
menu_item "macos" "Setup nice macOS defaults"