diff --git a/.gitignore b/.gitignore index 58aeb98..4373db2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmux/.config/tmux/plugins/tpm/ node_modules/ zsh/.config/zsh/envs/ zshrc +nvim/.config/nvim/lazy-lock.json diff --git a/asdf/.config/asdf/.asdfrc b/asdf/.config/asdf/.asdfrc index 5618ed4..60b7bf8 100644 --- a/asdf/.config/asdf/.asdfrc +++ b/asdf/.config/asdf/.asdfrc @@ -23,7 +23,7 @@ use_release_candidates = no # * ASDF_DEFAULT_TOOL_VERSIONS_FILENAME - The name of the file storing the tool names and versions. # Defaults to .tool-versions. Can be any valid file name. -# Mac OS X +# Mac OS X # --------- # Some applications in macOS use `/usr/libexec/java_home` to set java home. # Setting java_macos_integration_enable to yes on .asdfrc file enables this integration. diff --git a/asdf/.config/asdf/default-ctags b/asdf/.config/asdf/default-ctags deleted file mode 100644 index 5c5fdb0..0000000 --- a/asdf/.config/asdf/default-ctags +++ /dev/null @@ -1,165 +0,0 @@ ---recurse ---exclude=*.bundle.*.js ---exclude=.*bundle.* ---exclude=*.class ---exclude=*.ftl ---exclude=*.jar ---exclude=*.log ---exclude=*.min.* ---exclude=*.min.css ---exclude=*.min.js ---exclude=*.mock.js ---exclude=*.pack.js ---exclude=*.sass ---exclude=*.spec.* ---exclude=*.sql ---exclude=*.stories.* ---exclude=*.tar.* ---exclude=*.test.* ---exclude=*.test.js ---exclude=*.war ---exclude=*flymake* ---exclude=.#* ---exclude=.dll ---exclude=.git ---exclude=.map ---exclude=.pdb ---exclude=.pyc ---exclude=.sln ---exclude=.swp ---exclude=.tmp ---exclude=GPATH ---exclude=GRTAGS ---exclude=GTAGS ---exclude=TAGS ---exclude=bower_components ---exclude=bundle.*.js ---exclude=coverage ---exclude=dist ---exclude=min ---exclude=node_modules/ ---exclude=tags ---exclude=test ---exclude=tests ---exclude=vendor ---recurse=yes ---c-kinds=+defgpstux ---tag-relative=yes - ---langdef=less ---langmap=less:.less ---regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/ ---regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/ ---regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/ ---regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/ ---regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/ ---regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/ - ---langmap=java:+.aj - ---langdef=dockerfile ---langmap=dockerfile:+(Dockerfile) ---regex-dockerfile=/^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)/\1/d,dockerfile,dockerfiles/ - ---langmap=ruby:+.rake ---regex-ruby=/(^|[:;])[ \t]*([:upper:][[:alnum:]_]+) *=/\2/v,variable/ ---regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function/ ---regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function/ ---regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function/ ---regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function/ - ---langdef=json ---langmap=json:.json ---regex-json=/^[ \t]*"(.*)":/\1/k,key,keys/ - ---langmap=javascript:.js.ts ---regex-javascript=/^[ \t]*([A-Z]+_[A-Z0-9_]+)[ \t]*[:=]/\1/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*=[ \t]*\[/\2/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([:upper:][[:alnum:]_$]+)[ \t]*=[ \t]*function/\2/f,function/ ---regex-javascript=/^[ \t]*(export)?[ \t]*class[ \t]+([[:alnum:]_$]+)/\2/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\3/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\5/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\7/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)/\2/v,variable/ ---regex-javascript=/^[ \t]*export[ \t]+function[ \t]+([[:alnum:]_$]+)/\1/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[^,]+,[ \t]*([[:alnum:]_$]+)/\3/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[^,]+,[ \t]*([[:alnum:]_$]+)[ \t]*,[ \t]*([[:alnum:]_$]+)/\4/v,variable/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\3/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\5/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(\{[ \t]*)*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])*([[:alnum:]_]+),[ \t]*([[:alnum:]_\*]*[ \t]as[ \t])([[:alnum:]_]+)/\7/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)/\2/v,variable/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+function[ \t]+([[:alnum:]_$]+)/\1/f,function/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[^,]+,[ \t]*([[:alnum:]_$]+)/\3/v,variable/ ---regex-javascript=/^[ \t]*export[ \t]+default[ \t]+(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[^,]+,[ \t]*([[:alnum:]_$]+)[ \t]*,[ \t]*([[:alnum:]_$]+)/\4/v,variable/ ---regex-javascript=/^[ \t]*\(?async[ \t]function[ \t]*([[:alnum:]_$]+)[ \t(]/\1/f,function/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([_[:lower:]][[:alnum:]_$]+)[ \t]*=[ \t]*(async[ \t]+)?function[^\*][^\*]/\2/f,function/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([_[:lower:]][[:alnum:]_$]+)[ \t]*=[ \t]*\([^\)]*$/\2/f,function/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([_[:lower:]][[:alnum:]_$]+)[ \t]*=[^=]*=>/\2/f,function/ ---regex-javascript=/^[ \t]*function[ \t]*\*[ \t]*([[:alnum:]_$]+)/\1/f,function/ ---regex-javascript=/^[ \t]*(\*[ \t])([[:alnum:]_$]+)[ \t]*(.*)[ \t]*\{/\2/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)\.([[:alnum:]_$]+)[ \t]*=[ \t]*\(/\2/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)\.([[:alnum:]_$]+)\.([[:alnum:]_$]+)[ \t]*=[ \t]*function/\3/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)\.([[:alnum:]_$]+)\.([[:alnum:]_$]+)[ \t]*=[ \t]*\(/\3/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)[ \t]*[:=][ \t]*[\(]*function[ \t]*\(/\1/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)[ \t]*[:=][ \t]\(/\1/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)[ \t]*[:=][ \t]+async[ \t]\(+/\1/f,function/ ---regex-javascript=/^[ \t]*(static|async)[ \t]+([[:alnum:]_$]+)[ \t]*\(/\2/f,function/ ---regex-javascript=/^[ \t]*get[ \t]+([[:alnum:]_$]+)[ \t]*\(/\1/f,function/ ---regex-javascript=/^[ \t]*set[ \t]+([[:alnum:]_$]+)[ \t]*\(/\1/f,function/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)\.([[:alnum:]_$]+)[ \t]*=[ \t]*\{/\2/v,variable/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)[ \t]*:[ \t]*[{"\/\[]/\1/v,variable/ ---regex-javascript=/^[ \t]*([[:alnum:]_$]+)[ \t]*:[ \t]*([[:alnum:]_$]+)[ \t,]*$/\1/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[=:][ \t]*['"0-9]/\2/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*[,;]/\2/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*,[ \t]*([[:alnum:]_$]+)/\3/v,variable/ ---regex-javascript=/^[ \t]*(var|let|const)[ \t]+([[:alnum:]_$]+)[ \t]*,[ \t]*([[:alnum:]_$]+)[ \t]*,[ \t]*([[:alnum:]_$]+)/\4/v,variable/ ---regex-javascript=/^[ \t]*keystone\.set\([ \t]*['"]([^'"]+)['"]/\1/v,variable/ ---regex-javascript=/(,|^|\.)[ \t]*(public *|private *|async *)?([[:alpha:]_$][[:alnum:]_$]+)[ \t]*[:=][ \t]*(function\*?[ \t]*\(|\([^\)]*\)[\t ]+=>)/\3/f,function/ ---regex-javascript=/^[ \t]*(public |async |private |static )?([[:alpha:]_$][[:alnum:]_$]{3,})[ \t]*\([[:alnum:]_$,: ]*\)[ \t]*\{/\2/f,function/ ---regex-javascript=/^[ \t]*case[ \t]+'([^']+)/\1/v,variable/ ---regex-javascript=/^[ \t]*@Input\(\)[ \t]+([[:alnum:]_$]+)/\1/v,variable/ ---regex-javascript=/^[ \t]*(constructor)[ \t]*\(/\1/f,function/ ---regex-javascript=/^[ \t]*([[:alpha:]_$][[:alnum:]_$]*):[ \t]*storeState\./\1/v,variable/ - ---langmap=html:.htm.html.erb.cmp.page.component ---regex-html=/[ \t]+ng-(controller|click|change|show|if|blur|focus|disabled|repeat)[ \t]*=[ \t]*['"][^[:alnum:]$]*([[:alnum:]$]{4,})/\2/a/ ---regex-html=/[ \t]+<(app-[[:alnum:]$-_]{3,})/\1/a/ - ---langmap=markdown:.md ---regex-markdown=/^(#[^#].*)/\1/f,function/ ---regex-markdown=/^(##[^#].*)/\1/f,function/ ---regex-markdown=/^(###[^#].{0,19})/\1/f,function/ ---regex-markdown=/^(=[^=].*)/\1/v,variable/ ---regex-markdown=/^(==[^=].*)/\1/v,variable/ ---regex-markdown=/^(===[^=].{0,19})/\1/v,variable/ - ---regex-Lua=/^.*[ \t]*function[ \t]*([:alnum:]+):([:alnum:]+)/\2/f,function/ ---regex-Lua=/^[ \t]*local[ \t]+([:alnum:]+)/\1/v,variable/ ---regex-Lua=/^.*[ \t]*function[ \t]*([:alnum:]+)\.([:alnum:]+).*$/\2/f,function/ ---regex-Lua=/^.*[ \t]*function[ \t]*([:alnum:]+)[ \t]*\(/\1/f,function/ ---regex-Lua=/^[ \t]*([:alnum:]+)[ \t]*=[ \t]*\{/\1/f,function/ ---regex-Lua=/^[ \t]*module[ \t]+([:alnum:]+)\/\1/f,function/ ---regex-Lua=/^[ \t]*module[ \t]+[[:alnum:]._]+\.([:alnum:]+)\/\1/f,function/ - ---langdef=ini ---langmap=ini:.ini ---regex-ini=/^[ \t]*\[(.*)\]/\1/v,variable/ ---regex-ini=/^[ \t]*([^=]+)=(.*)/\1/v,variable/ - ---langmap=Go:.go ---regex-Go=/func([ \t]+([^)]+))?[ \t]+([[:alnum:]_]+)/\2/f,function/ ---regex-Go=/(var|type)[ \t]+([[:alpha:]_][[:alnum:]_]+)/\2/v,variable/ - ---langdef=css ---langmap=css:.css ---regex-css=/^[ \t]*\.?([[:alnum:]_:\\-]+)[ \t]*\{[ \t]*$/\1/v,variable/ ---regex-css=/^[ \t]*\.?[[:alnum:]_:\\-]+,[ \t]*\.?([[:alnum:]_:\\-]+)\{[ \t]*$/\1/v,variable/ ---regex-css=/^[ \t]*\.?[[:alnum:]_:\\-]+,[ \t]*\.?[[:alnum:]_:\\-]+,[ \t]*\.?([[:alnum:]_:\\-]+)\{[ \t]*$/\1/v,variable/ ---regex-css=/^[ \t]*@define-mixin[ \t]+([^ ]+)/\1/f,function/ - - ---langdef=yaml ---langmap=yaml:.yml.yaml ---regex-yaml=/^[ \t]*(.*):/\1/k,key,keys/ diff --git a/asdf/.config/asdf/default-gems b/asdf/.config/asdf/default-gems-packages similarity index 100% rename from asdf/.config/asdf/default-gems rename to asdf/.config/asdf/default-gems-packages diff --git a/asdf/.config/asdf/default-golang-pkgs b/asdf/.config/asdf/default-golang-packages similarity index 56% rename from asdf/.config/asdf/default-golang-pkgs rename to asdf/.config/asdf/default-golang-packages index bfcd7cd..cdc5303 100644 --- a/asdf/.config/asdf/default-golang-pkgs +++ b/asdf/.config/asdf/default-golang-packages @@ -1,3 +1,3 @@ // allows comments github.com/Dreamacro/clash -github.com/jesseduffield/lazygit \ No newline at end of file +//github.com/jesseduffield/lazygit diff --git a/asdf/.config/asdf/default-npm-packages b/asdf/.config/asdf/default-npm-packages index 772ea50..1532093 100644 --- a/asdf/.config/asdf/default-npm-packages +++ b/asdf/.config/asdf/default-npm-packages @@ -12,4 +12,3 @@ request ts-node typescript typescript-language-server - diff --git a/git/.config/git/config b/git/.config/git/config index eccfe20..c4300d6 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -20,7 +20,7 @@ defaultBranch = main [core] - excludesfile = ~/.gitignore_global + excludesfile = ~/.config/git/gitignore_global editor = nvim [github] diff --git a/installer/1password_formula.bash b/installer/1password_formula.bash index d18d0c3..8277b6f 100644 --- a/installer/1password_formula.bash +++ b/installer/1password_formula.bash @@ -7,13 +7,15 @@ # ----------------------------------------------------------------------------- function install_1password() { + echo "+----------------------------------------------------------+" + echo "| *** 🗝️ Instalador do 1Password *** |" + echo "+----------------------------------------------------------+" + if [ -f /opt/1Password/op-ssh-sign ]; then echo "✔️ 1Password já instalado." return fi - echo "🗝️ Instalando 1Password..." - case $PLATFORM_OS in Fedora) install_1password_fedora @@ -62,7 +64,7 @@ function install_1password() { function install_1password_debian_or_ubuntu() { _add_key_for_the_1Password_apt_repository_and_add_apt_repo sudo apt-get update -qq - sudo apt-get install -y 1password + sudo apt-get install -qq -y 1password } function _add_key_for_the_1Password_apt_repository_and_add_apt_repo() { @@ -96,7 +98,7 @@ function _add_key_for_the_1Password_apt_repository_and_add_apt_repo() { # ----------------------------------------------------------------------------- function install_1password_fedora() { _add_key_for_the_1Password_yum_repository - sudo dnf install -y 1password + sudo dnf install -q -y 1password } function _add_key_for_the_1Password_yum_repository() { diff --git a/installer/asdf_formula.bash b/installer/asdf_formula.bash new file mode 100644 index 0000000..51edb60 --- /dev/null +++ b/installer/asdf_formula.bash @@ -0,0 +1,59 @@ +#!/bin/bash + +function install_asdf() { + + echo "+----------------------------------------------------------+" + echo "| *** 🧩 Instalador do ASDF *** |" + echo "+----------------------------------------------------------+" + + if command -v asdf >/dev/null 2>&1; then + echo "ASDF-VM já está instalado." + return + fi + REPO="asdf-vm/asdf" + INSTALL_DIR="/usr/local/bin" + + export ASDF_DIR="$HOME/.local/share/asdf" + mkdir -p "$ASDF_DIR" + + + # Obtém a última versão do release via GitHub API + LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")') + VERSION="${LATEST_TAG#v}" # Remove o 'v' inicial, se presente + case $PLATFORM_OS in + Fedora) + ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-linux-amd64.tar.gz" + ;; + Ubuntu) + ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-linux-amd64.tar.gz" + ;; + MacOS) + ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-darwin-arm64.tar.gz" + ;; + *) + echo "Invalid option $PLATFORM_ARCH" + esac + + #ARCHIVE_URL="https://github.com/$REPO/archive/refs/tags/$LATEST_TAG.tar.gz" + + echo "Baixando $ARCHIVE_URL..." + curl -L "$ARCHIVE_URL" -o "/tmp/asdf-$LATEST_TAG.tar.gz" + + # Extrai para /usr/local/bin + echo "Extraindo para $INSTALL_DIR..." + sudo tar -xzf "/tmp/asdf-$LATEST_TAG.tar.gz" -C "$INSTALL_DIR" + + # Opcional: mostra conteúdo extraído + echo "Conteúdo extraído:" + # ln -sf "$INSTALL_DIR/asdf-$VERSION" "$INSTALL_DIR/asdf" + ls -l "$INSTALL_DIR/" | grep -i asdf + + # Limpeza + rm "/tmp/asdf-$LATEST_TAG.tar.gz" + + $INSTALL_DIR/asdf --version + echo "Instalação do asdf $VERSION concluída." + echo "Adicione o seguinte ao seu arquivo de configuração do shell (ex: ~/.zshrc ou ~/.bashrc):" + echo " source /usr/local/bin/asdf-$LATEST_TAG/asdf.sh" + echo " source /usr/local/bin/asdf-$LATEST_TAG/completions/asdf.bash" +} diff --git a/installer/bootstrap.sh b/installer/bootstrap.sh index 4a0d069..6df68f3 100755 --- a/installer/bootstrap.sh +++ b/installer/bootstrap.sh @@ -7,6 +7,7 @@ source ./installer/lazy_packages.bash source ./installer/zplug_formula.bash source ./installer/tmux_formula.bash source ./installer/1password_formula.bash +source ./installer/asdf_formula.bash export XDG_CONFIG_HOME=$HOME/.config @@ -49,6 +50,7 @@ main() { ensure_zplug_installed ensure_tmux_tpm_installed install_1password + install_asdf echo "🎉 Bootstrap concluído com sucesso!" } diff --git a/installer/brew_packages.bash b/installer/brew_packages.bash index 47afcc9..8a199e2 100644 --- a/installer/brew_packages.bash +++ b/installer/brew_packages.bash @@ -30,5 +30,6 @@ install_macos_packages() { brew "xclip" brew "editorconfig-checker" brew "zplug" + brew "coreutils" EOF } diff --git a/installer/debian_packages.bash b/installer/debian_packages.bash index ef2a57b..f4c70fb 100644 --- a/installer/debian_packages.bash +++ b/installer/debian_packages.bash @@ -5,7 +5,7 @@ install_debian_packages() { echo "🌀 Plataforma Ubuntu/Debian detectada." echo "📦 Instalando pacotes..." sudo apt-get update -qq - sudo apt-get install -y build-essential apt-transport-https curl git gnupg2 libffi-dev libpq-dev libreadline-dev lua5.3 python3 python3-dev python3-pip tmux wget xclip neovim stow zsh stow ripgrep fd-find jq tmux + sudo apt-get install -qq -y build-essential apt-transport-https curl coreutils git gnupg2 libffi-dev libpq-dev libreadline-dev lua5.3 python3 python3-dev python3-pip tmux wget xclip neovim stow zsh stow ripgrep fd-find jq tmux if ! command -v lazygit >/dev/null; then install_lazygit_from_source fi diff --git a/installer/fedora_packages.bash b/installer/fedora_packages.bash index b4782f3..6975254 100644 --- a/installer/fedora_packages.bash +++ b/installer/fedora_packages.bash @@ -8,7 +8,7 @@ install_fedora_packages() { sudo dnf groupinstall -y '@development-tools' '@development-libraries' sudo dnf install -q -y util-linux-user sudo dnf install -q -y git kernel-devel libffi-devel libpq-devel editorconfig-checker lua make nodejs python3 python3-devel python3-pip readline readline-devel tmux wget xclip - sudo dnf install -y ripgrep zsh fd-find lazygit lazydocker jq stow neovim tmux + sudo dnf install -q -y ripgrep zsh fd-find lazygit lazydocker jq stow neovim tmux if command -v fd >/dev/null; then echo "✔️ fd já instalado" diff --git a/installer/zplug_formula.bash b/installer/zplug_formula.bash index 1774323..e962d83 100644 --- a/installer/zplug_formula.bash +++ b/installer/zplug_formula.bash @@ -45,7 +45,5 @@ function creates_zsh_envs_to_zplug() { mkdir -p $XDG_CONFIG_HOME/zsh/envs fi - echo "export ZPLUG_HOME=$XDG_CONFIG_HOME/zsh/plugins/zplug" > $XDG_CONFIG_HOME/zsh/envs/zplug.env.zsh - echo "source \$ZPLUG_HOME/init.zsh" >> $XDG_CONFIG_HOME/zsh/envs/zplug.env.zsh echo "Arquivos de configuração do zsh para zplug criados com sucesso." } diff --git a/tests/01-validate-packages.test.bash b/tests/01-validate-packages.test.bash index 706197a..60e3644 100644 --- a/tests/01-validate-packages.test.bash +++ b/tests/01-validate-packages.test.bash @@ -51,6 +51,11 @@ load test_helper [ "$status" -eq 0 ] } +@test "it asdf be present" { + run command -v asdf + [ "$status" -eq 0 ] +} + # @test "it fd be present" { # run command -v fd # [ "$status" -eq 0 ] diff --git a/tests/02-stow-structure.test.bash b/tests/02-stow-structure.test.bash index fc395e9..97bcaeb 100644 --- a/tests/02-stow-structure.test.bash +++ b/tests/02-stow-structure.test.bash @@ -28,3 +28,16 @@ load test_helper @test "it MCPHUB folder in XDG_CONFIG_HOME exists in the new structure" { assert_dir_exists "$HOME/.config/mcphub" } + +@test "it asdf folder in XDG_CONFIG_HOME exists in the new structure" { + assert_dir_exists "$HOME/.config/asdf" + assert_dir_exists "$HOME/.local/share/asdf" +} + +@test "it asdf executable on /usr/local/bin exists" { + echo "DEBUG: Checking if asdf exists in /usr/local/bin PATH=$PATH" + ls -lah /usr/local/bin | grep asdf + assert_file_exists "/usr/local/bin/asdf" + run command -v asdf + [ "$status" -eq 0 ] +} diff --git a/zsh/.config/zsh/envs/asdf.env.zsh b/zsh/.config/zsh/envs/asdf.env.zsh new file mode 100644 index 0000000..c591a49 --- /dev/null +++ b/zsh/.config/zsh/envs/asdf.env.zsh @@ -0,0 +1,30 @@ +export ASDF_DIR="$HOME/.local/share/asdf" +export ASDF_DATA_DIR="${ASDF_DIR:-$HOME/.local/share}/asdf" +export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/asdfrc" + +export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed +export ASDF_NPM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-npm-packages" +export ASDF_PYTHON_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-python-packages" +export ASDF_GEM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-gem-packages" +export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-golang-packages" + +# [ -f $ASDF_HOME/asdf.sh ] && source $ASDF_HOME/asdf.sh +[ -f $ASDF_DATA_DIR/plugins/golang/set-env.zsh ] && source $ASDF_DATA_DIR/plugins/golang/set-env.zsh +[ -f $ASDF_DATA_DIR/plugins/java/set-java-home.zsh ] && source $ASDF_DATA_DIR/plugins/java/set-java-home.zsh + +export $PATH=$ASDF_DATA_DIR/shims:$PATH + +# Configs to ASDF-VM: +if [ -d $ASDF_HOME/completions/ ]; then + # append completions to fpath + fpath=($ASDF_HOME/completions $fpath) + + # initialise completions with ZSH's compinit + autoload -Uz compinit && compinit + [ -f $ASDF_HOME/completions/asdf.bash ] && source $ASDF_HOME/completions/asdf.bash +fi + + + + + diff --git a/zsh/.config/zsh/envs/zplug.env.zsh b/zsh/.config/zsh/envs/zplug.env.zsh new file mode 100644 index 0000000..8490f46 --- /dev/null +++ b/zsh/.config/zsh/envs/zplug.env.zsh @@ -0,0 +1,2 @@ +export ZPLUG_HOME=$HOME/.config/zsh/plugins/zplug +source $ZPLUG_HOME/init.zsh diff --git a/zsh/.config/zsh/zshrc b/zsh/.config/zsh/zshrc index 3dcfc71..9e70b65 100644 --- a/zsh/.config/zsh/zshrc +++ b/zsh/.config/zsh/zshrc @@ -173,7 +173,7 @@ if [ -f $ZPLUG_HOME/init.zsh ]; then # Theme - zplug "themes/agnoster", from:oh-my-zsh, as:theme + # zplug "romkatv/powerlevel10k", as:theme zplug "themes/robbyrussell", from:oh-my-zsh, as:theme zplug "dracula/zsh", as:theme zplug "JannoTjarks/catppuccin-zsh", use:catppuccin.zsh-theme, as:theme @@ -183,6 +183,7 @@ if [ -f $ZPLUG_HOME/init.zsh ]; then export CATPPUCCIN_SHOW_USER="always" + autoload -U +X bashcompinit && bashcompinit autoload -U +X compinit && compinit @@ -202,6 +203,8 @@ if [ -x tmuxifier ]; then eval "$(tmuxifier init -)" fi +[ -d $XDG_CONFIG_HOME/tmux/plugins/tpm/bin ] && export PATH=$PATH:$XDG_CONFIG_HOME/tmux/plugins/tpm/bin + # Configs to ASDF-VM: # if [ -d $ASDF_HOME/completions/ ]; then # # append completions to fpath @@ -218,6 +221,7 @@ export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed # [ -f $ASDF_HOME/plugins/java/set-java-home.zsh ] && source $ASDF_HOME/plugins/java/set-java-home.zsh # [ -d $XDG_CONFIG_HOME/tmux/plugins/tpm/bin ] && export PATH=$PATH:$XDG_CONFIG_HOME/tmux/plugins/tpm/bin + # Configs to Android commandline if [ -d $HOME/.local/share/Android ]; then export ANDROID_HOME=$HOME/.local/share/Android