mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2025-02-21 06:57:35 +00:00
feat: configurable auto attach (#918)
* feat: configurable auto attach * fixup! feat: configurable auto attach
This commit is contained in:
parent
d195f0c35c
commit
3e6e91b09f
@ -73,6 +73,7 @@ require('gitsigns').setup {
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
|
@ -49,6 +49,7 @@ of the default settings:
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
@ -713,6 +714,11 @@ preview_config *gitsigns-config-preview_config*
|
||||
Option overrides for the Gitsigns preview window. Table is passed directly
|
||||
to `nvim_open_win`.
|
||||
|
||||
auto_attach *gitsigns-config-auto_attach*
|
||||
Type: `boolean`, Default: `true`
|
||||
|
||||
Automatically attach to files.
|
||||
|
||||
attach_to_untracked *gitsigns-config-attach_to_untracked*
|
||||
Type: `boolean`, Default: `true`
|
||||
|
||||
|
@ -183,7 +183,10 @@ M.setup = async.void(function(cfg)
|
||||
require('gitsigns.git')._set_version(config._git_version)
|
||||
end
|
||||
|
||||
setup_attach()
|
||||
|
||||
if config.auto_attach then
|
||||
setup_attach()
|
||||
end
|
||||
setup_cwd_head()
|
||||
|
||||
M._setup_done = true
|
||||
|
@ -70,6 +70,7 @@
|
||||
--- @field current_line_blame_formatter_nc string|Gitsigns.CurrentLineBlameFmtFun
|
||||
--- @field current_line_blame_opts Gitsigns.CurrentLineBlameOpts
|
||||
--- @field preview_config table<string,any>
|
||||
--- @field auto_attach boolean
|
||||
--- @field attach_to_untracked boolean
|
||||
--- @field yadm { enable: boolean }
|
||||
--- @field worktrees {toplevel: string, gitdir: string}[]
|
||||
@ -562,6 +563,14 @@ M.schema = {
|
||||
]],
|
||||
},
|
||||
|
||||
auto_attach = {
|
||||
type = 'boolean',
|
||||
default = true,
|
||||
description = [[
|
||||
Automatically attach to files.
|
||||
]],
|
||||
},
|
||||
|
||||
attach_to_untracked = {
|
||||
type = 'boolean',
|
||||
default = true,
|
||||
|
Loading…
Reference in New Issue
Block a user