smart alias

main
Yax 2 years ago
parent 64c8509dac
commit 04356602bd

@ -133,6 +133,8 @@ if hash nix-env 2>/dev/null; then
alias nix-update='nix-channel --update && nix-env -u' alias nix-update='nix-channel --update && nix-env -u'
fi fi
alias cdd='cd {{ .deploydir }}'
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# COMPLETIONS # COMPLETIONS
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

@ -1,4 +1,5 @@
# fzf # fzf
if hash fzf 2>/dev/null; then
source ~/.fzf-completion.bash source ~/.fzf-completion.bash
source ~/.fzf-keybindings.bash source ~/.fzf-keybindings.bash
@ -34,3 +35,4 @@ fzg() {
${EDITOR:-vim} $file +$line ${EDITOR:-vim} $file +$line
fi fi
} }
fi

@ -1,28 +0,0 @@
# fstash - easier way to deal with stashes
# type fstash to get a list of your stashes
# enter shows you the contents of the stash
# ctrl-d shows a diff of the stash against your current HEAD
# ctrl-b checks the stash out as a branch, for easier merging
fstash() {
local out q k sha
while out=$(
git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" |
fzf --ansi --no-sort --query="$q" --print-query \
--expect=ctrl-d,ctrl-b);
do
mapfile -t out <<< "$out"
q="${out[0]}"
k="${out[1]}"
sha="${out[-1]}"
sha="${sha%% *}"
[[ -z "$sha" ]] && continue
if [[ "$k" == 'ctrl-d' ]]; then
git diff $sha
elif [[ "$k" == 'ctrl-b' ]]; then
git stash branch "stash-$sha" $sha
break;
else
git stash show -p $sha
fi
done
}

@ -1,7 +1,9 @@
# Java alternatives # java
if hash sdk 2>/dev/null; then
alias java6='sdk use java {{ .java6_version }}' alias java6='sdk use java {{ .java6_version }}'
alias java7='sdk use java {{ .java7_version }}' alias java7='sdk use java {{ .java7_version }}'
alias java8='sdk use java {{ .java8_version }}' alias java8='sdk use java {{ .java8_version }}'
alias java11='sdk use java {{ .java11_version}}' alias java11='sdk use java {{ .java11_version}}'
alias jv='java -version' alias jv='java -version'
fi

@ -1,9 +1,5 @@
# alias and set var
alias cdd='cd {{ .deploydir }}'
export cdd={{ .deploydir }}
# maven # maven
if hash mvn 2>/dev/null; then
if [ -f "{{ .java_truststore_file }}" ]; then if [ -f "{{ .java_truststore_file }}" ]; then
alias m='mvn -Djavax.net.ssl.trustStore={{ .java_truststore_file }} -Djavax.net.ssl.trustStorePassword={{ .java_truststore_password }}' alias m='mvn -Djavax.net.ssl.trustStore={{ .java_truststore_file }} -Djavax.net.ssl.trustStorePassword={{ .java_truststore_password }}'
else else
@ -15,4 +11,4 @@ alias mvni='m -Dmaven.test.skip -Dmaven.javadoc.skip=true clean install'
# copy maven artifact # copy maven artifact
alias d='python3 ~/.local/bin/deploy.py' alias d='python3 ~/.local/bin/deploy.py'
fi

@ -1,4 +1,4 @@
# Node # node
if [ -f "{{ .extra_ca_cert }}" ]; then if [ -f "{{ .extra_ca_cert }}" ]; then
export NODE_EXTRA_CA_CERTS={{ .extra_ca_cert }} export NODE_EXTRA_CA_CERTS={{ .extra_ca_cert }}
fi fi
@ -16,5 +16,3 @@ if [ -d "$HOME/.nvm" ]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi fi

@ -1,6 +1,4 @@
# ------------------------------------------------------------- # python
# PYTHON
# -------------------------------------------------------------
# pyenv # pyenv
if [ -d "$HOME/.pyenv" ]; then if [ -d "$HOME/.pyenv" ]; then

@ -1,4 +1,3 @@
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman" export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

Loading…
Cancel
Save