summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/user/plugins
diff options
context:
space:
mode:
authorJackJ30 <jackqjamison@gmail.com>2025-05-27 21:45:51 -0400
committerJackJ30 <jackqjamison@gmail.com>2025-05-27 21:45:51 -0400
commit80351c2cde0845c894466dd83b0554e4f96cbcb0 (patch)
tree8783146cc0319df20e3edb85615c09e6d1b8a3e0 /.config/nvim/lua/user/plugins
parent41b74f66946213b6efc4134a514fd5ab76b03353 (diff)
new nvim
Diffstat (limited to '.config/nvim/lua/user/plugins')
-rw-r--r--.config/nvim/lua/user/plugins/cmp.lua24
-rw-r--r--.config/nvim/lua/user/plugins/colorscheme.lua6
-rw-r--r--.config/nvim/lua/user/plugins/find-file.lua10
-rw-r--r--.config/nvim/lua/user/plugins/init.lua1
-rw-r--r--.config/nvim/lua/user/plugins/lspconfig.lua73
-rw-r--r--.config/nvim/lua/user/plugins/luadev.lua5
-rw-r--r--.config/nvim/lua/user/plugins/mini.lua7
-rw-r--r--.config/nvim/lua/user/plugins/trouble.lua5
8 files changed, 131 insertions, 0 deletions
diff --git a/.config/nvim/lua/user/plugins/cmp.lua b/.config/nvim/lua/user/plugins/cmp.lua
new file mode 100644
index 0000000..8776310
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/cmp.lua
@@ -0,0 +1,24 @@
+return {
+ 'hrsh7th/nvim-cmp',
+ event = { 'InsertEnter', 'CmdlineEnter' },
+ dependencies = {
+ 'hrsh7th/cmp-buffer',
+ 'hrsh7th/cmp-cmdline',
+ 'hrsh7th/cmp-path',
+ },
+ opts = function()
+ local cmp = require('cmp')
+
+ return {
+ mapping = cmp.mapping.preset.insert(),
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ }, {
+ { name = 'buffer' },
+ }, {
+ { name = 'path' },
+ })
+ }
+ end,
+}
+
diff --git a/.config/nvim/lua/user/plugins/colorscheme.lua b/.config/nvim/lua/user/plugins/colorscheme.lua
new file mode 100644
index 0000000..7862f25
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/colorscheme.lua
@@ -0,0 +1,6 @@
+return {
+ "Mofiqul/dracula.nvim",
+ config = function ()
+ vim.cmd[[colorscheme dracula]]
+ end
+}
diff --git a/.config/nvim/lua/user/plugins/find-file.lua b/.config/nvim/lua/user/plugins/find-file.lua
new file mode 100644
index 0000000..b547d10
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/find-file.lua
@@ -0,0 +1,10 @@
+return {
+ "NAHTAIV3L/vertico.nvim",
+ dependencies = {
+ 'nvim-lua/plenary.nvim',
+ },
+ config = function ()
+ vim.keymap.set("n", "<leader>f", require("vertico").find_file)
+ vim.keymap.set("n", "<C-g>", require("vertico").close)
+ end
+}
diff --git a/.config/nvim/lua/user/plugins/init.lua b/.config/nvim/lua/user/plugins/init.lua
new file mode 100644
index 0000000..a564707
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/init.lua
@@ -0,0 +1 @@
+return {}
diff --git a/.config/nvim/lua/user/plugins/lspconfig.lua b/.config/nvim/lua/user/plugins/lspconfig.lua
new file mode 100644
index 0000000..371fdec
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/lspconfig.lua
@@ -0,0 +1,73 @@
+local on_attach = function(client, bufnr)
+ local keymap = function(mode, keys, func, opts)
+ opts.buffer = bufnr
+ vim.keymap.set(mode, keys, func, opts)
+ end
+
+ keymap('n', 'gd', vim.lsp.buf.definition, { desc = 'Go to definition' })
+ keymap('n', 'gD', vim.lsp.buf.declaration, { desc = 'Go to declaration' })
+ keymap('n', 'gI', vim.lsp.buf.implementation, { desc = 'Go to implementation' })
+ keymap('n', 'gy', vim.lsp.buf.type_definition, { desc = 'Go to type definition' })
+ keymap('n', 'gr', vim.lsp.buf.references, { desc = 'List references' })
+
+ keymap('n', '<leader>ds', vim.lsp.buf.document_symbol, { desc = 'List document symbols' })
+ keymap('n', '<leader>ws', vim.lsp.buf.workspace_symbol, { desc = 'List workspace symbols' })
+
+ keymap('n', 'K', vim.lsp.buf.hover, { desc = 'Show documentation' })
+ keymap('n', 'gK', vim.lsp.buf.signature_help, { desc = 'Show signature' })
+ keymap('i', '<C-k>', vim.lsp.buf.signature_help, { desc = 'Show signature' })
+
+ keymap('n', '<leader>rn', vim.lsp.buf.rename, { desc = 'Rename symbol' })
+ keymap('n', '<leader>ca', vim.lsp.buf.code_action, { desc = 'Code action' })
+
+ keymap('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, { desc = 'Add workspace folder' })
+ keymap('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, { desc = 'Remove workspace folder' })
+ keymap(
+ 'n',
+ '<leader>wl',
+ function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,
+ { desc = 'List workspace folders' }
+ )
+end
+
+return {
+ 'neovim/nvim-lspconfig',
+ dependencies = {
+ "hrsh7th/cmp-nvim-lsp",
+ },
+ ft = { 'lua', 'zig' },
+ opts = {
+ servers = {
+ lua_ls = {
+ settings = {
+ Lua = {
+ workspace = { checkThirdParty = false },
+ telemetry = { enable = false },
+ },
+ },
+ },
+ zls = {
+ settings = {},
+ },
+ },
+ },
+ config = function(_, opts)
+ local lspconfig = require('lspconfig');
+ local capabilities = require('cmp_nvim_lsp').default_capabilities()
+
+ for name, conf in pairs(opts.servers) do
+ lspconfig[name].setup {
+ capabilities = capabilities,
+ settings = conf.settings,
+ on_attach = function(client, bufnr)
+ local _, err = pcall(on_attach, client, bufnr)
+ if err then
+ vim.notify('[on_attach] error: ' .. err, vim.log.levels.ERROR)
+ else
+ vim.notify('[on_attach] ' .. client.name .. ' attached to buffer ' .. bufnr, vim.log.levels.INFO)
+ end
+ end,
+ }
+ end
+ end
+}
diff --git a/.config/nvim/lua/user/plugins/luadev.lua b/.config/nvim/lua/user/plugins/luadev.lua
new file mode 100644
index 0000000..7011f66
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/luadev.lua
@@ -0,0 +1,5 @@
+return {
+ "folke/lazydev.nvim",
+ ft = "lua",
+ config = true,
+}
diff --git a/.config/nvim/lua/user/plugins/mini.lua b/.config/nvim/lua/user/plugins/mini.lua
new file mode 100644
index 0000000..879c14d
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/mini.lua
@@ -0,0 +1,7 @@
+return {
+ {
+ 'echasnovski/mini.pairs',
+ event = 'InsertEnter',
+ config = true,
+ },
+}
diff --git a/.config/nvim/lua/user/plugins/trouble.lua b/.config/nvim/lua/user/plugins/trouble.lua
new file mode 100644
index 0000000..1e81a92
--- /dev/null
+++ b/.config/nvim/lua/user/plugins/trouble.lua
@@ -0,0 +1,5 @@
+return {
+ "folke/trouble.nvim",
+ config = true,
+ cmd = "Trouble"
+}