diff --git a/lua/custom/configs/harpoon.lua b/lua/custom/configs/harpoon.lua new file mode 100644 index 00000000..c87c32fe --- /dev/null +++ b/lua/custom/configs/harpoon.lua @@ -0,0 +1,52 @@ +local harpoon = require 'harpoon' +harpoon:setup {} + +-- basic telescope configuration +local conf = require('telescope.config').values +local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require('telescope.pickers') + .new({}, { + prompt_title = 'Harpoon', + finder = require('telescope.finders').new_table { + results = file_paths, + }, + previewer = conf.file_previewer {}, + sorter = conf.generic_sorter {}, + }) + :find() +end + +vim.keymap.set('n', '', function() + toggle_telescope(harpoon:list()) +end, { desc = 'Open harpoon window' }) + +vim.keymap.set('n', 'ah', function() + harpoon:list():add() +end) +-- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set('n', '', function() + harpoon:list():select(1) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(2) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(3) +end) +vim.keymap.set('n', '', function() + harpoon:list():select(4) +end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set('n', '', function() + harpoon:list():prev() +end) +vim.keymap.set('n', '', function() + harpoon:list():next() +end) diff --git a/lua/custom/configs/null-ls.lua b/lua/custom/configs/null-ls.lua new file mode 100644 index 00000000..a511ee3d --- /dev/null +++ b/lua/custom/configs/null-ls.lua @@ -0,0 +1,14 @@ +local null_ls = require 'null-ls' + +local opts = { + sources = { + -- python tool + null_ls.builtins.formatting.black, + null_ls.builtins.diagnostics.mypy, + null_ls.builtins.diagnostics.ruff, + -- go tools + null_ls.builtins.formatting.gofmt, + null_ls.builtins.formatting.goimports_reviser, + null_ls.builtins.formatting.golines, + }, +} diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..6a9e751e --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,14 @@ +-- File: lua/custom/plugins/autopairs.lua + +return { + 'windwp/nvim-autopairs', + -- Optional dependency + 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/fugitive.lua b/lua/custom/plugins/fugitive.lua new file mode 100644 index 00000000..b6b4c97b --- /dev/null +++ b/lua/custom/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + 'tpope/vim-fugitive', +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..e56c79a5 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,66 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = function() + local harpoon = require 'harpoon' + harpoon:setup {} + + -- basic telescope configuration + local conf = require('telescope.config').values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require('telescope.pickers') + .new({}, { + prompt_title = 'Harpoon', + finder = require('telescope.finders').new_table { + results = file_paths, + }, + previewer = conf.file_previewer {}, + sorter = conf.generic_sorter {}, + }) + :find() + end + + vim.keymap.set('n', '', function() + toggle_telescope(harpoon:list()) + end, { desc = 'Open harpoon window' }) + local harpoon = require 'harpoon' + + vim.keymap.set('n', 'ah', function() + harpoon:list():add() + end, { desc = '[A]dd to [H]arpoon list' }) + + -- vim.keymap.set('n', '', function() + -- harpoon.ui:toggle_quick_menu(harpoon:list()) + -- end) + + vim.keymap.set('n', '', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end) + vim.keymap.set('n', '', function() + harpoon:list():next() + end) + vim.keymap.set('n', '', function() + harpoon:list():remove() + end) + end, +} diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua new file mode 100644 index 00000000..c792ce62 --- /dev/null +++ b/lua/custom/plugins/markdown-preview.lua @@ -0,0 +1,9 @@ +-- install without yarn or npm +return { + 'iamcco/markdown-preview.nvim', + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, + ft = { 'markdown' }, + build = function() + vim.fn['mkdp#util#install']() + end, +} diff --git a/lua/custom/plugins/null-ls.lua b/lua/custom/plugins/null-ls.lua new file mode 100644 index 00000000..3c511155 --- /dev/null +++ b/lua/custom/plugins/null-ls.lua @@ -0,0 +1,7 @@ +return { + 'jose-elias-alvarez/null-ls.nvim', + ft = { 'go', 'python' }, + opts = function() + return require 'custom.configs.null-ls' + end, +} diff --git a/lua/custom/plugins/nvim-dap.lua b/lua/custom/plugins/nvim-dap.lua new file mode 100644 index 00000000..fb2dddda --- /dev/null +++ b/lua/custom/plugins/nvim-dap.lua @@ -0,0 +1,142 @@ +return { + { + 'mfussenegger/nvim-dap', + dependencies = { + 'nvim-neotest/nvim-nio', + }, + keys = { + { + 'db', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Toggle [d]ap [b]reakpoint', + }, + { + '', + function() + require('dap').continue() + end, + desc = 'dap continue', + }, + }, + }, + { + 'mfussenegger/nvim-dap-python', + ft = 'python', + dependencies = { + 'mfussenegger/nvim-dap', + 'rcarriga/nvim-dap-ui', + }, + config = function() + local path = '~/.local/share/nvim/mason/packages/debugpy/venv/bin/python' + require('dap-python').setup(path) + end, + }, + { + 'leoluz/nvim-dap-go', + ft = 'go', + dependencies = { + 'mfussenegger/nvim-dap', + 'rcarriga/nvim-dap-ui', + }, + config = function() + require('dap-go').setup(opts) + end, + }, + + { + 'rcarriga/nvim-dap-ui', + keys = { + { + 'du', + function() + require('dapui').toggle() + end, + desc = 'Toggle [d]ap [u]i', + silent = true, + }, + }, + opts = { + controls = { + element = 'repl', + enabled = true, + icons = { + disconnect = '', + pause = '', + play = '', + run_last = '', + step_back = '', + step_into = '', + step_out = '', + step_over = '', + terminate = '', + }, + }, + element_mappings = {}, + expand_lines = true, + floating = { + border = 'single', + mappings = { + close = { 'q', '' }, + }, + }, + force_buffers = true, + icons = { + collapsed = '', + current_frame = '', + expanded = '', + }, + layouts = { + { + elements = { + { + id = 'scopes', + size = 0.25, + }, + { + id = 'breakpoints', + size = 0.25, + }, + { + id = 'stacks', + size = 0.25, + }, + { + id = 'watches', + size = 0.25, + }, + }, + position = 'left', + size = 40, + }, + { + elements = { { + id = 'repl', + size = 0.5, + }, { + id = 'console', + size = 0.5, + } }, + position = 'bottom', + size = 10, + }, + }, + mappings = { + edit = 'e', + expand = { '', '<2-LeftMouse>' }, + open = 'o', + remove = 'd', + repl = 'r', + toggle = 't', + }, + render = { + indent = 1, + max_value_lines = 100, + }, + }, + config = function(_, opts) + require('dapui').setup(opts) + end, + }, +} diff --git a/lua/custom/plugins/nvim-r.lua b/lua/custom/plugins/nvim-r.lua new file mode 100644 index 00000000..36a1db19 --- /dev/null +++ b/lua/custom/plugins/nvim-r.lua @@ -0,0 +1,3 @@ +return { + 'jalvesaq/nvim-r', +} diff --git a/lua/custom/plugins/nvim-ts-autotag.lua b/lua/custom/plugins/nvim-ts-autotag.lua new file mode 100644 index 00000000..ce3e8f9b --- /dev/null +++ b/lua/custom/plugins/nvim-ts-autotag.lua @@ -0,0 +1,13 @@ +return { + "windwp/nvim-ts-autotag", + ft = { + "javascript", + "typescript", + "html", + "svelte", + }, + + config = function() + require("nvim-ts-autotag").setup() + end, +} diff --git a/lua/custom/plugins/surround.lua b/lua/custom/plugins/surround.lua new file mode 100644 index 00000000..d2779575 --- /dev/null +++ b/lua/custom/plugins/surround.lua @@ -0,0 +1,3 @@ +return { + 'kylechui/nvim-surround', +} diff --git a/lua/custom/plugins/tailwind-css-colorizer.lua b/lua/custom/plugins/tailwind-css-colorizer.lua new file mode 100644 index 00000000..7b804446 --- /dev/null +++ b/lua/custom/plugins/tailwind-css-colorizer.lua @@ -0,0 +1,9 @@ +return { + "roobert/tailwindcss-colorizer-cmp.nvim", + -- optionally, override the default options: + config = function() + require("tailwindcss-colorizer-cmp").setup({ + color_square_width = 2, + }) + end, +} diff --git a/lua/custom/plugins/vimbegood.lua b/lua/custom/plugins/vimbegood.lua new file mode 100644 index 00000000..b1e2a543 --- /dev/null +++ b/lua/custom/plugins/vimbegood.lua @@ -0,0 +1,3 @@ +return { + 'ThePrimeagen/vim-be-good', +}