added plugins

This commit is contained in:
Max Reed 2024-11-20 10:15:47 +01:00
parent 2ba39c6973
commit 83cf11d0ad
13 changed files with 338 additions and 0 deletions

View File

@ -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', '<C-e>', function()
toggle_telescope(harpoon:list())
end, { desc = 'Open harpoon window' })
vim.keymap.set('n', '<leader>ah', function()
harpoon:list():add()
end)
-- vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set('n', '<C-h>', function()
harpoon:list():select(1)
end)
vim.keymap.set('n', '<C-t>', function()
harpoon:list():select(2)
end)
vim.keymap.set('n', '<C-n>', function()
harpoon:list():select(3)
end)
vim.keymap.set('n', '<C-s>', function()
harpoon:list():select(4)
end)
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set('n', '<C-S-P>', function()
harpoon:list():prev()
end)
vim.keymap.set('n', '<C-S-N>', function()
harpoon:list():next()
end)

View File

@ -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,
},
}

View File

@ -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,
}

View File

@ -0,0 +1,3 @@
return {
'tpope/vim-fugitive',
}

View File

@ -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', '<C-e>', function()
toggle_telescope(harpoon:list())
end, { desc = 'Open harpoon window' })
local harpoon = require 'harpoon'
vim.keymap.set('n', '<leader>ah', function()
harpoon:list():add()
end, { desc = '[A]dd to [H]arpoon list' })
-- vim.keymap.set('n', '<C-e>', function()
-- harpoon.ui:toggle_quick_menu(harpoon:list())
-- end)
vim.keymap.set('n', '<C-1>', function()
harpoon:list():select(1)
end)
vim.keymap.set('n', '<C-2>', function()
harpoon:list():select(2)
end)
vim.keymap.set('n', '<C-3>', function()
harpoon:list():select(3)
end)
vim.keymap.set('n', '<C-4>', function()
harpoon:list():select(4)
end)
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set('n', '<A-h>', function()
harpoon:list():prev()
end)
vim.keymap.set('n', '<A-l>', function()
harpoon:list():next()
end)
vim.keymap.set('n', '<C-x>', function()
harpoon:list():remove()
end)
end,
}

View File

@ -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,
}

View File

@ -0,0 +1,7 @@
return {
'jose-elias-alvarez/null-ls.nvim',
ft = { 'go', 'python' },
opts = function()
return require 'custom.configs.null-ls'
end,
}

View File

@ -0,0 +1,142 @@
return {
{
'mfussenegger/nvim-dap',
dependencies = {
'nvim-neotest/nvim-nio',
},
keys = {
{
'<leader>db',
function()
require('dap').toggle_breakpoint()
end,
desc = 'Toggle [d]ap [b]reakpoint',
},
{
'<F5>',
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 = {
{
'<leader>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', '<Esc>' },
},
},
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 = { '<CR>', '<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,
},
}

View File

@ -0,0 +1,3 @@
return {
'jalvesaq/nvim-r',
}

View File

@ -0,0 +1,13 @@
return {
"windwp/nvim-ts-autotag",
ft = {
"javascript",
"typescript",
"html",
"svelte",
},
config = function()
require("nvim-ts-autotag").setup()
end,
}

View File

@ -0,0 +1,3 @@
return {
'kylechui/nvim-surround',
}

View File

@ -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,
}

View File

@ -0,0 +1,3 @@
return {
'ThePrimeagen/vim-be-good',
}