Add diffview plugin, add more config options to git for diff and merge tool
This commit is contained in:
parent
052a8a4dd4
commit
638d1e18f1
|
@ -8,3 +8,17 @@
|
|||
rebase = false
|
||||
[color]
|
||||
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
|
||||
|
|
|
@ -20,7 +20,7 @@ theme:
|
|||
cherryPickedCommitFgColor:
|
||||
- "#8aadf4" # Blue
|
||||
unstagedChangesColor:
|
||||
- red # Red
|
||||
- red # Red
|
||||
promptToReturnFromSubprocess: false
|
||||
# to exit immediately if run outside of the Git repository
|
||||
notARepository: 'quit'
|
||||
notARepository: "quit"
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
-- 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
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
vim.fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local plugins = require("plugins")
|
||||
local opts = require("config.lazy")
|
||||
local plugins = require "plugins"
|
||||
local opts = require "config.lazy"
|
||||
require("lazy").setup(plugins, opts)
|
||||
|
||||
-- Set vim options
|
||||
require("options")
|
||||
require "options"
|
||||
|
||||
-- Define custom keymappings
|
||||
require("keymaps")
|
||||
require "keymaps"
|
||||
|
||||
-- Remaining vim commands to be converted to lua
|
||||
require("vimcommands")
|
||||
require "vimcommands"
|
||||
|
|
6
config/nvim/lua/config/diffview.lua
Normal file
6
config/nvim/lua/config/diffview.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
require("diffview").setup {
|
||||
enhanced_diff_hl = true,
|
||||
file_panel = {
|
||||
listing_style = "list",
|
||||
},
|
||||
}
|
|
@ -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>\\", "<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
|
||||
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
|
||||
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
|
||||
|
|
|
@ -100,5 +100,10 @@ local M = {
|
|||
name = "Comment",
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue