about summary refs log tree commit diff
path: root/fnl
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-03-19 00:40:13 +0900
committersefidel <contact@sefidel.net>2022-03-19 00:40:13 +0900
commit7bf8727cb4c81ea3c41b03f4e796461c91c6b281 (patch)
tree64f86d233117eff6bb7a2f95bab4184122227139 /fnl
parent8c20872b33f89eeb45f9271d9eb3a453899e97e8 (diff)
downloadnvimrc-7bf8727cb4c81ea3c41b03f4e796461c91c6b281.tar.gz
nvimrc-7bf8727cb4c81ea3c41b03f4e796461c91c6b281.zip
feat(pack): add gitsigns
Diffstat (limited to 'fnl')
-rw-r--r--fnl/nvrc/colors.fnl2
-rw-r--r--fnl/nvrc/options.fnl1
-rw-r--r--fnl/nvrc/pack.fnl1
-rw-r--r--fnl/nvrc/packs/gitsigns.fnl12
4 files changed, 15 insertions, 1 deletions
diff --git a/fnl/nvrc/colors.fnl b/fnl/nvrc/colors.fnl
index a26aa68..ea54216 100644
--- a/fnl/nvrc/colors.fnl
+++ b/fnl/nvrc/colors.fnl
@@ -16,6 +16,8 @@
 
   (vim.cmd (.. "colorscheme " colorscheme))
 
+  (highlight! :Signcolumn {:bg (. colors :bg)})
+
   ; Statusline
   (highlight! :StatusLineNC {:fg (. colors :graphite) :underline true})
   (highlight! :StatusLinePad {:fg (. colors :skyblue) :bg (. colors :light_bg)})
diff --git a/fnl/nvrc/options.fnl b/fnl/nvrc/options.fnl
index 995417d..67f521f 100644
--- a/fnl/nvrc/options.fnl
+++ b/fnl/nvrc/options.fnl
@@ -9,7 +9,6 @@
 (set! nonumber)
 (set! norelativenumber)
 (set! shortmess+ :sI)
-(set! signcolumn "auto:3")
 (set! scrolloff 3)
 (set! splitbelow)
 (set! splitright)
diff --git a/fnl/nvrc/pack.fnl b/fnl/nvrc/pack.fnl
index 79b53b5..185710e 100644
--- a/fnl/nvrc/pack.fnl
+++ b/fnl/nvrc/pack.fnl
@@ -26,6 +26,7 @@
 (pack! :stefandtw/quickfix-reflector.vim {:ft :qf})
 (pack! :tpope/vim-fugitive)
 (pack! :tpope/vim-eunuch)
+(pack! :lewis6991/gitsigns.nvim {:req :gitsigns})
 
 (pack! :hrsh7th/nvim-cmp {:req :cmp :event :InsertEnter
                           :requires [(pack :L3MON4D3/LuaSnip {:module :luasnip})
diff --git a/fnl/nvrc/packs/gitsigns.fnl b/fnl/nvrc/packs/gitsigns.fnl
new file mode 100644
index 0000000..c7dbed1
--- /dev/null
+++ b/fnl/nvrc/packs/gitsigns.fnl
@@ -0,0 +1,12 @@
+(import-macros {: map!} :nvrc.macro.keymap)
+
+(local {: setup} (require :gitsigns))
+
+(setup {:signs {:add {:text "+"}
+                :change {:text "~"}
+                :delete {:text "_"}
+                :topdelete {:text "‾"}
+                :changedelete {:text "~"}}
+        :on_attach (fn [bufnr]
+                      (map! [n :expr] "]c" "&diff ? ']c' : '<cmd>Gitsigns next_hunk<cr>'")
+                      (map! [n :expr] "[c" "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<cr>'"))})