diff --git a/README.md b/README.md index b3b2b35..24b9cdf 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Banish those unworthy soydev IDEs to the depths of Helheim! - Neovim: `neovim fzf ripgrep fd` - LSPs: `bash-language-server typescript-language-server rust-analyzer vscode-langservers-extracted pyright lua-language-server` -- Linters: `shellcheck markdownlint-cli2 luacheck ruff eslint luacheck` +- Linters: `shellcheck markdownlint-cli2 luacheck ruff eslint luacheck codespell` - Formatters: `prettierd isort black shfmt shellharden stylua` ## Tmux diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua index eeb02e6..341e9bd 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/format.lua @@ -15,14 +15,15 @@ return { css = { { "prettierd", "prettier" } }, javascript = { { "prettierd", "prettier" } }, typescript = { { "prettierd", "prettier" } }, - ["*"] = { "trim_whitespace" }, + ["*"] = { "codespell" }, + ["_"] = { "trim_whitespace" }, }, format_on_save = function(bufnr) -- Disable with a global or buffer-local variable if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end - return { timeout_ms = 500, lsp_fallback = true } + return { timeout_ms = 500, lsp_fallback = "always" } end, }) require("conform.formatters.markdownlint").command = "markdownlint-cli2" @@ -38,7 +39,7 @@ return { bang = true, }) vim.keymap.set("", "f", function() - require("conform").format({ async = true, lsp_fallback = true }) + require("conform").format({ async = true, lsp_fallback = "always" }) end, { desc = "[F]ormat" }) vim.api.nvim_create_user_command("FormatEnable", function() vim.b.disable_autoformat = false diff --git a/lua/plugins/lint.lua b/lua/plugins/lint.lua index 5d3b9ef..0b78048 100644 --- a/lua/plugins/lint.lua +++ b/lua/plugins/lint.lua @@ -5,15 +5,15 @@ return { local markdownlint = require("lint").linters.markdownlint markdownlint.cmd = "markdownlint-cli2" lint.linters_by_ft = { - python = { "ruff" }, -- requires ruff to be installed - lua = { "luacheck" }, -- requires luacheck to be installed - sh = { "shellcheck" }, -- requires shellcheck to be installed - nix = { "nix" }, -- requires nix to be installed - markdown = { "markdownlint" }, -- requires markdownlint to be installed - javascript = { "eslint" }, -- requires eslint to be installed - javascriptreact = { "eslint" }, -- requires eslint to be installe - typescript = { "eslint" }, -- requires eslint to be installed - typescriptreact = { "eslint" }, -- requires eslint to be installed + python = { "ruff", "codespell" }, -- requires ruff to be installed + lua = { "luacheck", "codespell" }, -- requires luacheck to be installed + sh = { "shellcheck", "codespell" }, -- requires shellcheck to be installed + nix = { "nix", "codespell" }, -- requires nix to be installed + markdown = { "markdownlint", "codespell" }, -- requires markdownlint to be installed + javascript = { "eslint", "codespell" }, -- requires eslint to be installed + javascriptreact = { "eslint", "codespell" }, -- requires eslint to be installed + typescript = { "eslint", "codespell" }, -- requires eslint to be installed + typescriptreact = { "eslint", "codespell" }, -- requires eslint to be installed } vim.api.nvim_create_autocmd({ "InsertLeave", "BufWritePost" }, { callback = function()