Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/stephansama/nvim. neovim configuration for @stephansama
dotfiles lua neovim neovim-configuration nvim nvim-config typescript typescript-to-lua
Something went wrong. Try again.
Lua
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051local function use_cspell(config_files) local cwd = vim.fn.getcwd()
for _, file in ipairs(config_files) do if vim.fn.filereadable(cwd .. "/" .. file) == 1 then return true end if vim.fn.filereadable(cwd .. "/.config/" .. file) == 1 then return true end end
return falseend
_G.cspell_enabled = use_cspell({ ".cSpell.json", ".cspell.json", "cSpell.json", "cspell.config.cjs", "cspell.config.js", "cspell.config.json", "cspell.config.yaml", "cspell.config.yml", "cspell.json", "cspell.yaml", "cspell.yml", })
local function lint_file() local lint = require("lint") lint.try_lint() if _G.cspell_enabled then lint.try_lint("cspell") endend
return { "mfussenegger/nvim-lint", init = function() vim.api.nvim_create_autocmd( { "BufWritePost" }, { callback = lint_file } ) end, config = function() require("lint").linters_by_ft = require("plugins.lang").LINTERS end,}