From 176a3526f77f4022dcf00c605d44e217bf88e4d1 Mon Sep 17 00:00:00 2001 From: Mykhailo Nikiforov Date: Thu, 5 Oct 2023 11:22:21 +0300 Subject: [PATCH] [#6]: Add shellcheck, reformat structure --- nvim/lua/config/lazy.lua | 6 ++-- nvim/lua/plugins/lang/markdown.lua | 41 ++++++++++++++++++++++++++ nvim/lua/plugins/lang/shell.lua | 43 ++++++++++++++++++++++++++++ nvim/lua/plugins/mason.lua | 10 ------- nvim/lua/plugins/none-ls.lua | 10 ------- nvim/lua/plugins/nvim-lspconfig.lua | 8 ------ nvim/lua/plugins/nvim-treesitter.lua | 11 ------- 7 files changed, 86 insertions(+), 43 deletions(-) create mode 100644 nvim/lua/plugins/lang/markdown.lua create mode 100644 nvim/lua/plugins/lang/shell.lua delete mode 100644 nvim/lua/plugins/mason.lua delete mode 100644 nvim/lua/plugins/none-ls.lua delete mode 100644 nvim/lua/plugins/nvim-lspconfig.lua delete mode 100644 nvim/lua/plugins/nvim-treesitter.lua diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index fb3939c..0c4a577 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -23,10 +23,8 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "plugins.tokyonight" }, { import = "plugins.telescope" }, - { import = "plugins.mason" }, - { import = "plugins.none-ls" }, - { import = "plugins.nvim-lspconfig" }, - { import = "plugins.nvim-treesitter" }, + { import = "plugins.lang.markdown" }, + { import = "plugins.lang.shell" }, }, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. diff --git a/nvim/lua/plugins/lang/markdown.lua b/nvim/lua/plugins/lang/markdown.lua new file mode 100644 index 0000000..0119ac0 --- /dev/null +++ b/nvim/lua/plugins/lang/markdown.lua @@ -0,0 +1,41 @@ +return { + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { + "marksman", + "mdformat", + }) + end, + }, + { + "nvimtools/none-ls.nvim", + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = opts.sources or {} + vim.list_extend(opts.sources, { + nls.builtins.formatting.mdformat, + }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + marksman = {}, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { + "markdown", + "markdown_inline", + }) + end + end, + }, +} diff --git a/nvim/lua/plugins/lang/shell.lua b/nvim/lua/plugins/lang/shell.lua new file mode 100644 index 0000000..eb2b0cd --- /dev/null +++ b/nvim/lua/plugins/lang/shell.lua @@ -0,0 +1,43 @@ +return { + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { + "shfmt", + "shellcheck", + "bash-language-server", + }) + end, + }, + { + "nvimtools/none-ls.nvim", + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = opts.sources or {} + vim.list_extend(opts.sources, { + -- nls.builtins.code_actions.shellcheck, + -- nls.builtins.diagnostics.shellcheck, + nls.builtins.formatting.shfmt, + }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + bashls = {}, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { + "bash", + }) + end + end, + }, +} diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua deleted file mode 100644 index 37ea0fb..0000000 --- a/nvim/lua/plugins/mason.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "williamboman/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { - "marksman", - "mdformat", - }) - end, -} diff --git a/nvim/lua/plugins/none-ls.lua b/nvim/lua/plugins/none-ls.lua deleted file mode 100644 index 7fc6ad5..0000000 --- a/nvim/lua/plugins/none-ls.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "nvimtools/none-ls.nvim", - opts = function(_, opts) - local nls = require("null-ls") - opts.sources = opts.sources or {} - vim.list_extend(opts.sources, { - nls.builtins.formatting.mdformat, - }) - end, -} diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua deleted file mode 100644 index 5f2441d..0000000 --- a/nvim/lua/plugins/nvim-lspconfig.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "neovim/nvim-lspconfig", - opts = { - servers = { - marksman = {}, - }, - }, -} diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua deleted file mode 100644 index c11471d..0000000 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { - "markdown", - "markdown_inline", - }) - end - end, -} -- 2.49.1