diff --git a/config/git/config b/config/git/config index 789cbb47..619102f9 100644 --- a/config/git/config +++ b/config/git/config @@ -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 diff --git a/config/lazygit/config.yml b/config/lazygit/config.yml index ce1850b1..45a7ae8f 100644 --- a/config/lazygit/config.yml +++ b/config/lazygit/config.yml @@ -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" diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 3c15ca91..63b0a5c7 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -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" diff --git a/config/nvim/lua/config/diffview.lua b/config/nvim/lua/config/diffview.lua new file mode 100644 index 00000000..b1acdbeb --- /dev/null +++ b/config/nvim/lua/config/diffview.lua @@ -0,0 +1,6 @@ +require("diffview").setup { + enhanced_diff_hl = true, + file_panel = { + listing_style = "list", + }, +} diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index 41e1aa05..0e6bbe17 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -23,6 +23,12 @@ vim.keymap.set("n", "g", "Neotree git_status") vim.keymap.set("n", "b", "Neotree buffers") vim.keymap.set("n", "\\", "Neotree reveal") +-- diffview +vim.keymap.set("n", "do", "DiffviewOpen") +vim.keymap.set("n", "dc", "DiffviewOpen") +vim.keymap.set("n", "dh", "DiffviewFileHistory") +vim.keymap.set("n", "df", "DiffviewFileHistory %") + -- Trouble vim.keymap.set("n", "xx", "TroubleToggle") vim.keymap.set("n", "xw", "TroubleToggle workspace_diagnostics") diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 97f0925f..80cfbf70 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -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