housekeeping
This commit is contained in:
parent
73eea67048
commit
ccbe053f88
7 changed files with 64 additions and 104 deletions
|
|
@ -1,38 +1,43 @@
|
|||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
--vim.keymap.set('n', '<leader>hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' })
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ggh",
|
||||
require("gitsigns").preview_hunk,
|
||||
{ buffer = bufnr, desc = "Preview git hunk" }
|
||||
)
|
||||
|
||||
-- don't override the built-in and fugitive keymaps
|
||||
local gs = package.loaded.gitsigns
|
||||
vim.keymap.set({ 'n', 'v' }, ']c', function()
|
||||
if vim.wo.diff then
|
||||
return ']c'
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' })
|
||||
vim.keymap.set({ 'n', 'v' }, '[c', function()
|
||||
if vim.wo.diff then
|
||||
return '[c'
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' })
|
||||
end,
|
||||
},
|
||||
-- don't override the built-in and fugitive keymaps
|
||||
local gs = package.loaded.gitsigns
|
||||
vim.keymap.set({ "n", "v" }, "]c", function()
|
||||
if vim.wo.diff then
|
||||
return "]c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" })
|
||||
vim.keymap.set({ "n", "v" }, "[c", function()
|
||||
if vim.wo.diff then
|
||||
return "[c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
-- Git UI
|
||||
-- https://github.com/kdheepak/lazygit.nvim
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
--config = function()
|
||||
-- local oil = require("oil")
|
||||
-- oil.setup({
|
||||
-- default_file_explorer = true,
|
||||
-- columns = {
|
||||
-- --"size",
|
||||
-- "icon",
|
||||
-- },
|
||||
-- view_options = {
|
||||
-- show_hidden = true,
|
||||
-- },
|
||||
-- keymaps = {
|
||||
-- -- This should be matched to the open action in remap.lua
|
||||
-- ["<leader>e"] = "actions.close",
|
||||
-- ["<C-v>"] = "actions.select_vsplit",
|
||||
-- ["<C-x>"] = "actions.select_split",
|
||||
-- },
|
||||
-- })
|
||||
--end,
|
||||
}
|
||||
|
|
@ -20,8 +20,8 @@ return {
|
|||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.4,
|
||||
width = 0.75,
|
||||
preview_width = 0.45,
|
||||
width = 0.90,
|
||||
height = 0.75,
|
||||
preview_cutoff = 90,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ return {
|
|||
"python",
|
||||
"regex",
|
||||
"json",
|
||||
"go",
|
||||
"gomod",
|
||||
"gosum",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
|
|
|
|||
|
|
@ -6,23 +6,4 @@ return {
|
|||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
--config = function()
|
||||
-- local oil = require("oil")
|
||||
-- oil.setup({
|
||||
-- default_file_explorer = true,
|
||||
-- columns = {
|
||||
-- --"size",
|
||||
-- "icon",
|
||||
-- },
|
||||
-- view_options = {
|
||||
-- show_hidden = true,
|
||||
-- },
|
||||
-- keymaps = {
|
||||
-- -- This should be matched to the open action in remap.lua
|
||||
-- ["<leader>e"] = "actions.close",
|
||||
-- ["<C-v>"] = "actions.select_vsplit",
|
||||
-- ["<C-x>"] = "actions.select_split",
|
||||
-- },
|
||||
-- })
|
||||
--end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue