neovim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 66a6ca71ed6f088ac3e9d28477679927f462039f
parent cad00ac7d71116cd068db4e9526b357cefa66e10
Author: bdmfegys@duck.com <bdmfegys@duck.com>
Date:   Sun,  5 May 2024 13:48:08 -0400

liberate plugins to seperate files!

Diffstat:
Mlua/index.lua | 7++++---
Mlua/lazy-nvim.lua | 2+-
Dlua/plugins.lua | 61-------------------------------------------------------------
Alua/plugins/colorizer.lua | 2++
Alua/plugins/mason-lspconfig.lua | 1+
Alua/plugins/mason.lua | 36++++++++++++++++++++++++++++++++++++
Alua/plugins/mini-pairs.lua | 9+++++++++
Alua/plugins/nnn.lua | 2++
Alua/plugins/pywal.lua | 2++
Alua/plugins/toggleterm.lua | 3+++
Alua/plugins/treesitter.lua | 2++
Alua/plugins/whichkey.lua | 41+++++++++++++++++++++++++++++++++++++++++
Dlua/whichkey.lua | 31-------------------------------
13 files changed, 103 insertions(+), 96 deletions(-)

diff --git a/lua/index.lua b/lua/index.lua @@ -1,5 +1,6 @@ -require("lazy-nvim") -require("plugins") require("options") +require("lazy-nvim") +--require("plugins") +--require("plugin") require("autostart") -require("whichkey") +--require("whichkey") diff --git a/lua/lazy-nvim.lua b/lua/lazy-nvim.lua @@ -10,4 +10,4 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then }) end vim.opt.rtp:prepend(lazypath) - +require("lazy").setup("plugins") diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -1,61 +0,0 @@ -require("lazy").setup({ - { "williamboman/mason.nvim" }, - { "williamboman/mason-lspconfig.nvim" }, - { "norcalli/nvim-colorizer.lua", event = "VeryLazy" }, - { "luukvbaal/nnn.nvim", config = true }, - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "VeryLazy" }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - }, - { "akinsho/toggleterm.nvim", version = "*", config = true }, - { "AlphaTechnolog/pywal.nvim" }, - { "echasnovski/mini.pairs", - event = "VeryLazy", - opts = { - mappings = { - ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } }, - }, - }, - }, - { "williamboman/mason.nvim", - cmd = "Mason", - build = ":MasonUpdate", - opts = { - ensure_installed = { - "ast-grep", - }, - }, - ---@param opts MasonSettings | {ensure_installed: string[]} - config = function(_, opts) - require("mason").setup(opts) - local mr = require("mason-registry") - mr:on("package:install:success", function() - vim.defer_fn(function() - -- trigger FileType event to possibly load this newly installed LSP server - require("lazy.core.handler.event").trigger({ - event = "FileType", - buf = vim.api.nvim_get_current_buf(), - }) - end, 100) - end) - local function ensure_installed() - for _, tool in ipairs(opts.ensure_installed) do - local p = mr.get_package(tool) - if not p:is_installed() then - p:install() - end - end - end - if mr.refresh then - mr.refresh(ensure_installed) - else - ensure_installed() - end - end, - }, -}) diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua @@ -0,0 +1,2 @@ +return { "norcalli/nvim-colorizer.lua", event = "VeryLazy" } + diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua @@ -0,0 +1 @@ +return { "williamboman/mason-lspconfig.nvim" } diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua @@ -0,0 +1,36 @@ +return { "williamboman/mason.nvim", + cmd = "Mason", + build = ":MasonUpdate", + opts = { + ensure_installed = { + "ast-grep", + }, + }, + ---@param opts MasonSettings | {ensure_installed: string[]} + config = function(_, opts) + require("mason").setup(opts) + local mr = require("mason-registry") + mr:on("package:install:success", function() + vim.defer_fn(function() + -- trigger FileType event to possibly load this newly installed LSP server + require("lazy.core.handler.event").trigger({ + event = "FileType", + buf = vim.api.nvim_get_current_buf(), + }) + end, 100) + end) + local function ensure_installed() + for _, tool in ipairs(opts.ensure_installed) do + local p = mr.get_package(tool) + if not p:is_installed() then + p:install() + end + end + end + if mr.refresh then + mr.refresh(ensure_installed) + else + ensure_installed() + end + end, + } diff --git a/lua/plugins/mini-pairs.lua b/lua/plugins/mini-pairs.lua @@ -0,0 +1,9 @@ +return { + "echasnovski/mini.pairs", + event = "VeryLazy", + opts = { + mappings = { + ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } }, + }, + }, + } diff --git a/lua/plugins/nnn.lua b/lua/plugins/nnn.lua @@ -0,0 +1,2 @@ +return { "luukvbaal/nnn.nvim", config = true } + diff --git a/lua/plugins/pywal.lua b/lua/plugins/pywal.lua @@ -0,0 +1,2 @@ +return { "AlphaTechnolog/pywal.nvim" } + diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua @@ -0,0 +1,3 @@ +return { + { "akinsho/toggleterm.nvim", version = "*", config = true }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua @@ -0,0 +1,2 @@ +return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "VeryLazy" } + diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua @@ -0,0 +1,41 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + config = function(_) + require("which-key").setup() + require("which-key").register({ + a = { + "<cmd>NnnExplorer<cr>", + "Open NNN (embedded)", + }, + e = { + "<cmd>NnnPicker<cr>", + "Open NNN Picker", + }, + --f = { + -- "<cmd>argv[1]<cr>", + -- "Format Buffer", + --}, + l = { + "<cmd>Lazy<cr>", + "Open Lazy", + }, + m = { + "<cmd>Mason<cr>", + "Mason", + }, + q = { + "<cmd>:q<cr>", + "Quit Neovim", + }, + t = { + "<cmd>ToggleTerm<cr>", + "Open Terminal", + }, + }, { prefix = "<leader>" }) + end, +} diff --git a/lua/whichkey.lua b/lua/whichkey.lua @@ -1,31 +0,0 @@ -local wk = require("which-key") -wk.register({ - a = { - "<cmd>NnnExplorer<cr>", - "Open NNN (embedded)", - }, - e = { - "<cmd>NnnPicker<cr>", - "Open NNN Picker", - }, - --f = { - -- "<cmd>argv[1]<cr>", - -- "Format Buffer", - --}, - l = { - "<cmd>Lazy<cr>", - "Open Lazy", - }, - m = { - "<cmd>Mason<cr>", - "Mason", - }, - q = { - "<cmd>:q<cr>", - "Quit Neovim", - }, - t = { - "<cmd>ToggleTerm<cr>", - "Open Terminal", - }, -}, { prefix = "<leader>" })