From 7f362ac91244de213e86fece810b76ebe867ccec Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:57:32 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20Add=20linters=20to=20nv?= =?UTF-8?q?im?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/git/commitlint.config.js | 3 ++ .config/nvim/lua/config/lazy.lua | 3 ++ .config/nvim/lua/plugins/linting.lua | 19 +++++++++ .config/nvim/lua/plugins/lsp.lua | 55 ++++++------------------- .config/nvim/lua/plugins/treesitter.lua | 40 ++++++++++++++++++ 5 files changed, 78 insertions(+), 42 deletions(-) create mode 100644 .config/git/commitlint.config.js create mode 100644 .config/nvim/lua/plugins/linting.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua diff --git a/.config/git/commitlint.config.js b/.config/git/commitlint.config.js new file mode 100644 index 0000000..a886858 --- /dev/null +++ b/.config/git/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["gitmoji"], +}; diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index bdfc2c1..78a7a93 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -35,6 +35,9 @@ require("lazy").setup({ -- linting { import = "lazyvim.plugins.extras.linting.eslint" }, + -- lsp + { import = "lazyvim.plugins.extras.lsp.none-ls" }, + -- test { import = "lazyvim.plugins.extras.test.core" }, diff --git a/.config/nvim/lua/plugins/linting.lua b/.config/nvim/lua/plugins/linting.lua new file mode 100644 index 0000000..492bee5 --- /dev/null +++ b/.config/nvim/lua/plugins/linting.lua @@ -0,0 +1,19 @@ +return { + "mfussenegger/nvim-lint", + opts = { + linters_by_ft = { + gitcommit = { "commitlint" }, + sql = { "sqlfluff" }, + yaml = { "yamllint" }, + bash = { "shellcheck" }, + sh = { "shellcheck" }, + }, + linters = { + commitlint = { + args = { + "--config ~/.config/git/commitlint.config.js", + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 9a5bd2a..88cd645 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -3,9 +3,11 @@ return { "williamboman/mason.nvim", opts = { ensure_installed = { - -- web - "deno", - "prettier", + -- general + "commitlint", + + -- data/conf + "yamllint", -- shell "shellcheck", @@ -14,6 +16,13 @@ return { }, }, + { + "williamboman/mason-lspconfig.nvim", + opts = { + automatic_installation = true, + }, + }, + { "neovim/nvim-lspconfig", ---@class PluginLspOpts @@ -27,6 +36,7 @@ return { -- web html = {}, cssls = {}, + denols = {}, volar = { filetypes = { "typescript", @@ -92,45 +102,6 @@ return { }, }, - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - -- general - "comment", - - -- git - "diff", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - - -- data/conf - "ini", - "ssh_config", - "toml", - - -- web - "html", - "css", - "scss", - "javascript", - "jsdoc", - "vue", - - -- php - "php", - "phpdoc", - - -- shell - "bash", - "fish", - }, - }, - }, - { "olrtg/nvim-emmet", config = function() diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..66162aa --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + -- general + "comment", + + -- git + "diff", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + + -- data/conf + "ini", + "ssh_config", + "toml", + + -- web + "html", + "css", + "scss", + "javascript", + "jsdoc", + "vue", + + -- php + "php", + "phpdoc", + + -- shell + "bash", + "fish", + }, + }, + }, +}