diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..86281ce5 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,11 @@ +return { + 'windwp/nvim-autopairs', + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..6a8b96e5 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,23 @@ +return { + 'theprimeagen/harpoon', + --dependencies = 'nvim-lua/plenary.nvim', + config = function() + local mark = require 'harpoon.mark' + local ui = require 'harpoon.ui' + + vim.keymap.set('n', 'a', mark.add_file, { desc = 'Add current file to harpoon' }) + vim.keymap.set('n', '', ui.toggle_quick_menu, { desc = ' harpoon menu' }) + vim.keymap.set('n', '', function() + ui.nav_file(1) + end) + vim.keymap.set('n', '', function() + ui.nav_file(2) + end) + vim.keymap.set('n', '', function() + ui.nav_file(3) + end) + vim.keymap.set('n', '', function() + ui.nav_file(4) + end) + end, +} diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua new file mode 100644 index 00000000..6a305254 --- /dev/null +++ b/lua/custom/plugins/lsp.lua @@ -0,0 +1,25 @@ +return { + "scalameta/nvim-metals", + dependencies = { + "nvim-lua/plenary.nvim", + }, + ft = { "scala", "sbt", "java" }, + opts = function() + local metals_config = require("metals").bare_config() + metals_config.on_attach = function(client, bufnr) + -- your on_attach function + end + + return metals_config + end, + config = function(self, metals_config) + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = self.ft, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) + end +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000..122a32b6 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + 'mbbill/undotree', + config = function() + vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) + end, +} diff --git a/lua/custom/plugins/vim-fugitive.lua b/lua/custom/plugins/vim-fugitive.lua new file mode 100644 index 00000000..ae81d050 --- /dev/null +++ b/lua/custom/plugins/vim-fugitive.lua @@ -0,0 +1,7 @@ +return { + 'tpope/vim-fugitive', + + config = function() + vim.keymap.set('n', 'gs', vim.cmd.Git, { desc = '[G]it [S]tatus' }) + end, +}