From c31f7400ff6c697a57c4ef56c3b651f4ae36b2f3 Mon Sep 17 00:00:00 2001 From: David Jensenius Date: Thu, 30 Oct 2025 11:25:31 +0100 Subject: [PATCH 1/3] Fix mise-fish-tmux --- fish/conf.d/12-brew-shellenv.fish | 22 +++++--- fish/conf.d/52-mise.fish | 5 +- fish/config.fish | 6 +++ nvim/lua/plugins/conform.lua | 4 ++ nvim/lua/plugins/mason.lua | 81 ++++++++++++++++------------- nvim/lua/plugins/nvim-lint.lua | 3 ++ nvim/lua/plugins/nvim-lspconfig.lua | 7 ++- nvim/lua/plugins/nvim-naic.lua | 1 - tmux/tmux.conf | 7 +-- 9 files changed, 84 insertions(+), 52 deletions(-) diff --git a/fish/conf.d/12-brew-shellenv.fish b/fish/conf.d/12-brew-shellenv.fish index 808bb08..7ffd217 100644 --- a/fish/conf.d/12-brew-shellenv.fish +++ b/fish/conf.d/12-brew-shellenv.fish @@ -1,8 +1,18 @@ -# Initialize brew environments if available (more complete than just PATH) -if test -x /home/linuxbrew/.linuxbrew/bin/brew - eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv) -else if test -x /opt/homebrew/bin/brew - eval (/opt/homebrew/bin/brew shellenv) +# Initialize brew environment variables (but avoid path_helper which reorders PATH) +# On macOS, brew shellenv calls path_helper which puts /usr/bin before mise paths +if test -x /opt/homebrew/bin/brew + set -gx HOMEBREW_PREFIX /opt/homebrew + set -gx HOMEBREW_CELLAR /opt/homebrew/Cellar + set -gx HOMEBREW_REPOSITORY /opt/homebrew + fish_add_path -g /opt/homebrew/bin /opt/homebrew/sbin else if test -x /usr/local/bin/brew - eval (/usr/local/bin/brew shellenv) + set -gx HOMEBREW_PREFIX /usr/local + set -gx HOMEBREW_CELLAR /usr/local/Cellar + set -gx HOMEBREW_REPOSITORY /usr/local + fish_add_path -g /usr/local/bin /usr/local/sbin +else if test -x /home/linuxbrew/.linuxbrew/bin/brew + set -gx HOMEBREW_PREFIX /home/linuxbrew/.linuxbrew + set -gx HOMEBREW_CELLAR /home/linuxbrew/.linuxbrew/Cellar + set -gx HOMEBREW_REPOSITORY /home/linuxbrew/.linuxbrew + fish_add_path -g /home/linuxbrew/.linuxbrew/bin end diff --git a/fish/conf.d/52-mise.fish b/fish/conf.d/52-mise.fish index 968d968..20b3800 100644 --- a/fish/conf.d/52-mise.fish +++ b/fish/conf.d/52-mise.fish @@ -1,4 +1 @@ -# mise activation -if command -q mise - mise activate fish | source -end +# mise activation moved to config.fish to run after all PATH setup diff --git a/fish/config.fish b/fish/config.fish index 56aeb34..0e447c6 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -5,6 +5,7 @@ if status is-interactive if test -d /workspaces __fish_reconstruct_path end + # Prompt and tools that hook into the interactive shell starship init fish | source zoxide init fish | source @@ -21,4 +22,9 @@ if status is-interactive # Optional extra plugin command -q pay-respects; and pay-respects fish | source + + # Initialize mise for interactive shells + if command -q mise + mise activate fish | source + end end diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua index 9e3b2f1..177492f 100644 --- a/nvim/lua/plugins/conform.lua +++ b/nvim/lua/plugins/conform.lua @@ -53,6 +53,10 @@ return { shfmt = { prepend_args = { "-i", "2" }, }, + -- Use system rubocop (from mise) instead of Mason's version + rubocop = { + command = "rubocop", + }, }, }, init = function() diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 02f49f6..a1b96d9 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -1,45 +1,20 @@ return { "williamboman/mason-lspconfig.nvim", - event = { "BufReadPre", "BufNewFile" }, + lazy = true, + cmd = { "Mason", "MasonInstall", "MasonUpdate" }, build = ":MasonUpdate", dependencies = { { "williamboman/mason.nvim", - dependencies = { - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, config = function() - require("mason").setup() - local mason_tool_installer = require("mason-tool-installer") - mason_tool_installer.setup({ - ensure_installed = { - "delve", - "eslint-lsp", - "eslint_d", - "goimports", - "golangci-lint", - "gopls", - "isort", - "jq-lsp", - "jsonlint", - "json-lsp", - "luacheck", - "lua-language-server", - "prettierd", - "prettier", - "rubocop", - "ruby_lsp", - "sorbet", - "shellcheck", - "stylelint-lsp", - "stylua", - "tailwindcss-language-server", - "typescript-language-server", - "vale", - "vale_ls", - "yaml-language-server", + require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, }, - debounce_hours = 96, }) end, }, @@ -57,6 +32,7 @@ return { ensure_installed = { "delve", }, + automatic_installation = true, }) require("dap-go").setup() require("dapui").setup() @@ -129,15 +105,46 @@ return { }, config = function() require("mason-lspconfig").setup({ - automatic_installation = true, - automatic_enable = false, + automatic_installation = false, ensure_installed = { + -- Language servers "ts_ls", "lua_ls", - "ruby_lsp", "gopls", "sorbet", + "eslint", + "jsonls", + "yamlls", + "jqls", + "vale_ls", + "tailwindcss", + "stylelint_lsp", }, }) + + -- Auto-install formatters/linters via Mason registry on first load + local registry = require("mason-registry") + local tools = { + "delve", + "eslint_d", + "goimports", + "golangci-lint", + "isort", + "jsonlint", + "luacheck", + "prettierd", + "prettier", + "rubocop", + "shellcheck", + "stylua", + "vale", + } + + for _, tool in ipairs(tools) do + local p = registry.get_package(tool) + if not p:is_installed() then + p:install() + end + end end, } diff --git a/nvim/lua/plugins/nvim-lint.lua b/nvim/lua/plugins/nvim-lint.lua index 3be26c4..ceffaed 100644 --- a/nvim/lua/plugins/nvim-lint.lua +++ b/nvim/lua/plugins/nvim-lint.lua @@ -21,6 +21,9 @@ return { typescriptreact = { "eslint_d" }, } + -- Use system rubocop (from mise) instead of Mason's version + lint.linters.rubocop.cmd = "rubocop" + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua index 4cff811..fb6786f 100644 --- a/nvim/lua/plugins/nvim-lspconfig.lua +++ b/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,6 +1,11 @@ return { "neovim/nvim-lspconfig", - dependencies = { "nvim-tree/nvim-web-devicons", "folke/trouble.nvim", "saghen/blink.cmp" }, + dependencies = { + "nvim-tree/nvim-web-devicons", + "folke/trouble.nvim", + "saghen/blink.cmp", + "williamboman/mason-lspconfig.nvim", + }, event = "VeryLazy", config = function() diff --git a/nvim/lua/plugins/nvim-naic.lua b/nvim/lua/plugins/nvim-naic.lua index b4c8a9b..a8f2660 100644 --- a/nvim/lua/plugins/nvim-naic.lua +++ b/nvim/lua/plugins/nvim-naic.lua @@ -8,7 +8,6 @@ return { }, preference = { "sorbet", - "ruby_lsp", "lua_ls", "gopls", "tsserver", diff --git a/tmux/tmux.conf b/tmux/tmux.conf index edeb841..d02be47 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -5,6 +5,8 @@ unbind ^b bind a send-prefix set -g base-index 1 set-option -g default-terminal 'tmux-256color' +# Start fish in non-login mode to avoid macOS path_helper reshuffling PATH +set -g default-command /opt/homebrew/bin/fish set-option -sa terminal-features ',xterm*:RGB' set-option -sa terminal-features ',xterm*:Tc' set-option -g status-position top @@ -17,6 +19,7 @@ set -g allow-passthrough on set -ga update-environment TERM set -ga update-environment TERM_PROGRAM +set -ga update-environment PATH set -s set-clipboard on # =================== Mouse ======================== @@ -102,6 +105,4 @@ set -g status-style "bg=terminal" setw -g mode-keys vi -if-shell '[ $(uname -s) = Linux ]' { - set -g default-command 'fish' -} + From 8ca06e2abeb7b4e347760e99b9d5d3673fb3db3b Mon Sep 17 00:00:00 2001 From: David Jensenius Date: Thu, 30 Oct 2025 11:31:19 +0100 Subject: [PATCH 2/3] Fix rubocop --- nvim/lua/plugins/mason.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index a1b96d9..eb8947e 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -111,7 +111,6 @@ return { "ts_ls", "lua_ls", "gopls", - "sorbet", "eslint", "jsonls", "yamlls", @@ -134,7 +133,6 @@ return { "luacheck", "prettierd", "prettier", - "rubocop", "shellcheck", "stylua", "vale", From 62d908e03bf546ba78dc8c48460f811cb69c1ed2 Mon Sep 17 00:00:00 2001 From: David Jensenius Date: Thu, 30 Oct 2025 11:48:39 +0100 Subject: [PATCH 3/3] Fix indentation --- fish/config.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index 0e447c6..3e42656 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -5,7 +5,7 @@ if status is-interactive if test -d /workspaces __fish_reconstruct_path end - + # Prompt and tools that hook into the interactive shell starship init fish | source zoxide init fish | source @@ -22,7 +22,7 @@ if status is-interactive # Optional extra plugin command -q pay-respects; and pay-respects fish | source - + # Initialize mise for interactive shells if command -q mise mise activate fish | source