From f338ff46c1a972cb704386be5c99a064e34dc33a Mon Sep 17 00:00:00 2001 From: saibotk Date: Sun, 17 Apr 2022 19:47:21 +0200 Subject: [PATCH] Add aliases from mac-dotfiles repo https://github.com/saibotk/mac-dotfiles/blob/main/aliases.zsh --- zsh/{zshrc => .zshrc} | 21 ++++++++----------- zsh/aliases.zsh | 47 +++++++++++++++++++++++++++++++++++++++++++ zsh/config.env | 1 + 3 files changed, 56 insertions(+), 13 deletions(-) rename zsh/{zshrc => .zshrc} (92%) create mode 100644 zsh/aliases.zsh create mode 120000 zsh/config.env diff --git a/zsh/zshrc b/zsh/.zshrc similarity index 92% rename from zsh/zshrc rename to zsh/.zshrc index c0dac13..87c2b33 100644 --- a/zsh/zshrc +++ b/zsh/.zshrc @@ -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 diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh new file mode 100644 index 0000000..889e7f3 --- /dev/null +++ b/zsh/aliases.zsh @@ -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" \ No newline at end of file diff --git a/zsh/config.env b/zsh/config.env new file mode 120000 index 0000000..b0ba453 --- /dev/null +++ b/zsh/config.env @@ -0,0 +1 @@ +../config.env \ No newline at end of file