doc: update integration spec
This commit is contained in:
parent
a880261988
commit
595c35d910
1 changed files with 61 additions and 52 deletions
|
|
@ -81,11 +81,13 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
|
||||||
vim.g.diffs = {
|
vim.g.diffs = {
|
||||||
debug = false,
|
debug = false,
|
||||||
hide_prefix = false,
|
hide_prefix = false,
|
||||||
fugitive = false,
|
integrations = {
|
||||||
neogit = false,
|
fugitive = false,
|
||||||
gitsigns = false,
|
neogit = false,
|
||||||
committia = false,
|
gitsigns = false,
|
||||||
telescope = false,
|
committia = false,
|
||||||
|
telescope = false,
|
||||||
|
},
|
||||||
extra_filetypes = {},
|
extra_filetypes = {},
|
||||||
highlights = {
|
highlights = {
|
||||||
background = true,
|
background = true,
|
||||||
|
|
@ -145,60 +147,63 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
|
||||||
is also enabled, the overlay inherits the line's
|
is also enabled, the overlay inherits the line's
|
||||||
background color.
|
background color.
|
||||||
|
|
||||||
{fugitive} (boolean|table, default: false)
|
{integrations} (table, default: all false)
|
||||||
|
Integration toggles. Each key accepts `true`,
|
||||||
|
`false`, or a table with sub-options. Passing
|
||||||
|
`true` or a table enables the integration;
|
||||||
|
`false` disables it. See |diffs-integrations|.
|
||||||
|
*diffs.IntegrationsConfig*
|
||||||
|
Fields: ~
|
||||||
|
|
||||||
|
{fugitive} (boolean|table, default: false)
|
||||||
Enable vim-fugitive integration. Pass `true`
|
Enable vim-fugitive integration. Pass `true`
|
||||||
for defaults, `false` to disable, or a table
|
for defaults, or a table with sub-options
|
||||||
with sub-options (see |diffs.FugitiveConfig|).
|
(see |diffs.FugitiveConfig|). When active,
|
||||||
Passing a table implicitly enables the
|
the `fugitive` filetype is registered and
|
||||||
integration — no `enabled` field needed.
|
status buffer keymaps are set. >lua
|
||||||
When active, the `fugitive` filetype is
|
|
||||||
registered and status buffer keymaps are set. >lua
|
|
||||||
vim.g.diffs = { fugitive = true }
|
|
||||||
vim.g.diffs = {
|
vim.g.diffs = {
|
||||||
fugitive = { horizontal = 'dd' },
|
integrations = { fugitive = true },
|
||||||
|
}
|
||||||
|
vim.g.diffs = {
|
||||||
|
integrations = {
|
||||||
|
fugitive = { horizontal = 'dd' },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
{neogit} (boolean|table, default: false)
|
{neogit} (boolean|table, default: false)
|
||||||
Enable Neogit integration. Pass `true` or
|
Enable Neogit integration. When active,
|
||||||
`{}` to enable, `false` to disable. When
|
`NeogitStatus`, `NeogitCommitView`, and
|
||||||
active, `NeogitStatus`, `NeogitCommitView`,
|
`NeogitDiffView` filetypes are registered.
|
||||||
and `NeogitDiffView` filetypes are registered
|
|
||||||
and Neogit highlight overrides are applied.
|
|
||||||
See |diffs-neogit|. >lua
|
See |diffs-neogit|. >lua
|
||||||
vim.g.diffs = { neogit = true }
|
integrations = { neogit = true }
|
||||||
<
|
<
|
||||||
|
|
||||||
{gitsigns} (boolean|table, default: false)
|
{gitsigns} (boolean|table, default: false)
|
||||||
Enable gitsigns.nvim blame popup highlighting.
|
Enable gitsigns.nvim blame popup highlighting.
|
||||||
Pass `true` or `{}` to enable, `false` to
|
|
||||||
disable. When active, `:Gitsigns blame_line`
|
|
||||||
popups receive treesitter syntax, line
|
|
||||||
backgrounds, and intra-line character diffs.
|
|
||||||
See |diffs-gitsigns|. >lua
|
See |diffs-gitsigns|. >lua
|
||||||
vim.g.diffs = { gitsigns = true }
|
integrations = { gitsigns = true }
|
||||||
<
|
<
|
||||||
|
|
||||||
{committia} (boolean|table, default: false)
|
{committia} (boolean|table, default: false)
|
||||||
Enable committia.vim integration. Pass `true`
|
Enable committia.vim integration. When active,
|
||||||
or `{}` to enable, `false` to disable. When
|
committia's diff pane receives treesitter
|
||||||
active, committia's diff pane (`ft=git`,
|
syntax and intra-line diffs. >lua
|
||||||
buffer name `__committia_diff__`) receives
|
integrations = { committia = true }
|
||||||
treesitter syntax, line backgrounds, and
|
|
||||||
intra-line diffs. >lua
|
|
||||||
vim.g.diffs = { committia = true }
|
|
||||||
<
|
<
|
||||||
|
|
||||||
{telescope} (boolean|table, default: false)
|
{telescope} (boolean|table, default: false)
|
||||||
Enable telescope.nvim preview highlighting.
|
Enable telescope.nvim preview highlighting.
|
||||||
Pass `true` or `{}` to enable, `false` to
|
See |diffs-telescope|. >lua
|
||||||
disable. When active, telescope preview
|
integrations = { telescope = true }
|
||||||
buffers showing diffs receive treesitter
|
|
||||||
syntax, line backgrounds, and intra-line
|
|
||||||
diffs. See |diffs-telescope|. >lua
|
|
||||||
vim.g.diffs = { telescope = true }
|
|
||||||
<
|
<
|
||||||
|
|
||||||
|
Legacy top-level keys (`vim.g.diffs.fugitive`,
|
||||||
|
etc.) still work but emit a deprecation
|
||||||
|
warning. If both `integrations` and top-level
|
||||||
|
keys are present, `integrations` wins and
|
||||||
|
the stale keys are ignored with a warning.
|
||||||
|
|
||||||
{extra_filetypes} (table, default: {})
|
{extra_filetypes} (table, default: {})
|
||||||
Additional filetypes to attach to, beyond the
|
Additional filetypes to attach to, beyond the
|
||||||
built-in `git`, `gitcommit`, and any enabled
|
built-in `git`, `gitcommit`, and any enabled
|
||||||
|
|
@ -488,9 +493,11 @@ Enable via config toggles. The plugin registers `FileType` autocmds for
|
||||||
each integration's filetypes and attaches automatically.
|
each integration's filetypes and attaches automatically.
|
||||||
>lua
|
>lua
|
||||||
vim.g.diffs = {
|
vim.g.diffs = {
|
||||||
fugitive = true,
|
integrations = {
|
||||||
neogit = true,
|
fugitive = true,
|
||||||
gitsigns = true,
|
neogit = true,
|
||||||
|
gitsigns = true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
|
|
@ -505,7 +512,7 @@ to attach to any buffer whose content looks like a diff.
|
||||||
FUGITIVE *diffs-fugitive*
|
FUGITIVE *diffs-fugitive*
|
||||||
|
|
||||||
Enable vim-fugitive (https://github.com/tpope/vim-fugitive) support: >lua
|
Enable vim-fugitive (https://github.com/tpope/vim-fugitive) support: >lua
|
||||||
vim.g.diffs = { fugitive = true }
|
vim.g.diffs = { integrations = { fugitive = true } }
|
||||||
<
|
<
|
||||||
|
|
||||||
|:Git| status and commit views receive treesitter syntax, line backgrounds,
|
|:Git| status and commit views receive treesitter syntax, line backgrounds,
|
||||||
|
|
@ -546,9 +553,11 @@ Configuration: ~
|
||||||
*diffs.FugitiveConfig*
|
*diffs.FugitiveConfig*
|
||||||
>lua
|
>lua
|
||||||
vim.g.diffs = {
|
vim.g.diffs = {
|
||||||
fugitive = {
|
integrations = {
|
||||||
horizontal = 'du', -- keymap for horizontal split, false to disable
|
fugitive = {
|
||||||
vertical = 'dU', -- keymap for vertical split, false to disable
|
horizontal = 'du', -- keymap for horizontal split, false to disable
|
||||||
|
vertical = 'dU', -- keymap for vertical split, false to disable
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
@ -568,7 +577,7 @@ Configuration: ~
|
||||||
NEOGIT *diffs-neogit*
|
NEOGIT *diffs-neogit*
|
||||||
|
|
||||||
Enable Neogit (https://github.com/NeogitOrg/neogit) support: >lua
|
Enable Neogit (https://github.com/NeogitOrg/neogit) support: >lua
|
||||||
vim.g.diffs = { neogit = true }
|
vim.g.diffs = { integrations = { neogit = true } }
|
||||||
<
|
<
|
||||||
|
|
||||||
Expanding a diff in a Neogit buffer (e.g., TAB on a file in the status
|
Expanding a diff in a Neogit buffer (e.g., TAB on a file in the status
|
||||||
|
|
@ -580,7 +589,7 @@ GITSIGNS *diffs-gitsigns*
|
||||||
|
|
||||||
Enable gitsigns.nvim (https://github.com/lewis6991/gitsigns.nvim) blame
|
Enable gitsigns.nvim (https://github.com/lewis6991/gitsigns.nvim) blame
|
||||||
popup highlighting: >lua
|
popup highlighting: >lua
|
||||||
vim.g.diffs = { gitsigns = true }
|
vim.g.diffs = { integrations = { gitsigns = true } }
|
||||||
<
|
<
|
||||||
|
|
||||||
`:Gitsigns blame_line full=true` popups receive treesitter syntax, line
|
`:Gitsigns blame_line full=true` popups receive treesitter syntax, line
|
||||||
|
|
@ -594,7 +603,7 @@ TELESCOPE *diffs-telescope*
|
||||||
|
|
||||||
Enable telescope.nvim (https://github.com/nvim-telescope/telescope.nvim)
|
Enable telescope.nvim (https://github.com/nvim-telescope/telescope.nvim)
|
||||||
preview highlighting: >lua
|
preview highlighting: >lua
|
||||||
vim.g.diffs = { telescope = true }
|
vim.g.diffs = { integrations = { telescope = true } }
|
||||||
<
|
<
|
||||||
|
|
||||||
Telescope does not set `filetype=diff` on preview buffers — it calls
|
Telescope does not set `filetype=diff` on preview buffers — it calls
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue