zsh: all aliases now use single quotes, unless they shouldn't
This commit is contained in:
parent
a6070c8348
commit
f7ba268e24
1 changed files with 25 additions and 41 deletions
66
.zshrc
66
.zshrc
|
@ -4,9 +4,6 @@
|
||||||
### Basic shell configuration >>>
|
### Basic shell configuration >>>
|
||||||
### Environment variables >>>
|
### Environment variables >>>
|
||||||
{
|
{
|
||||||
# optionally source an external environment variable file
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc"
|
|
||||||
|
|
||||||
# Intelligently set $EDITOR
|
# Intelligently set $EDITOR
|
||||||
if command -v nvim > /dev/null;then
|
if command -v nvim > /dev/null;then
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
@ -43,18 +40,19 @@
|
||||||
COMPLETION_WAITING_DOTS=true
|
COMPLETION_WAITING_DOTS=true
|
||||||
}
|
}
|
||||||
# <<<
|
# <<<
|
||||||
|
|
||||||
|
# optionally source an external environment variable file
|
||||||
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc"
|
||||||
}
|
}
|
||||||
# <<<
|
# <<<
|
||||||
### Aliases >>>
|
### Aliases >>>
|
||||||
{
|
{
|
||||||
# optionally source an external alias file
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
|
||||||
## Short hand programs (ex: sc = shellcheck) >>>
|
## Short hand programs (ex: sc = shellcheck) >>>
|
||||||
# use nvim rather than vim if the command exists
|
# use nvim rather than vim if the command exists
|
||||||
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
|
[ -x "$(command -v nvim)" ] && alias vim='nvim' vimdiff='nvim -d'
|
||||||
|
|
||||||
alias vv="$EDITOR"
|
alias vv="$EDITOR"
|
||||||
alias sedit="sudoedit"
|
alias sedit='sudoedit'
|
||||||
|
|
||||||
# I do this too much by accident smh my head
|
# I do this too much by accident smh my head
|
||||||
alias :q='exit' \
|
alias :q='exit' \
|
||||||
|
@ -79,22 +77,23 @@
|
||||||
|
|
||||||
# <<<
|
# <<<
|
||||||
## Program improvements (ex: ls = ls -h) >>>
|
## Program improvements (ex: ls = ls -h) >>>
|
||||||
alias sudo="sudo " # allow using aliases in sudo commands
|
alias sudo='sudo ' # allow using aliases in sudo commands
|
||||||
alias df='df -h' # Human-readable sizes
|
alias df='df -h' # Human-readable sizes
|
||||||
alias free='free -m' # Show sizes in MB
|
alias free='free -m' # Show sizes in MB
|
||||||
alias bc="bc -ql" # Make bc usable for fast math
|
alias bc='bc -ql' # Make bc usable for fast math
|
||||||
|
alias glow='glow -p' # Glow preview in `less`
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
alias \
|
alias \
|
||||||
ls="ls -hN --color=auto --group-directories-first" \
|
ls='ls -hN --color=auto --group-directories-first' \
|
||||||
grep="grep --color=auto" \
|
grep='grep --color=auto' \
|
||||||
diff="diff --color=auto" \
|
diff='diff --color=auto' \
|
||||||
pacman="pacman --color=auto" \
|
pacman='pacman --color=auto' \
|
||||||
paru="paru --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --skipreview" \
|
paru='paru --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --skipreview' \
|
||||||
|
|
||||||
command -v lsd > /dev/null && alias \
|
command -v lsd > /dev/null && alias \
|
||||||
ls=lsd \
|
ls=lsd \
|
||||||
lsd="lsd --group-dirs=first" \
|
lsd='lsd --group-dirs=first' \
|
||||||
|
|
||||||
# <<<
|
# <<<
|
||||||
## Mini short-hand scripts (ex: la = ls -a) >>>
|
## Mini short-hand scripts (ex: la = ls -a) >>>
|
||||||
|
@ -105,29 +104,13 @@
|
||||||
|
|
||||||
# Edit config files
|
# Edit config files
|
||||||
alias \
|
alias \
|
||||||
nvc="(cd ~/.config/nvim/lua/blake && nvim ../../init.lua)" \
|
nvc='(cd ~/.config/nvim/lua/blake && nvim ../../init.lua)' \
|
||||||
zshrc="$EDITOR ~/.zshrc" \
|
zshrc='$EDITOR ~/.zshrc' \
|
||||||
fstab="sudoedit /etc/fstab" \
|
fstab='sudoedit /etc/fstab' \
|
||||||
sedit="sudoedit"
|
|
||||||
|
|
||||||
# Git cLONE
|
# Git cLONE
|
||||||
alias glone="git clone"
|
alias glone="git clone"
|
||||||
|
|
||||||
# random number generation
|
|
||||||
alias \
|
|
||||||
rnd="echo 'Use the the shuf command:' && echo 'shuf --random-source=\"/dev/random\" -i (range, ex: 0-9) -n (number of random numbers)'" \
|
|
||||||
rand=rnd
|
|
||||||
|
|
||||||
# Graphical
|
|
||||||
alias \
|
|
||||||
restart-gnome='killall -SIGQUIT gnome-shell' \
|
|
||||||
lsx='ls /tmp/.X11-unix | tr "X" ":"' \
|
|
||||||
|
|
||||||
# tar is a dumb program...
|
|
||||||
alias \
|
|
||||||
tarc='tar -c --use-compress-program=pigz -f' \
|
|
||||||
tarx=ext \
|
|
||||||
|
|
||||||
# Docker
|
# Docker
|
||||||
alias \
|
alias \
|
||||||
logs='docker-compose logs --tail=200 -f' \
|
logs='docker-compose logs --tail=200 -f' \
|
||||||
|
@ -156,13 +139,12 @@
|
||||||
alias fds='fd --hidden --exclude /run'
|
alias fds='fd --hidden --exclude /run'
|
||||||
|
|
||||||
# <<<
|
# <<<
|
||||||
|
# optionally source an external alias file
|
||||||
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
||||||
}
|
}
|
||||||
# <<<
|
# <<<
|
||||||
### Functions >>>
|
### Functions >>>
|
||||||
{
|
{
|
||||||
# optionally source an external function file
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc"
|
|
||||||
|
|
||||||
# cd search: cd to a directory, given part of its name
|
# cd search: cd to a directory, given part of its name
|
||||||
# (also can take arguments for an `fd` commnd)
|
# (also can take arguments for an `fd` commnd)
|
||||||
cds() {
|
cds() {
|
||||||
|
@ -392,6 +374,9 @@
|
||||||
calc() {
|
calc() {
|
||||||
echo $(($*))
|
echo $(($*))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# optionally source an external function file
|
||||||
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc"
|
||||||
}
|
}
|
||||||
# <<<
|
# <<<
|
||||||
# <<<
|
# <<<
|
||||||
|
@ -469,7 +454,7 @@
|
||||||
}
|
}
|
||||||
# <<<
|
# <<<
|
||||||
### General ZSH configuration >>>
|
### General ZSH configuration >>>
|
||||||
# This section is (mostly) From manjaro's "manjaro-zsh-config" (/usr/share/zsh/manjaro-zsh-config) #
|
# This section is (mostly) From manjaro's "manjaro-zsh-config" (/usr/share/zsh/manjaro-zsh-config)
|
||||||
|
|
||||||
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
|
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
|
||||||
|
|
||||||
|
@ -705,6 +690,5 @@ cd - > /dev/null
|
||||||
# Optionally source the user's customized .zshrc
|
# Optionally source the user's customized .zshrc
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0
|
||||||
|
|
||||||
# filetype is sh for language server
|
|
||||||
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3
|
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue