From d625f9c8cb96e4c318bfd079d5fbe3521c655b11 Mon Sep 17 00:00:00 2001 From: Karolis Arbaciauskas Date: Wed, 1 Jan 2025 20:22:33 +0200 Subject: [PATCH] Update lazygit --- init.lua | 1 - lua/custom/plugins/lazygit.lua | 44 ++++++++++++++++++++---------- lua/kickstart/plugins/neo-tree.lua | 25 ----------------- 3 files changed, 30 insertions(+), 40 deletions(-) delete mode 100644 lua/kickstart/plugins/neo-tree.lua diff --git a/init.lua b/init.lua index 1d1b7853..7763a2ab 100644 --- a/init.lua +++ b/init.lua @@ -995,7 +995,6 @@ require('lazy').setup({ require 'kickstart.plugins.indent_line', require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua index 2b301957..d4ba711d 100644 --- a/lua/custom/plugins/lazygit.lua +++ b/lua/custom/plugins/lazygit.lua @@ -1,20 +1,36 @@ return { - 'kdheepak/lazygit.nvim', - lazy = true, - cmd = { - 'LazyGit', - 'LazyGitConfig', - 'LazyGitCurrentFile', - 'LazyGitFilter', - 'LazyGitFilterCurrentFile', - }, - dependencies = { - 'nvim-lua/plenary.nvim', + 'folke/snacks.nvim', + ---@diagnostic disable-next-line: undefined-doc-name + ---@type snacks.Config + opts = { + lazygit = { + -- your lazygit configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, }, keys = { - { 'gg', 'LazyGit', desc = 'Lazygit (Root Dir)' }, - { 'gf', 'LazyGitFilterCurrentFile', desc = 'Lazygit Current File History' }, - { 'gl', 'LazyGitFilter', desc = 'Lazygit log' }, + { + 'gg', + function() + Snacks.lazygit { cwd = vim.fn.getcwd() } + end, + { desc = 'Lazygit (Root Dir)' }, + }, + { + 'gf', + function() + Snacks.lazygit.log_file() + end, + { desc = 'Lazygit Current File History' }, + }, + { + 'gl', + function() + Snacks.lazygit.log { cwd = vim.fn.getcwd() } + end, + { desc = 'Lazygit Log' }, + }, { 'gb', 'Gitsigns blame', desc = 'Git blame' }, { 'gs', 'Telescope git_status', desc = 'Git Status' }, }, diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua deleted file mode 100644 index bd442269..00000000 --- a/lua/kickstart/plugins/neo-tree.lua +++ /dev/null @@ -1,25 +0,0 @@ --- Neo-tree is a Neovim plugin to browse the file system --- https://github.com/nvim-neo-tree/neo-tree.nvim - -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - cmd = 'Neotree', - keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, - }, - }, - }, -}