[nvim] add lazygit integration

This commit is contained in:
Marco Thomas
2022-12-06 11:32:44 +01:00
parent 013c4722f1
commit a702646ffc
5 changed files with 246 additions and 32 deletions

View File

@@ -55,13 +55,17 @@ wk.register({
})
-- git
map("n", "<leader>gs", "<cmd> Neogit<CR>", default_opts)
map("n", "<leader>gb", "<cmd> Git blame<CR>", default_opts)
map("n", "<leader>gc", "<cmd> LazyGitFilter<CR>", default_opts)
map("n", "<leader>gf", "<cmd> LazyGitFilterCurrentFile<CR>", default_opts)
map("n", "<leader>gs", "<cmd> LazyGit<CR>", default_opts)
wk.register({
["<leader>"] = {
g = {
s = { "Status" },
b = { "Blame" },
c = { "Commits" },
f = { "(Commits) File" },
s = { "Status" },
}
}
})
@@ -99,33 +103,8 @@ wk.register({
-- cmp
local cmp = require 'cmp'
local luasnip = require 'luasnip'
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
mapping = {
-- ["<Tab>"] = cmp.mapping(function(fallback) -- Advance to next parameter
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
-- ["<S-Tab>"] = cmp.mapping(function(fallback) -- Got back to last parameter
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-l>"] = cmp.mapping.confirm({

View File

@@ -119,13 +119,12 @@ return require('packer').startup(function(use)
config = function() require('plugins.todo-comments-conf') end
}
-- git client
-- interactive git
use {
'TimUntersberger/neogit',
requires = 'nvim-lua/plenary.nvim', -- General functions
config = function() require('plugins.neogit-conf') end,
'kdheepak/lazygit.nvim'
}
-- git cmd wrapper
use 'tpope/vim-fugitive'
-- git signs at left side (+ blame line)