mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 00:48:58 +02:00
plugins/gitsigns: onAttach example correction. (#711)
This commit is contained in:
parent
1b44fe37a1
commit
69f453a417
1 changed files with 13 additions and 11 deletions
|
@ -108,17 +108,19 @@ in {
|
||||||
This callback can return `false` to prevent attaching to the buffer.
|
This callback can return `false` to prevent attaching to the buffer.
|
||||||
'';
|
'';
|
||||||
example = ''
|
example = ''
|
||||||
\'\'
|
{
|
||||||
function(bufnr)
|
function = \'\'
|
||||||
if vim.api.nvim_buf_get_name(bufnr):match(<PATTERN>) then
|
function(bufnr)
|
||||||
-- Don't attach to specific buffers whose name matches a pattern
|
if vim.api.nvim_buf_get_name(bufnr):match(<PATTERN>) then
|
||||||
return false
|
-- Don't attach to specific buffers whose name matches a pattern
|
||||||
end
|
return false
|
||||||
-- Setup keymaps
|
end
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', '<cmd>lua require"gitsigns".stage_hunk()<CR>', {})
|
-- Setup keymaps
|
||||||
... -- More keymaps
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', '<cmd>lua require"gitsigns".stage_hunk()<CR>', {})
|
||||||
end
|
... -- More keymaps
|
||||||
\'\'
|
end
|
||||||
|
\'\'
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue