From de594a0b9e9aadc7a660c20b67d13e960fc355db Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Tue, 9 Apr 2024 21:13:31 +0200 Subject: [PATCH] use Neogit and Diffview for git stuff --- README.md | 52 ++++++++++++++++------------------------------- lua/lazy-load.lua | 14 ++++++++++++- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 0683ada..1c5ac3b 100644 --- a/README.md +++ b/README.md @@ -331,15 +331,24 @@ Mardkown Preview plugin commands: #### Git stuff -|keys|action| -|----|----| -Ctrl+g show current code chunk changes -|\hb | show full git blame of current line (double use to enter displayed diff)| -|\hD |show splitted blame diff (double use to enter displayed diff)| -|\hd| show splitted diff| -|\hr| reset hunk| -|\hR| reset whole buffer| -|\td| toggle deleted | +##### Neogit + +Just run `:Neogit` to launch it, `?` for help, changing parameters is +done usually by adding `-` before letter assigned to specific option. + +##### Diffview + +Diff log / file history: + +```bash +:DiffviewFileHistory +``` + +Diff log of single file (or dir): + +```bash +:DiffviewFileHistory +``` ##### Telescope git stuff @@ -352,31 +361,6 @@ Bindings: |gc|git_commits| |gb|git_branches| -Genreal git commands: - -```bash -:Git - -#Commands with dedicated display -:Git # show nice interactive summary of whole git project state -:Git mergetool, :Git difftool # load their changesets into the quickfix list -:Git blame # this will nicely show \ - # for every line in separate split - # Useful shortcuts for blame mode: - # o - jump to patch or blob in horizontal split - # A, C, D - different display (lenght) modes - # g? - other keybindings - -#other examples: -:Git add . -:Git commit -``` - -Nice single file diff viewer: - -``` -:Gdiffsplit -``` GitSings provides some commands for displaying git stuff: diff --git a/lua/lazy-load.lua b/lua/lazy-load.lua index 6ab0869..d239ed0 100644 --- a/lua/lazy-load.lua +++ b/lua/lazy-load.lua @@ -117,7 +117,19 @@ require("lazy").setup({ 'rmagatti/auto-session', opts = require('plugins.auto-session').config }, - { 'tpope/vim-fugitive' }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua", -- optional + }, + config = true + }, + { 'Glench/Vim-Jinja2-Syntax', priority = 15 }, { 'vmware-archive/salt-vim', priority = 10 }, { 'stephpy/vim-yaml' }, -- for proper sls syntax highlighting when jinja