more neovim plugins

This commit is contained in:
Mark Riedesel 2024-06-20 08:19:09 -05:00
parent bbf6641115
commit ef84f5b008
10 changed files with 81 additions and 18 deletions

View file

@ -3,7 +3,7 @@ return {
event = "VimEnter",
config = function ()
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
local dashboard = require 'alpha.themes.dashboard'
dashboard.section.header.val = {
" ▜█▙ ",

View file

@ -4,7 +4,6 @@ return {
version = "*",
opts = {
options = {
-- mode = "tabs",
separator_style = "slope",
diagnostics = "nvim_lsp",
},

View file

@ -0,0 +1,15 @@
return {
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function ()
-- <leader>cc
local comment = require "Comment"
local ts_context_commentstring = require "ts_context_commentstring.integrations.comment_nvim"
comment.setup({
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}

View file

@ -0,0 +1,47 @@
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
end
-- Navigation
map("n", "]h", gs.next_hunk, "Next Hunk")
map("n", "[h", gs.prev_hunk, "Prev Hunk")
-- Actions
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Stage hunk")
map("v", "<leader>hr", function()
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Reset hunk")
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
map("n", "<leader>hb", function()
gs.blame_line({ full = true })
end, "Blame line")
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
map("n", "<leader>hd", gs.diffthis, "Diff this")
map("n", "<leader>hD", function()
gs.diffthis("~")
end, "Diff this ~")
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
end,
},
}

View file

@ -0,0 +1,8 @@
return {
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPre", "BufNewFile" },
main = "ibl",
opts = {
indent = { char = "" },
},
}

View file

@ -3,6 +3,7 @@ return {
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lsp-signature-help",
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/neodev.nvim", opts = {} },
},

View file

@ -4,6 +4,7 @@ return {
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
"hrsh7th/cmp-nvim-lsp-signature-help", -- show completion hints for function calls
{
"L3MON4D3/LuaSnip",
-- follow latest release.
@ -55,6 +56,7 @@ return {
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = "nvim_lsp_signature_help" }, -- function parameters
}),
-- configure lspkind for vs-code like pictograms in completion menu

View file

@ -1,7 +0,0 @@
return {
'tpope/vim-commentary',
keys = {
{ '<leader>c', '<Plug>Commentary', mode = {'n','o','x'}, desc = "Toggle commented"},
{ '<leader>cc', '<Plug>CommentaryLine', mode = 'n', desc = "Toggle commented"},
},
}