From 35ae1e76da8ae20fa1ad5b62c11ebb45cd424243 Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 26 Jun 2026 12:45:13 -0500 Subject: [PATCH 1/3] refactor: clean up nvim plugin specs --- home/dot_config/nvim/lua/config/options.lua | 1 + home/dot_config/nvim/lua/plugins/example.lua | 197 ------------------ home/dot_config/nvim/lua/plugins/opencode.lua | 3 - 3 files changed, 1 insertion(+), 200 deletions(-) delete mode 100644 home/dot_config/nvim/lua/plugins/example.lua diff --git a/home/dot_config/nvim/lua/config/options.lua b/home/dot_config/nvim/lua/config/options.lua index c45e5c6..31e385c 100644 --- a/home/dot_config/nvim/lua/config/options.lua +++ b/home/dot_config/nvim/lua/config/options.lua @@ -3,3 +3,4 @@ -- Add any additional options here vim.opt.clipboard = "unnamedplus" +vim.o.autoread = true diff --git a/home/dot_config/nvim/lua/plugins/example.lua b/home/dot_config/nvim/lua/plugins/example.lua deleted file mode 100644 index 17f53d6..0000000 --- a/home/dot_config/nvim/lua/plugins/example.lua +++ /dev/null @@ -1,197 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, { - function() - return "😄" - end, - }) - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, -} diff --git a/home/dot_config/nvim/lua/plugins/opencode.lua b/home/dot_config/nvim/lua/plugins/opencode.lua index 10180a9..343df9f 100644 --- a/home/dot_config/nvim/lua/plugins/opencode.lua +++ b/home/dot_config/nvim/lua/plugins/opencode.lua @@ -2,7 +2,6 @@ return { { "nickjvandyke/opencode.nvim", version = "*", - lazy = false, dependencies = { { "folke/snacks.nvim", @@ -70,8 +69,6 @@ return { server = false, }, } - - vim.o.autoread = true end, }, } From 4514025d2b6aa0b9d235fdbb7714c1340d36452c Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 26 Jun 2026 12:46:06 -0500 Subject: [PATCH 2/3] fix: quote template values and scope mise trust --- .../.chezmoitemplates/apm/mcp-server.yml.tmpl | 6 ++-- home/dot_apm/apm.yml.tmpl | 4 +-- home/dot_config/git/config.tmpl | 4 +-- home/dot_config/mise/config.toml.tmpl | 2 +- tests/template/apm-config.bats | 34 +++++++++---------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/home/.chezmoitemplates/apm/mcp-server.yml.tmpl b/home/.chezmoitemplates/apm/mcp-server.yml.tmpl index 860e641..5b9df41 100644 --- a/home/.chezmoitemplates/apm/mcp-server.yml.tmpl +++ b/home/.chezmoitemplates/apm/mcp-server.yml.tmpl @@ -1,8 +1,8 @@ -- name: {{ index . "name" }} +- name: "{{ index . "name" }}" registry: {{ index . "registry" }} transport: {{ index . "transport" }} {{- if hasKey . "url" }} - url: {{ index . "url" }} + url: "{{ index . "url" }}" {{- end }} {{- if hasKey . "headers" }} headers: @@ -11,7 +11,7 @@ {{- end }} {{- end }} {{- if hasKey . "command" }} - command: {{ index . "command" }} + command: "{{ index . "command" }}" {{- end }} {{- if hasKey . "args" }} args: diff --git a/home/dot_apm/apm.yml.tmpl b/home/dot_apm/apm.yml.tmpl index d178edc..1b31ece 100644 --- a/home/dot_apm/apm.yml.tmpl +++ b/home/dot_apm/apm.yml.tmpl @@ -20,11 +20,11 @@ dependencies: {{- with .skills }} skills: {{- range . }} - - {{ . }} + - "{{ . }}" {{- end }} {{- end }} {{- else }} - - {{ . }} + - "{{ . }}" {{- end }} {{ end }} {{ end -}} diff --git a/home/dot_config/git/config.tmpl b/home/dot_config/git/config.tmpl index 4967678..6e9a93f 100644 --- a/home/dot_config/git/config.tmpl +++ b/home/dot_config/git/config.tmpl @@ -1,6 +1,6 @@ [user] - name = {{ .git.name }} - email = {{ .git.email }} + name = "{{ .git.name }}" + email = "{{ .git.email }}" [core] editor = code --wait pager = delta diff --git a/home/dot_config/mise/config.toml.tmpl b/home/dot_config/mise/config.toml.tmpl index 88b2267..838a67f 100644 --- a/home/dot_config/mise/config.toml.tmpl +++ b/home/dot_config/mise/config.toml.tmpl @@ -9,4 +9,4 @@ [settings] idiomatic_version_file_enable_tools = ["node", "python", "pnpm"] -trusted_config_paths = ["/"] +trusted_config_paths = ["~"] diff --git a/tests/template/apm-config.bats b/tests/template/apm-config.bats index 6318249..439579e 100644 --- a/tests/template/apm-config.bats +++ b/tests/template/apm-config.bats @@ -19,9 +19,9 @@ render_apm_template() { run render_apm_template "$PERSONAL_DATA" assert_success - assert_line ' - name: grep' + assert_line ' - name: "grep"' assert_line ' registry: false' - assert_line ' url: https://mcp.grep.app' + assert_line ' url: "https://mcp.grep.app"' refute_line --regexp 'name: figma' refute_line --regexp 'name: jira' } @@ -41,15 +41,15 @@ render_apm_template() { run render_apm_template "$PERSONAL_DATA" assert_success - assert_line --partial ' - obra/superpowers' - assert_line --partial ' - JuliusBrussee/caveman' - assert_line --partial ' - anthropics/claude-plugins-official/plugins/skill-creator' - assert_line --partial ' - schpet/linear-cli' - assert_line --partial ' - tavily-ai/skills' + assert_line --partial ' - "obra/superpowers' + assert_line --partial ' - "JuliusBrussee/caveman' + assert_line --partial ' - "anthropics/claude-plugins-official/plugins/skill-creator' + assert_line --partial ' - "schpet/linear-cli' + assert_line --partial ' - "tavily-ai/skills' assert_line --partial ' - git: JuliusBrussee/skills' assert_line ' skills:' - assert_line ' - grill-me' - assert_line ' - junior-to-senior' + assert_line ' - "grill-me"' + assert_line ' - "junior-to-senior"' refute_line --partial 'interface-kit' refute_line --partial 'loop-factory' refute_line --partial 'context-canary' @@ -59,11 +59,11 @@ render_apm_template() { run render_apm_template "$WORK_DATA" assert_success - assert_line ' - name: grep' - assert_line ' - name: figma' - assert_line ' url: https://mcp.figma.com/mcp' - assert_line ' - name: jira' - assert_line ' url: https://mcp.atlassian.com/v1/mcp' + assert_line ' - name: "grep"' + assert_line ' - name: "figma"' + assert_line ' url: "https://mcp.figma.com/mcp"' + assert_line ' - name: "jira"' + assert_line ' url: "https://mcp.atlassian.com/v1/mcp"' } @test "work APM config renders work target" { @@ -81,9 +81,9 @@ render_apm_template() { run render_apm_template "$WORK_DATA" assert_success - assert_line --partial ' - obra/superpowers' - assert_line --partial ' - JuliusBrussee/caveman' - assert_line --partial ' - anthropics/claude-plugins-official/plugins/skill-creator' + assert_line --partial ' - "obra/superpowers' + assert_line --partial ' - "JuliusBrussee/caveman' + assert_line --partial ' - "anthropics/claude-plugins-official/plugins/skill-creator' refute_line --partial ' - schpet/linear-cli' refute_line --partial ' - tavily-ai/skills' refute_line --partial 'JuliusBrussee/skills' From 242345b25e647bcd036929230e3fa93281cdd1bc Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Fri, 26 Jun 2026 12:59:45 -0500 Subject: [PATCH 3/3] fix: drop leaked nvim files from template PR --- home/dot_config/nvim/lua/config/options.lua | 1 - home/dot_config/nvim/lua/plugins/example.lua | 197 ++++++++++++++++++ home/dot_config/nvim/lua/plugins/opencode.lua | 3 + 3 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 home/dot_config/nvim/lua/plugins/example.lua diff --git a/home/dot_config/nvim/lua/config/options.lua b/home/dot_config/nvim/lua/config/options.lua index 31e385c..c45e5c6 100644 --- a/home/dot_config/nvim/lua/config/options.lua +++ b/home/dot_config/nvim/lua/config/options.lua @@ -3,4 +3,3 @@ -- Add any additional options here vim.opt.clipboard = "unnamedplus" -vim.o.autoread = true diff --git a/home/dot_config/nvim/lua/plugins/example.lua b/home/dot_config/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..17f53d6 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/example.lua @@ -0,0 +1,197 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/opencode.lua b/home/dot_config/nvim/lua/plugins/opencode.lua index 343df9f..10180a9 100644 --- a/home/dot_config/nvim/lua/plugins/opencode.lua +++ b/home/dot_config/nvim/lua/plugins/opencode.lua @@ -2,6 +2,7 @@ return { { "nickjvandyke/opencode.nvim", version = "*", + lazy = false, dependencies = { { "folke/snacks.nvim", @@ -69,6 +70,8 @@ return { server = false, }, } + + vim.o.autoread = true end, }, }