diff --git a/Makefile b/Makefile index 0951ba0..881b8a8 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ bootstrap_mac: check_os link bootstrap_common oh_my_zsh homebrew install_brew_ba @echo "Bootstrapped mac components!" .PHONY: bootstrap_common -bootstrap_common: check_os link_all_common prepare_projects_dir prepare_screenshots_dir prepare_scripts_cache_dir install_vim install_asdf alacritty_terminfo +bootstrap_common: check_os link_all_common prepare_projects_dir prepare_screenshots_dir prepare_scripts_cache_dir install_vim install_mise alacritty_terminfo @echo "Bootstrapped common components!" .PHONY: link @@ -183,9 +183,9 @@ link_script_utils: check_os .PHONY: link_tool_versions link_tool_versions: check_os - @echo "Linking tool-versions file for asdf" + @echo "Linking tool-versions file for mise" $(call link,tool-versions,.tool-versions) - $(call link,config/asdf/.default-gems,.default-gems) + $(call link,config/mise/.default-gems,.default-gems) .PHONY: link_profile link_profile: check_os @@ -286,42 +286,13 @@ install_brew_basics: homebrew check_os @echo "Installig basic brew packages..." @brew bundle --file $(DOTFILES_DIR)/installed_packages/core/Brewfile -.PHONY: install_asdf -install_asdf: check_os - @echo "Installing ASDF VM..." - @git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.0 - @echo "Installed ASDF Version 0.10.0" - @echo "To install latest version:" - @echo "" - @echo "cd ~/.asdf" - @echo "git fetch" - @echo "git checkout \"$$\(git describe --abbrev=0 --tags\)\"" - @echo "" - @echo "Consider installing configured ASDF tools:" - @echo "" - @echo "" - @echo "Run in home directory:" - @echo "asdf install" - @echo "" - @echo "" - @echo "Consider installing ASDF plugins:" - @echo "==================================" - @echo "DIRENV:" - @echo "----------------------------------" - @echo "asdf plugin-add direnv" - @echo "asdf install direnv latest" - @echo "" - @echo "Check out installed version using: " - @echo "asdf list direnv" - @echo "" - @echo "Configure it as global using: " - @echo "asdf global direnv $$version" - @echo "" - @echo "Configure it with provided function:" - @echo "asdf direnv setup --shell fish --version latest" - @echo "" +.PHONY: install_mise +install_mise: check_os + @echo "Installing mise..." + @curl https://mise.run | sh + @mise direnv activate > ~/.config/direnv/lib/use_mise.sh @echo "When using in projects, put the following in .envrc: " - @echo "use asdf" + @echo "use mise" @echo "==================================" @echo "" diff --git a/symlinks/bin/nvimremote b/symlinks/bin/nvimremote index 1f9a29a..f96b59e 100755 --- a/symlinks/bin/nvimremote +++ b/symlinks/bin/nvimremote @@ -18,8 +18,8 @@ if test -S $SERVER_NAME; then /usr/bin/wmctrl -a "$WINDOW_NAME" fi fi - ~/.asdf/shims/nvim --server $SERVER_NAME --remote $2 - ~/.asdf/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)" + ~/.local/share/mise/shims/nvim --server $SERVER_NAME --remote $2 + ~/.local/share/mise/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)" else /usr/bin/alacritty --title "$WINDOW_NAME" -e /usr/bin/fish -c "nvim --listen $SERVER_NAME $2 --cmd \"call cursor($LINE, $COLUMN)\"" fi diff --git a/symlinks/bin/update-all-packages b/symlinks/bin/update-all-packages index db3fdbe..0011400 100755 --- a/symlinks/bin/update-all-packages +++ b/symlinks/bin/update-all-packages @@ -71,23 +71,9 @@ then command vim +PlugUpdate +qall fi -if [ "${RUN[asdf]}" = "1" ] +if [ "${RUN[mise]}" = "1" ] then - asdf update - asdf plugin-update --all - - echo "========== ASDF UPDATES ==========" - echo "Available updates: " - while IFS= read -r PKG; do - if [ $(echo "$PKG" | cut -f3) = "missing" ]; then - PKG_NAME=$(echo $PKG | cut -f1 -d " ") - if [ "$PKG_NAME" != "java" -a "$PKG_NAME" != "ruby" ]; then - PKG_VER=$(echo $PKG | cut -f2 -d " ") - echo " $PKG_NAME - $PKG_VER (install with 'asdf install $PKG_NAME $PKG_VER' and set as global default with 'asdf global $PKG_NAME $PKG_VER')" - fi - fi - done <<< "$(asdf latest --all)" - echo "========== ASDF UPDATES ==========" + mise self-update fi if [ "${RUN[brew]}" = "1" ] diff --git a/symlinks/config/alacritty/alacritty.toml b/symlinks/config/alacritty/alacritty.toml index 2b81690..516015c 100644 --- a/symlinks/config/alacritty/alacritty.toml +++ b/symlinks/config/alacritty/alacritty.toml @@ -1 +1,2 @@ +[general] import = ["~/.config/alacritty/font.toml", "~/.config/alacritty/colors.toml", "~/.config/alacritty/keymap.toml"] diff --git a/symlinks/config/fish/completions/mise.fish b/symlinks/config/fish/completions/mise.fish new file mode 100644 index 0000000..4068165 --- /dev/null +++ b/symlinks/config/fish/completions/mise.fish @@ -0,0 +1,12 @@ +# if "usage" is not installed show an error +if ! command -v usage &> /dev/null + echo >&2 + echo "Error: usage CLI not found. This is required for completions to work in mise." >&2 + echo "See https://usage.jdx.dev for more information." >&2 + return 1 +end + +if ! set -q _usage_spec_mise_2024_11_13 + set -g _usage_spec_mise_2024_11_13 (mise usage | string collect) +end +complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2024_11_13" -- (commandline -cop) (commandline -t))' diff --git a/symlinks/config/fish/config.fish b/symlinks/config/fish/config.fish index ca55302..41252a0 100644 --- a/symlinks/config/fish/config.fish +++ b/symlinks/config/fish/config.fish @@ -2,7 +2,7 @@ fenv source ~/.profile set -g fish_prompt_pwd_dir_length 0 set -gx PROJECT_PATHS ~/Projects/*/* ~/Projects/Personal/Mixed\ Technology/Practice -set -gx ASDF_PYTHON_DEFAULT_PACKAGES_FILE ~/.config/asdf/.python-default-packages +set -gx MISE_PYTHON_DEFAULT_PACKAGES_FILE ~/.config/asdf/.python-default-packages set -gx FZF_DEFAULT_COMMAND 'rg --files' if which termux-info &> /dev/null @@ -29,27 +29,8 @@ abbr -a gcm "git checkout (__git.default_branch)" source ~/.config/fish/platform_config/$MACHINE_TYPE.fish -if [ -f /opt/asdf-vm/asdf.sh ] - set -gx ASDF_DIR /opt/asdf-vm - set -gx ASDF_CONFIG_FILE $XDG_CONFIG_HOME/asdf/asdfrc - set -gx ASDF_DATA_DIR $XDG_DATA_HOME/asdf - source $ASDF_DIR/asdf.sh +if status is-interactive + mise activate fish | source else - source ~/.asdf/asdf.fish - if [ -f ~/.asdf/plugins/dotnet-core/set-dotnet-home.fish ] - . ~/.asdf/plugins/dotnet-core/set-dotnet-home.fish - end -end - -eval (asdf exec direnv hook fish | source) - -function direnv - asdf exec direnv "$argv" -end - -function asdfexec - begin - asdf shell $argv[1] $argv[2] - $argv[3..] - end + mise activate fish --shims | source end diff --git a/symlinks/config/nvim/after/plugin/python_host.vim b/symlinks/config/nvim/after/plugin/python_host.vim index 9a3226f..f269e59 100644 --- a/symlinks/config/nvim/after/plugin/python_host.vim +++ b/symlinks/config/nvim/after/plugin/python_host.vim @@ -3,8 +3,8 @@ " Explicit declaration of python host program to "prevent suprises" " ----------------------------------------------------------------------------- if !has('win32') - let g:python_host_prog = $HOME.'/.asdf/shims/python2' - let g:python3_host_prog = $HOME.'/.asdf/shims/python3' + let g:python_host_prog = $HOME.'/.local/share/mise/shims/python2' + let g:python3_host_prog = $HOME.'/.local/share/mise/shims/python3' else let g:python_host_prog = $HOME.'/scoop/shims/python2' let g:python3_host_prog = $HOME.'/scoop/shims/python3' diff --git a/symlinks/config/nvim/lua/esensar/lsp/servers.lua b/symlinks/config/nvim/lua/esensar/lsp/servers.lua index 023a3ef..f8c7194 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/servers.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/servers.lua @@ -82,7 +82,7 @@ end -- Flutter tools require("flutter-tools").setup({ lsp = common_config, - flutter_lookup_cmd = "asdf where flutter", + flutter_lookup_cmd = "mise where flutter", }) -- Rust tools diff --git a/symlinks/config/nvim/plugin/ruby_host.vim b/symlinks/config/nvim/plugin/ruby_host.vim index 9f3507d..3c18877 100644 --- a/symlinks/config/nvim/plugin/ruby_host.vim +++ b/symlinks/config/nvim/plugin/ruby_host.vim @@ -2,7 +2,7 @@ " - Neovim ruby host - " ----------------------------------------------------------------------------- if !has('win32') - let g:ruby_host_prog = '~/.asdf/shims/ruby' + let g:ruby_host_prog = '~/.local/share/mise/shims/ruby' else let g:ruby_host_prog = '~/scoop/shims/ruby' endif diff --git a/symlinks/config/systemd/user/ra-multiplex.service b/symlinks/config/systemd/user/ra-multiplex.service index a85119d..d3617a1 100644 --- a/symlinks/config/systemd/user/ra-multiplex.service +++ b/symlinks/config/systemd/user/ra-multiplex.service @@ -3,7 +3,7 @@ Description=Rust analyzer multiplex server [Service] Type=simple -ExecStart=%h/.asdf/shims/ra-multiplex server +ExecStart=%h/.cargo/bin/ra-multiplex server [Install] WantedBy=default.target diff --git a/symlinks/gitignore b/symlinks/gitignore index 40cb909..b08b5d5 100644 --- a/symlinks/gitignore +++ b/symlinks/gitignore @@ -57,6 +57,7 @@ tags # ASDF .tool-versions +mise.local.toml # Idea .idea diff --git a/symlinks/script_utils/parse-package-managers-params.bash b/symlinks/script_utils/parse-package-managers-params.bash index 08a9842..a1b4487 100755 --- a/symlinks/script_utils/parse-package-managers-params.bash +++ b/symlinks/script_utils/parse-package-managers-params.bash @@ -21,7 +21,7 @@ done declare -A RUN=() -for command in "pacman" "apt" "dnf" "flatpak" "gem" "nvim" "asdf" "brew" "pacman" "pip" "pip2" "pip3"; +for command in "pacman" "apt" "dnf" "flatpak" "gem" "nvim" "mise" "brew" "pacman" "pip" "pip2" "pip3"; do if type $command > /dev/null 2>&1 then diff --git a/symlinks/zshrc.common b/symlinks/zshrc.common index be1a4da..c97ec23 100644 --- a/symlinks/zshrc.common +++ b/symlinks/zshrc.common @@ -46,7 +46,7 @@ ZSH_THEME="agnoster" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git mix asdf) +plugins=(git mix) # User configuration diff --git a/symlinks/zshrc.mac b/symlinks/zshrc.mac index 960972f..addb1fb 100644 --- a/symlinks/zshrc.mac +++ b/symlinks/zshrc.mac @@ -35,8 +35,6 @@ if [ -f "$HOME/.zshrc.local" ]; then source $HOME/.zshrc.local fi -source /usr/local/opt/asdf/asdf.sh - # Print update date print-last-brew-update