Skip to content

Commit

Permalink
plugins/gitsigns: onAttach example correction. (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbsmith authored Nov 17, 2023
1 parent 1b44fe3 commit 69f453a
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions plugins/git/gitsigns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,19 @@ in {
This callback can return `false` to prevent attaching to the buffer.
'';
example = ''
\'\'
function(bufnr)
if vim.api.nvim_buf_get_name(bufnr):match(<PATTERN>) then
-- Don't attach to specific buffers whose name matches a pattern
return false
end
-- Setup keymaps
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', '<cmd>lua require"gitsigns".stage_hunk()<CR>', {})
... -- More keymaps
end
\'\'
{
function = \'\'
function(bufnr)
if vim.api.nvim_buf_get_name(bufnr):match(<PATTERN>) then
-- Don't attach to specific buffers whose name matches a pattern
return false
end
-- Setup keymaps
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', '<cmd>lua require"gitsigns".stage_hunk()<CR>', {})
... -- More keymaps
end
\'\'
}
'';
};

Expand Down

0 comments on commit 69f453a

Please sign in to comment.