Skip to content

Commit

Permalink
feat: added conflict marker for git
Browse files Browse the repository at this point in the history
  • Loading branch information
reVrost committed Jan 6, 2025
1 parent 88ca430 commit dfb1292
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 22 deletions.
1 change: 0 additions & 1 deletion .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ alias -g L="| lnav"
alias -g A="| awk '{print \$1}'"


[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH"

# pyenv
Expand Down
1 change: 1 addition & 0 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dofile(vim.g.base46_cache .. "statusline")

require "nvchad.options"
require "nvchad.autocmds"

require "init"

vim.schedule(function()
Expand Down
28 changes: 15 additions & 13 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" },
"avante.nvim": { "branch": "main", "commit": "9abbec4c5b580b514184990490dea74d0cdc27cc" },
"avante.nvim": { "branch": "main", "commit": "078e9312dc27114414242da2fcdab12c35035aec" },
"base46": { "branch": "v2.5", "commit": "5009bc479de4f53ec98e9dd1692beb1f39ff3a82" },
"cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" },
"conflict-marker.nvim": { "branch": "master", "commit": "9afbd2d28f496fec364f238d1d20252d9bd4eb0a" },
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
"copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" },
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
"dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" },
Expand All @@ -18,35 +19,36 @@
"dropbar.nvim": { "branch": "master", "commit": "e5f9fb998a54c0ec1c2d25de88a3c260c494ffe1" },
"flit.nvim": { "branch": "main", "commit": "1ef72de6a02458d31b10039372c8a15ab8989e0d" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"fzf-lua": { "branch": "main", "commit": "60428a8dc931639ee5e88756b2d7bc896cdc20c7" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
"img-clip.nvim": { "branch": "main", "commit": "5ff183655ad98b5fc50c55c66540375bbd62438c" },
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazy.nvim": { "branch": "main", "commit": "72aa3a2624be5dc240646084f7b6a38eb99eb2ce" },
"leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" },
"menu": { "branch": "main", "commit": "bea08e6f8772cb4d362795b0c7ae6343d0b229df" },
"mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" },
"mini.files": { "branch": "main", "commit": "4d2359158a171564d0a46d4a48da8b4491649f6a" },
"mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
"minty": { "branch": "main", "commit": "6dce9f097667862537823d515a0250ce58faab05" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-autopairs": { "branch": "master", "commit": "a50878826cb035a56cb17c1c442d0617f2677dac" },
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
"nvim-cmp": { "branch": "main", "commit": "4c1ca8268569bfc6d487473cd17b167560e5bed2" },
"nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" },
"nvim-tree.lua": { "branch": "master", "commit": "f7b76cd1a75615c8d6254fc58bedd2a7304eb7d8" },
"nvim-treesitter": { "branch": "master", "commit": "5f78e989243f9fb0fb55e0cf54820920d86dfd30" },
"nvim-treesitter": { "branch": "master", "commit": "556ac68cd33973a38d3f2abac47f361432593fe2" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" },
"nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"quicker.nvim": { "branch": "master", "commit": "87dae0f25733b7bd79b600a70ca38040db68ec0b" },
"render-markdown.nvim": { "branch": "main", "commit": "6fbd1491abc104409f119685de5353c35c97c005" },
"quicker.nvim": { "branch": "master", "commit": "e4fb0b1862284757561d1d51091cdee907585948" },
"render-markdown.nvim": { "branch": "main", "commit": "16369540a005ad0cf267498162aedca6dfca1b9c" },
"smear-cursor.nvim": { "branch": "main", "commit": "051fe67e0081da273e07cd33ab8357d6b720f08f" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "649b662a8f476fd2c0289570764459e95ebaa3f3" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"ui": { "branch": "v3.0", "commit": "3d3c0ad15401a2226d1dac094e742aca45f77352" },
"ui": { "branch": "v3.0", "commit": "c3681e7b17885fa2b9d483df2d27b79605fd6962" },
"vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" },
"vim-cursorword": { "branch": "master", "commit": "371fdd7fa8817c28aa09d181cfcfa3c7ca29bf56" },
"vim-go": { "branch": "master", "commit": "6adc82bfef7f9a4b0db78065ae51b8ebb145c355" },
Expand Down
6 changes: 5 additions & 1 deletion nvim/lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ vim.api.nvim_create_autocmd("BufWritePost", {
-- vim.api.nvim_set_hl(0, "DiffDelete", { fg = "none", bg = "#3F2D3D" })
-- vim.api.nvim_set_hl(0, "DiffviewDiffAddAsDelete", { fg = "#ffffff", bg = "#3f2d3d" })
vim.api.nvim_set_hl(0, "DiffviewDiffDelete", { fg = "#3B4252", bg = "none" })

-- Conflict markers
vim.api.nvim_set_hl(0, "ConflictOurs", { fg = "none", bg = "#405060" })
vim.api.nvim_set_hl(0, "ConflictTheirs", { fg = "none", bg = "#415050" })

--
-- -- Left Panel Highlights
-- vim.api.nvim_set_hl(0, "DiffAddAsDelete", { fg = "none", bg = "#3F2D3D" })
-- vim.api.nvim_set_hl(0, "DiffDeleteText", { fg = "none", bg = "#4B1818" })
--
-- -- Right Panel Highlights
-- vim.api.nvim_set_hl(0, "DiffAddText", { fg = "#ffffff", bg = "#1C5458" })

-- vim.api.nvim_set_hl(0, "LeapMatch", {
-- ---For light themes, set to 'black' or similar.
-- fg = vim.go.background == "dark" and "white" or "black",
Expand Down
83 changes: 76 additions & 7 deletions nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,16 @@ local plugins = {

opts = {
smear_between_neighbor_lines = false,
legacy_computing_symbols_support = true,
cursor_color = "#d3cdc3",
transparent_bg_fallback_color = "#303030",
},
},
{
"ibhagwan/fzf-lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
},
{
"Bekaboo/dropbar.nvim",
dependencies = {
Expand Down Expand Up @@ -445,19 +450,46 @@ local plugins = {
lazy = false,
version = false, -- set this if you want to always pull the latest change
opts = {
provider = "openai",
provider = "copilot",
openai = {
endpoint = "https://openrouter.ai/api/v1",
model = "deepseek/deepseek-chat",
api_key_name = "OPENROUTER_API_KEY",
temperature = 0.6,
max_tokens = 8000,
},
},
keys = {
{ "<leader>aa", "<cmd>AvanteAsk<CR>", desc = "avante: open" },
{ "<leader>ac", "<cmd>AvanteChat<CR>", desc = "avante: chat" },
{ "<leader>ae", "<cmd>AvanteEdit<CR>", desc = "avante: edit" },
behaviour = {
support_paste_from_clipboard = true,
auto_apply_diff_after_generation = true,
},
mappings = {
submit = { normal = "<CR>", insert = "<CR>" },
suggestion = {
accept = "<M-j>",
next = "<M-l>",
prev = "<M-h>",
dismiss = "<M-k>",
},
jump = {
next = "]]",
prev = "[[",
},
},
windows = {
position = "smart",
sidebar_header = {
align = "left", -- left, center, right for title
rounded = false,
enabled = false,
},
input = { prefix = "" },
ask = { start_insert = true },
edit = { start_insert = true },
},
file_selector = {
start_insert = true,
provider = "fzf",
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
Expand Down Expand Up @@ -497,5 +529,42 @@ local plugins = {
},
},
},
{
"tronikelis/conflict-marker.nvim",
lazy = false,
config = function()
require("conflict-marker").setup {
highlights = true,

on_attach = function(conflict)
local map = function(key, fn)
vim.keymap.set("n", key, fn, { buffer = conflict.bufnr })
end
local MID = "^=======$"

map("[x", function()
vim.cmd("?" .. MID)
end)

map("]x", function()
vim.cmd("/" .. MID)
end)

map("co", function()
conflict:choose_ours()
end)
map("ct", function()
conflict:choose_theirs()
end)
map("cb", function()
conflict:choose_both()
end)
map("cn", function()
conflict:choose_none()
end)
end,
}
end,
},
}
return plugins

0 comments on commit dfb1292

Please sign in to comment.