From 26e183e5196d2a3e760e0c31bbcdd0c674e5b2a5 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 15 Feb 2025 21:24:25 -0500 Subject: [PATCH] add gitsigns features toggles In options.lua you can now set: - vim.g.git_line_hl: to enable line highlights - vim.g.git_word_hl: to enable word highlights --- lua/config/options.lua | 8 +++++++- lua/plugins/git.lua | 25 ++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index dd82d20..a17f2ae 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -31,6 +31,13 @@ vim.g.lazyvim_python_lsp = "pyright" ---@type string Options: [python -- Use tiny-inline-diagnostic vim.g.usetinyinline = true ---@type boolean Options: +-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ GIT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +-- Highlight lines with git changes +vim.g.git_line_hl = false ---@type boolean Options: +-- Highlight words with git changes +vim.g.git_word_hl = false ---@type boolean Options: + -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ FORMAT AND SAVE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ vim.opt.foldlevel = 99 ---@type integer Options: <0-99> @@ -41,7 +48,6 @@ vim.g.autosave = true ---@type boolean Options: - -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ MISCELLANEOUS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -- Use WakaTime for code stats diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua index c1f769d..7272165 100644 --- a/lua/plugins/git.lua +++ b/lua/plugins/git.lua @@ -12,20 +12,6 @@ return { keys = require('data.keys').gist.func, config = true, }, - -- { -- LazyGit - -- 'kdheepak/lazygit.nvim', - -- lazy = true, - -- cmd = require('data.cmd').lazygit, - -- keys = require('data.keys').lazygit, - -- dependencies = require('data.deps').lazygit, - -- config = function() - -- if - -- require('data.func').check_global_var('use_telescope', true, false) - -- then - -- require('telescope').load_extension('lazygit') - -- end - -- end, - -- }, { -- Thanks/github-stars 'jsongerber/thanks.nvim', lazy = true, @@ -54,7 +40,7 @@ return { 'sindrets/diffview.nvim', lazy = true, cmd = require('data.cmd').diffview, - opts = {}, + opts = require('data.types').diffview.opts, }, { -- Neogit 'NeogitOrg/neogit', @@ -62,4 +48,13 @@ return { graph_style = 'kitty', }, }, + { -- GitSigns + 'lewis6991/gitsigns.nvim', + opts = function() + local myopts = {} + myopts.linehl = vim.g.git_line_hl or false + myopts.word_diff = vim.g.git_word_hl or false + return myopts + end, + }, }