Fix tabufline, auto ft=diff on diffview, add diff highlight syntax + lua tabstop=2

This commit is contained in:
Loïc Gremaud 2024-08-15 16:41:07 +02:00
parent f445ce91e7
commit 2cc874f891
Signed by: Legrems
GPG Key ID: D4620E6DF3E0121D
4 changed files with 26 additions and 3 deletions

2
after/ftplugin/lua.vim Normal file
View File

@ -0,0 +1,2 @@
setlocal tabstop=2
setlocal shiftwidth=2

11
after/syntax/diff.vim Normal file
View File

@ -0,0 +1,11 @@
" hi DiffAdd gui=none guifg=NONE guibg=#bada9f
" hi DiffChange gui=none guifg=NONE guibg=#e5d5ac
" hi DiffDelete gui=bold guifg=#ff8080 guibg=#ffb0b0
" hi DiffText gui=none guifg=NONE guibg=#8cbee2
hi DiffAdd gui=none guifg=NONE guibg=#003200
hi DiffChange gui=none guifg=NONE guibg=#000032
hi DiffDelete gui=bold guifg=#ff8080 guibg=#602020
hi DiffText gui=bold guifg=NONE guibg=#102040
hi link @text.diff.add DiffAdd
hi link @text.diff.delete DiffDelete
hi link @text.diff.change DiffChange

View File

@ -1 +1,11 @@
return {} return {
hooks = {
diff_buf_read = function(_)
vim.opt_local.wrap = false
vim.opt_local.list = false
end,
view_opened = function(_)
vim.api.nvim_command "set ft=diff"
end,
},
}

View File

@ -206,11 +206,11 @@ map(
-- Tabufline -- Tabufline
-- cycle through buffers -- cycle through buffers
map("n", "<tab>", function() map("n", "<tab>", function()
require("nvchad.tabufline").tabuflineNext() require("nvchad.tabufline").next()
end, { desc = "Goto next buffer" }) end, { desc = "Goto next buffer" })
map("n", "<S-tab>", function() map("n", "<S-tab>", function()
require("nvchad.tabufline").tabuflinePrev() require("nvchad.tabufline").prev()
end, { desc = "Goto prev buffer" }) end, { desc = "Goto prev buffer" })
-- close buffer + hide terminal buffer -- close buffer + hide terminal buffer