aboutsummaryrefslogtreecommitdiff
path: root/lua/pml68
diff options
context:
space:
mode:
authorpml68 <contact@pml68.me>2024-11-29 23:28:27 +0100
committerpml68 <contact@pml68.me>2024-11-29 23:28:27 +0100
commit82a1c1e251210f4805dec8f6d59a6ab2c6791334 (patch)
treec2db695fe2767ff314319a490c833bebd30f99a8 /lua/pml68
parentfeat: remove deprecated API call (diff)
downloadnvim-82a1c1e251210f4805dec8f6d59a6ab2c6791334.tar.gz
feat: split plugins.lua into manageable "chunks"
Diffstat (limited to '')
-rw-r--r--lua/pml68/lazy.lua4
-rw-r--r--lua/pml68/plugins.lua290
-rw-r--r--lua/pml68/plugins/colors.lua31
-rw-r--r--lua/pml68/plugins/completion.lua26
-rw-r--r--lua/pml68/plugins/git.lua21
-rw-r--r--lua/pml68/plugins/guard.lua20
-rw-r--r--lua/pml68/plugins/lang-specific.lua41
-rw-r--r--lua/pml68/plugins/lsp.lua25
-rw-r--r--lua/pml68/plugins/misc.lua20
-rw-r--r--lua/pml68/plugins/oil.lua29
-rw-r--r--lua/pml68/plugins/other.lua23
-rw-r--r--lua/pml68/plugins/telescope.lua8
-rw-r--r--lua/pml68/plugins/treesitter.lua39
13 files changed, 284 insertions, 293 deletions
diff --git a/lua/pml68/lazy.lua b/lua/pml68/lazy.lua
index 901d0b6..bf0e87d 100644
--- a/lua/pml68/lazy.lua
+++ b/lua/pml68/lazy.lua
@@ -11,9 +11,7 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-local plugins = require("pml68.plugins")
-
-require("lazy").setup(plugins, {
+require("lazy").setup("pml68.plugins", {
defaults = { lazy = true },
change_detection = {
notify = false,
diff --git a/lua/pml68/plugins.lua b/lua/pml68/plugins.lua
deleted file mode 100644
index e10c231..0000000
--- a/lua/pml68/plugins.lua
+++ /dev/null
@@ -1,290 +0,0 @@
-local plugins = {
- -- Visual surround
- {
- "NStefan002/visual-surround.nvim",
- event = { "BufReadPost", "BufNewFile" },
- config = true,
- },
- -- tmux integration
- {
- "christoomey/vim-tmux-navigator",
- lazy = false,
- },
- -- Oil.nvim
- {
- "stevearc/oil.nvim",
- cmd = "Oil",
- config = function()
- require("oil").setup({
- keymaps = {
- ["<C-h>"] = false,
- },
- view_options = {
- show_hidden = true,
- natural_order = true,
- is_always_hidden = function(name, _)
- return name == '.git' or name == "node_modules" or name == "target"
- end
- },
- float = {
- padding = 2,
- max_width = 50,
- max_height = 0,
- border = "single",
- win_options = {
- winblend = 0,
- },
- },
- skip_confirm_for_simple_edits = true,
- default_file_explorer = true,
- })
- end
- },
- --Color highlighting
- {
- "brenoprata10/nvim-highlight-colors",
- event = { "BufReadPost", "BufNewFile" },
- config = function()
- require("nvim-highlight-colors").setup({
- render = 'background',
- enable_tailwind = true,
- })
- end
- },
- --IndentBlankline
- {
- "lukas-reineke/indent-blankline.nvim",
- main = "ibl",
- event = { "BufReadPost", "BufNewFile" },
- config = function()
- require("ibl").setup()
- end
- },
- --CMP
- {
- "hrsh7th/nvim-cmp",
- event = "InsertEnter",
- dependencies = {
- {
- "windwp/nvim-autopairs",
- opts = {
- fast_wrap = {},
- disable_filetype = { "TelescopePrompt", "vim" },
- },
- config = function(_, opts)
- require("nvim-autopairs").setup(opts)
-
- local cmp_autopairs = require "nvim-autopairs.completion.cmp"
- require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
- end,
- },
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-buffer",
- "hrsh7th/cmp-path",
- "hrsh7th/cmp-emoji"
- },
- config = function()
- require("pml68.configs.cmp")
- end,
- },
- --Git
- {
- "lewis6991/gitsigns.nvim",
- event = { "BufReadPost", "BufNewFile" },
- config = function()
- require("gitsigns").setup({
- signs = {
- add = { text = "│" },
- change = { text = "│" },
- delete = { text = "󰍵" },
- topdelete = { text = "‾" },
- changedelete = { text = "~" },
- untracked = { text = "│" },
- },
- on_attach = function(bufnr)
- local gs = package.loaded.gitsigns
-
- vim.keymap.set("n", "<leader>gb", gs.blame_line, { buffer = bufnr })
- end,
- })
- end
- },
- --LSP
- {
- "neovim/nvim-lspconfig",
- event = { "BufReadPost", "BufNewFile" },
- config = function()
- require("pml68.configs.lspconfig")
- end
- },
- {
- "williamboman/mason.nvim",
- cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
- opts = function()
- return require("pml68.configs.mason")
- end,
- config = function(_, opts)
- require("mason").setup(opts)
- vim.api.nvim_create_user_command("MasonInstallAll", function()
- if opts.ensure_installed and #opts.ensure_installed > 0 then
- vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
- end
- end, {})
- end,
- build = ":MasonInstallAll",
- },
- --Fuzzyfinder
- {
- "nvim-telescope/telescope.nvim",
- tag = "0.1.6",
- cmd = "Telescope",
- dependencies = {
- "nvim-lua/plenary.nvim"
- },
- },
- --Colorscheme
- {
- "rose-pine/neovim",
- name = "rose-pine",
- priority = 1000,
- lazy = false,
- config = function()
- require("rose-pine").setup({
- styles = {
- transparency = true,
- italic = false,
- },
- highlight_groups = {
- StatusLine = { fg = "iris", bg = "iris", blend = 10 },
- StatusLineNC = { fg = "subtle", bg = "surface" },
- },
- })
- vim.cmd("colorscheme rose-pine")
- end
- },
- --Syntaxhighlighting
- {
- "nvim-treesitter/nvim-treesitter",
- event = { "BufReadPost", "BufNewFile" },
- build = ":TSUpdate",
- config = function()
- require("nvim-treesitter.configs").setup({
- ensure_installed = {
- "asm",
- "c",
- "cpp",
- "c_sharp",
- "lua",
- "kotlin",
- "java",
- "bash",
- "html",
- "scss",
- "css",
- "typescript",
- "javascript",
- "svelte",
- "python",
- "rust",
- "markdown",
- "markdown_inline",
- "yaml",
- "json",
- "glsl",
- "make",
- "gitignore",
- "gitattributes",
- "gitcommit",
- },
- highlight = {
- enable = true
- }
- })
- end
- },
- --Misc
- {
- "andweeb/presence.nvim",
- event = { "BufReadPost", "BufNewFile" },
- opts = {
- main_image = "file",
- log_level = "debug",
- },
- },
- {
- "stevearc/dressing.nvim",
- event = "VeryLazy",
- },
- {
- "NStefan002/screenkey.nvim",
- cmd = "Screenkey",
- version = "*",
- config = true
- },
- {
- "eandrju/cellular-automaton.nvim",
- cmd = "CellularAutomaton",
- },
- --Formatting
- {
- "nvimdev/guard.nvim",
- dependencies = {
- "nvimdev/guard-collection"
- },
- ft = { "c", "cpp", "json", "lua", "python", "cs" },
- config = function()
- local ft = require("guard.filetype")
-
- ft("c,cpp,h"):fmt("clang-format")
- ft("json"):fmt({
- cmd = "jq",
- stdin = true
- })
- vim.g.guard_config = {
- fmt_on_save = true,
- lsp_as_default_formatter = true
- }
- end
- },
- --JSON
- {
- "b0o/schemastore.nvim",
- },
- -- Java
- {
- "mfussenegger/nvim-jdtls"
- },
- --Rust
- {
- "rust-lang/rust.vim",
- ft = "rust",
- init = function()
- vim.g.rustfmt_autosave = 1
- end,
- },
- {
- "saecki/crates.nvim",
- tag = "stable",
- dependencies = "hrsh7th/nvim-cmp",
- event = { "BufRead Cargo.toml" },
- config = function()
- local crates = require("crates")
- crates.setup()
-
- vim.keymap.set("n", "<leader>rcu", function()
- crates.upgrade_all_crates()
- end)
- end
- },
- --LaTeX
- {
- "lervag/vimtex",
- dependencies = "micangl/cmp-vimtex",
- ft = "tex",
- init = function()
- vim.g.vimtex_view_method = 'mupdf'
- end
- },
-}
-
-return plugins
diff --git a/lua/pml68/plugins/colors.lua b/lua/pml68/plugins/colors.lua
new file mode 100644
index 0000000..2587409
--- /dev/null
+++ b/lua/pml68/plugins/colors.lua
@@ -0,0 +1,31 @@
+return {
+ {
+ "brenoprata10/nvim-highlight-colors",
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ require("nvim-highlight-colors").setup({
+ render = 'background',
+ enable_tailwind = true,
+ })
+ end
+ },
+ {
+ "rose-pine/neovim",
+ name = "rose-pine",
+ priority = 1000,
+ lazy = false,
+ config = function()
+ require("rose-pine").setup({
+ styles = {
+ transparency = true,
+ italic = false,
+ },
+ highlight_groups = {
+ StatusLine = { fg = "iris", bg = "iris", blend = 10 },
+ StatusLineNC = { fg = "subtle", bg = "surface" },
+ },
+ })
+ vim.cmd("colorscheme rose-pine")
+ end
+ },
+}
diff --git a/lua/pml68/plugins/completion.lua b/lua/pml68/plugins/completion.lua
new file mode 100644
index 0000000..82f275e
--- /dev/null
+++ b/lua/pml68/plugins/completion.lua
@@ -0,0 +1,26 @@
+return {
+ "hrsh7th/nvim-cmp",
+ event = "InsertEnter",
+ dependencies = {
+ {
+ "windwp/nvim-autopairs",
+ opts = {
+ fast_wrap = {},
+ disable_filetype = { "TelescopePrompt", "vim" },
+ },
+ config = function(_, opts)
+ require("nvim-autopairs").setup(opts)
+
+ local cmp_autopairs = require "nvim-autopairs.completion.cmp"
+ require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
+ end,
+ },
+ "hrsh7th/cmp-nvim-lsp",
+ "hrsh7th/cmp-buffer",
+ "hrsh7th/cmp-path",
+ "hrsh7th/cmp-emoji"
+ },
+ config = function()
+ require("pml68.configs.cmp")
+ end,
+}
diff --git a/lua/pml68/plugins/git.lua b/lua/pml68/plugins/git.lua
new file mode 100644
index 0000000..38e67ea
--- /dev/null
+++ b/lua/pml68/plugins/git.lua
@@ -0,0 +1,21 @@
+return {
+ "lewis6991/gitsigns.nvim",
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ require("gitsigns").setup({
+ signs = {
+ add = { text = "│" },
+ change = { text = "│" },
+ delete = { text = "󰍵" },
+ topdelete = { text = "‾" },
+ changedelete = { text = "~" },
+ untracked = { text = "│" },
+ },
+ on_attach = function(bufnr)
+ local gs = package.loaded.gitsigns
+
+ vim.keymap.set("n", "<leader>gb", gs.blame_line, { buffer = bufnr })
+ end,
+ })
+ end
+}
diff --git a/lua/pml68/plugins/guard.lua b/lua/pml68/plugins/guard.lua
new file mode 100644
index 0000000..9f033b3
--- /dev/null
+++ b/lua/pml68/plugins/guard.lua
@@ -0,0 +1,20 @@
+return {
+ "nvimdev/guard.nvim",
+ dependencies = {
+ "nvimdev/guard-collection"
+ },
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ local ft = require("guard.filetype")
+
+ ft("c,cpp,h"):fmt("clang-format")
+ ft("json"):fmt({
+ cmd = "jq",
+ stdin = true
+ })
+ vim.g.guard_config = {
+ fmt_on_save = true,
+ lsp_as_default_formatter = true
+ }
+ end
+}
diff --git a/lua/pml68/plugins/lang-specific.lua b/lua/pml68/plugins/lang-specific.lua
new file mode 100644
index 0000000..f2cb418
--- /dev/null
+++ b/lua/pml68/plugins/lang-specific.lua
@@ -0,0 +1,41 @@
+return {
+ -- JSON
+ {
+ "b0o/schemastore.nvim",
+ },
+ -- Java
+ {
+ "mfussenegger/nvim-jdtls"
+ },
+ -- Rust
+ {
+ "rust-lang/rust.vim",
+ ft = "rust",
+ init = function()
+ vim.g.rustfmt_autosave = 1
+ end,
+ },
+ {
+ "saecki/crates.nvim",
+ tag = "stable",
+ dependencies = "hrsh7th/nvim-cmp",
+ event = { "BufRead Cargo.toml" },
+ config = function()
+ local crates = require("crates")
+ crates.setup()
+
+ vim.keymap.set("n", "<leader>rcu", function()
+ crates.upgrade_all_crates()
+ end)
+ end
+ },
+ -- LaTeX
+ {
+ "lervag/vimtex",
+ dependencies = "micangl/cmp-vimtex",
+ ft = "tex",
+ init = function()
+ vim.g.vimtex_view_method = 'mupdf'
+ end
+ },
+}
diff --git a/lua/pml68/plugins/lsp.lua b/lua/pml68/plugins/lsp.lua
new file mode 100644
index 0000000..644a206
--- /dev/null
+++ b/lua/pml68/plugins/lsp.lua
@@ -0,0 +1,25 @@
+return {
+ {
+ "neovim/nvim-lspconfig",
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ require("pml68.configs.lspconfig")
+ end
+ },
+ {
+ "williamboman/mason.nvim",
+ cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
+ opts = function()
+ return require("pml68.configs.mason")
+ end,
+ config = function(_, opts)
+ require("mason").setup(opts)
+ vim.api.nvim_create_user_command("MasonInstallAll", function()
+ if opts.ensure_installed and #opts.ensure_installed > 0 then
+ vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
+ end
+ end, {})
+ end,
+ build = ":MasonInstallAll",
+ },
+}
diff --git a/lua/pml68/plugins/misc.lua b/lua/pml68/plugins/misc.lua
new file mode 100644
index 0000000..147aaa4
--- /dev/null
+++ b/lua/pml68/plugins/misc.lua
@@ -0,0 +1,20 @@
+return {
+ {
+ "andweeb/presence.nvim",
+ event = { "BufReadPost", "BufNewFile" },
+ opts = {
+ main_image = "file",
+ log_level = "debug",
+ },
+ },
+ {
+ "NStefan002/screenkey.nvim",
+ cmd = "Screenkey",
+ version = "*",
+ config = true
+ },
+ {
+ "eandrju/cellular-automaton.nvim",
+ cmd = "CellularAutomaton",
+ },
+}
diff --git a/lua/pml68/plugins/oil.lua b/lua/pml68/plugins/oil.lua
new file mode 100644
index 0000000..974f94f
--- /dev/null
+++ b/lua/pml68/plugins/oil.lua
@@ -0,0 +1,29 @@
+return {
+ "stevearc/oil.nvim",
+ cmd = "Oil",
+ config = function()
+ require("oil").setup({
+ keymaps = {
+ ["<C-h>"] = false,
+ },
+ view_options = {
+ show_hidden = true,
+ natural_order = true,
+ is_always_hidden = function(name, _)
+ return name == '.git' or name == "node_modules" or name == "target"
+ end
+ },
+ float = {
+ padding = 2,
+ max_width = 50,
+ max_height = 0,
+ border = "single",
+ win_options = {
+ winblend = 0,
+ },
+ },
+ skip_confirm_for_simple_edits = true,
+ default_file_explorer = true,
+ })
+ end
+}
diff --git a/lua/pml68/plugins/other.lua b/lua/pml68/plugins/other.lua
new file mode 100644
index 0000000..cf7a888
--- /dev/null
+++ b/lua/pml68/plugins/other.lua
@@ -0,0 +1,23 @@
+return {
+ {
+ "NStefan002/visual-surround.nvim",
+ event = { "BufReadPost", "BufNewFile" },
+ config = true,
+ },
+ {
+ "christoomey/vim-tmux-navigator",
+ lazy = false,
+ },
+ {
+ "lukas-reineke/indent-blankline.nvim",
+ main = "ibl",
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ require("ibl").setup()
+ end
+ },
+ {
+ "stevearc/dressing.nvim",
+ event = "VeryLazy",
+ },
+}
diff --git a/lua/pml68/plugins/telescope.lua b/lua/pml68/plugins/telescope.lua
new file mode 100644
index 0000000..9c5de69
--- /dev/null
+++ b/lua/pml68/plugins/telescope.lua
@@ -0,0 +1,8 @@
+return {
+ "nvim-telescope/telescope.nvim",
+ tag = "0.1.6",
+ cmd = "Telescope",
+ dependencies = {
+ "nvim-lua/plenary.nvim"
+ },
+}
diff --git a/lua/pml68/plugins/treesitter.lua b/lua/pml68/plugins/treesitter.lua
new file mode 100644
index 0000000..3d395ea
--- /dev/null
+++ b/lua/pml68/plugins/treesitter.lua
@@ -0,0 +1,39 @@
+return {
+ "nvim-treesitter/nvim-treesitter",
+ event = { "BufReadPost", "BufNewFile" },
+ build = ":TSUpdate",
+ config = function()
+ require("nvim-treesitter.configs").setup({
+ ensure_installed = {
+ "asm",
+ "c",
+ "cpp",
+ "c_sharp",
+ "lua",
+ "kotlin",
+ "java",
+ "bash",
+ "html",
+ "scss",
+ "css",
+ "typescript",
+ "javascript",
+ "svelte",
+ "python",
+ "rust",
+ "markdown",
+ "markdown_inline",
+ "yaml",
+ "json",
+ "glsl",
+ "make",
+ "gitignore",
+ "gitattributes",
+ "gitcommit",
+ },
+ highlight = {
+ enable = true
+ }
+ })
+ end
+}