return { -- Поддержка git { "lewis6991/gitsigns.nvim", config = function() require('gitsigns').setup() local function map(mode, l, r, opts) opts = opts or { noremap = true, silent = true } opts.buffer = bufnr vim.keymap.set(mode, l, r, opts) end local gs = package.loaded.gitsigns map('n', ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' end, {expr=true}) map('n', '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' end, {expr=true}) map('n', 'gs', gs.stage_hunk) map('n', 'gr', gs.reset_hunk) map('v', 'gs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) map('v', 'gr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) map('n', 'gS', gs.stage_buffer) map('n', 'gu', gs.undo_stage_hunk) map('n', 'gR', gs.reset_buffer) map('n', 'gp', gs.preview_hunk) map('n', 'gb', function() gs.blame_line{full=true} end) map('n', 'gtb', gs.toggle_current_line_blame) map('n', 'gd', gs.diffthis) map('n', 'gD', function() gs.diffthis('~') end) map('n', 'gtd', gs.toggle_deleted) end } }