Add diffview plugin, add more config options to git for diff and merge tool

This commit is contained in:
Evie Litherland-Smith 2023-02-20 10:34:43 +00:00
parent 052a8a4dd4
commit 638d1e18f1
6 changed files with 47 additions and 16 deletions

View file

@ -8,3 +8,17 @@
rebase = false rebase = false
[color] [color]
ui = true ui = true
[diff]
tool = nvimdiff
algorithm = minimal
[difftool]
prompt = no
trustExitCode = yes
[alias]
dt = difftool
mt = mergetool
[merge]
tool = nvimdiff2
[mergetool]
keepBackup = yes
prompt = no

View file

@ -20,7 +20,7 @@ theme:
cherryPickedCommitFgColor: cherryPickedCommitFgColor:
- "#8aadf4" # Blue - "#8aadf4" # Blue
unstagedChangesColor: unstagedChangesColor:
- red # Red - red # Red
promptToReturnFromSubprocess: false promptToReturnFromSubprocess: false
# to exit immediately if run outside of the Git repository # to exit immediately if run outside of the Git repository
notARepository: 'quit' notARepository: "quit"

View file

@ -1,26 +1,26 @@
-- bootstrap lazy.nvim -- bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system {
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release "--branch=stable", -- latest stable release
lazypath, lazypath,
}) }
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local plugins = require("plugins") local plugins = require "plugins"
local opts = require("config.lazy") local opts = require "config.lazy"
require("lazy").setup(plugins, opts) require("lazy").setup(plugins, opts)
-- Set vim options -- Set vim options
require("options") require "options"
-- Define custom keymappings -- Define custom keymappings
require("keymaps") require "keymaps"
-- Remaining vim commands to be converted to lua -- Remaining vim commands to be converted to lua
require("vimcommands") require "vimcommands"

View file

@ -0,0 +1,6 @@
require("diffview").setup {
enhanced_diff_hl = true,
file_panel = {
listing_style = "list",
},
}

View file

@ -23,6 +23,12 @@ vim.keymap.set("n", "<leader>g", "<cmd>Neotree git_status<cr>")
vim.keymap.set("n", "<leader>b", "<cmd>Neotree buffers<cr>") vim.keymap.set("n", "<leader>b", "<cmd>Neotree buffers<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>") vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- diffview
vim.keymap.set("n", "<leader>do", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dc", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dh", "<cmd>DiffviewFileHistory<cr>")
vim.keymap.set("n", "<leader>df", "<cmd>DiffviewFileHistory %<cr>")
-- Trouble -- Trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>") vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>") vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")

View file

@ -100,5 +100,10 @@ local M = {
name = "Comment", name = "Comment",
config = function() require "Comment" end, config = function() require "Comment" end,
}, },
{
"sindrets/diffview.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
config = function() require "config.diffview" end,
},
} }
return M return M