Add aliases from mac-dotfiles repo

https://github.com/saibotk/mac-dotfiles/blob/main/aliases.zsh
This commit is contained in:
saibotk 2022-04-17 19:47:21 +02:00
parent ae59306d0b
commit f338ff46c1
Signed by: saibotk
GPG key ID: 67585F0065E261D5
3 changed files with 56 additions and 13 deletions

View file

@ -1,6 +1,9 @@
# Load common config environment variables
source config.env
# Load aliases
source $DOTFILES/zsh/aliases.zsh
# Load zsh-snap (znap) plugin manager
zstyle ':znap:*' repos-dir ~/.znap
source ~/.znap/znap/znap.zsh
@ -11,6 +14,11 @@ _has() {
return $( whence $1 >/dev/null )
}
# autocomplete settings
zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:*' fzf-completion yes
zstyle ':autocomplete:*' min-input 2
# Plugins
znap source ohmyzsh/ohmyzsh lib/{git,theme-and-appearance}
znap source ohmyzsh/ohmyzsh plugins/{per-directory-history,git}
@ -24,11 +32,6 @@ znap source unixorn/fzf-zsh-plugin
# Extra init code needed for zcolors.
znap eval zcolors "zcolors ${(q)LS_COLORS}"
# autocomplete settings
zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:*' fzf-completion yes
zstyle ':autocomplete:*' min-input 2
# ZSH prompt
if _has starship;
then
@ -38,14 +41,6 @@ else
znap prompt ohmyzsh/ohmyzsh robbyrussell
fi
# aliases
alias ll='ls -l'
alias la='ls -la'
alias :q='exit'
alias fresh="source ~/.zshrc"
alias yarn="firejail yarn"
alias npm="firejail npm"
# localcommands
if [ -f $DOTFILES/zsh/localcommands ]
then

47
zsh/aliases.zsh Normal file
View file

@ -0,0 +1,47 @@
# Shortcuts
alias copyssh="cat $HOME/.ssh/id_rsa.pub | xclip -sel clip"
alias reloadshell="source $HOME/.zshrc"
alias ll="ls -AhlFo --color --group-directories-first"
alias shrug="echo '¯\_(ツ)_/¯' | xclip -sel clip"
alias c="clear"
alias compile="commit 'compile'"
alias version="commit 'version'"
# Directories
alias dotfiles="cd $DOTFILES"
# Laravel
alias a="php artisan"
alias mfs="php artisan migrate:fresh --seed"
alias tinker="php artisan tinker"
alias seed="php artisan db:seed"
alias serve="php artisan serve"
# PHP
alias cfresh="rm -rf vendor/ composer.lock && composer i"
# JS
alias nfresh="rm -rf node_modules/ package-lock.json && npm install"
alias watch="npm run watch"
# Git
alias gst="git status"
alias gb="git branch"
alias gc="git checkout"
alias gl="git log --oneline --decorate --color"
alias amend="git add . && git commit --amend --no-edit"
alias commit="git add . && git commit -m"
alias diff="git diff"
alias force="git push --force"
alias nuke="git clean -df && git reset --hard"
alias pop="git stash pop"
alias pull="git pull"
alias push="git push"
alias resolve="git add . && git commit --no-edit"
alias stash="git stash -u"
alias unstage="git restore --staged ."
alias wip="commit wip"
# Linux aliases
alias yarn="firejail yarn"
alias npm="firejail npm"

1
zsh/config.env Symbolic link
View file

@ -0,0 +1 @@
../config.env