[nvim] gitsigns

This commit is contained in:
Dmitry Chumak
2025-03-13 19:48:19 +03:00
parent 63250216bb
commit 5b562a12da
6 changed files with 45 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
require("funcs")
require("options") require("options")
require("keymap") require("keymap")
require("plugins/init") require("plugins/init")

8
nvim/lua/funcs.lua Normal file
View File

@@ -0,0 +1,8 @@
function Contains(list, element)
for _, v in ipairs(list) do
if element == v then
return true
end
end
return false
end

View File

@@ -113,6 +113,8 @@ require("lspconfig").bashls.setup { capabilities = capabilities, handlers = hand
} }
require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers, require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers,
on_attach = on_attach, on_attach = on_attach,
-- more details on configuring pyright can be found here
-- https://microsoft.github.io/pyright/#/settings?id=pyright-settings
settings = { settings = {
python = { python = {
analysis = { analysis = {

View File

@@ -1,3 +1,5 @@
IsYandex = Contains({"i113855042", "dmchumak-dev.sas.yp-c.yandex.net"}, vim.fn.hostname())
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
@@ -28,3 +30,7 @@ vim.keymap.set("n", "<C-h>", "<C-w>h")
vim.keymap.set("n", "<C-j>", "<C-w>j") vim.keymap.set("n", "<C-j>", "<C-w>j")
vim.keymap.set("n", "<C-k>", "<C-w>k") vim.keymap.set("n", "<C-k>", "<C-w>k")
vim.keymap.set("n", "<C-l>", "<C-w>l") vim.keymap.set("n", "<C-l>", "<C-w>l")
-- Keymap to copy to system buffer
vim.keymap.set('n','<leader>y','"+yy')
vim.keymap.set('v','<leader>y','"+y')

View File

@@ -0,0 +1,22 @@
require('gitsigns').setup(
{
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '-' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '-' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
}
)
vim.keymap.set('n', '<leader>vb', ':Gitsigns blame_line<CR>', {desc = "Blame current line (git/arc)"})

View File

@@ -64,6 +64,11 @@ local plugins = {
desc = "Buffer Local Keymaps (which-key)", desc = "Buffer Local Keymaps (which-key)",
}, },
}, },
},
-- GitSigns
{
dir = (IsYandex) and "~/arcadia/contrib/tier1/gitsigns.arc.nvim" or nil,
url = (not IsYandex) and "lewis6991/gitsigns.nvim" or nil,
} }
} }
@@ -71,3 +76,4 @@ require("lazy").setup(plugins)
require("plugins/telescope") require("plugins/telescope")
require("plugins/completions") require("plugins/completions")
require("plugins/gitsigns")