From fa1c9436aca51d436d89443c3b993ad2dc01a014 Mon Sep 17 00:00:00 2001 From: perro Date: Sat, 1 Jul 2023 10:15:29 -0700 Subject: [PATCH] =?UTF-8?q?Actualizaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aliases.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/aliases.sh b/aliases.sh index 89cdcaf..7d18500 100644 --- a/aliases.sh +++ b/aliases.sh @@ -74,6 +74,7 @@ alias pip='pip3' alias python='python3' alias ipython='ipython3' alias selene="selene --config $HOME/.config/selene/config.toml" +alias stylua="stylua --config-path $HOME/.config/stylua/config.toml" ## Acciones @@ -529,7 +530,7 @@ git () { pymp () { case $1 in -f | formatear | format) - black --line-length $LENGTH ${@:$#} ;; + black --line-length $LENGTH ${@:$#} --quiet ;; -h | --help | help | ayuda) pymp-help ;; esac @@ -561,9 +562,21 @@ Ejemplos: c () { if [[ $1 == *.json ]]; then - cat $@ | jq | bat -l json + cat $@ | jq | bat --file-name $1 --language json else bat $@ fi } +# Da formato a archivos +format () { + if [[ $1 == *.md ]]; then + md format $1 + elif [[ $1 == *.py ]]; then + pymp format $1 + elif [[ $1 == *.lua ]]; then + stylua $1 + elif [[ $1 == *.rs ]]; then + rustfmt $1 + fi +}