plugins.neogit.settings

Options provided to the require('neogit').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  commit_popup = {
    kind = "floating";
  };
  disable_builtin_notifications = true;
  disable_commit_confirmation = true;
  integrations = {
    diffview = false;
  };
  kind = "floating";
  mappings = {
    status = {
      a = "Stage";
      l = "Toggle";
    };
  };
  popup = {
    kind = "floating";
  };
  preview_buffer = {
    kind = "floating";
  };
  sections = {
    recent = {
      folded = true;
    };
    staged = {
      folded = false;
    };
    stashes = {
      folded = false;
    };
    unmerged = {
      folded = true;
    };
    unpulled = {
      folded = false;
    };
    unstaged = {
      folded = false;
    };
    untracked = {
      folded = false;
    };
  };
}

Declared by:

plugins.neogit.settings.auto_refresh

Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size. Disabling auto_refresh will make it so you have to manually refresh the status after you open it.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.neogit.settings.auto_show_console

Automatically show console if a command takes more than consoleTimeout milliseconds.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.neogit.settings.console_timeout

The time after which an output console is shown for slow running commands.

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Plugin default: 2000

Declared by:

plugins.neogit.settings.disable_context_highlighting

Disables changing the buffer highlights based on where the cursor is.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.neogit.settings.disable_hint

Hides the hints at the top of the status buffer.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.neogit.settings.disable_insert_on_commit

Changes what mode the Commit Editor starts in. true will leave nvim in normal mode, false will change nvim to insert mode, and "auto" will change nvim to insert mode IF the commit message is empty, otherwise leaving it in normal mode.

Type: null or boolean or value “auto” (singular enum)

Default: null

Plugin default: "auto"

Declared by:

plugins.neogit.settings.disable_line_numbers

Disable line numbers and relative line numbers.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.neogit.settings.disable_signs

Disables signs for sections/items/hunks.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.neogit.settings.fetch_after_checkout

Perform a fetch if the newly checked out branch has an upstream or pushRemote set.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.neogit.settings.git_services

Used to generate URL’s for branch popup action ‘pull request’.

Type: null or (attribute set of (string or raw lua code))

Default: null

Plugin default:

{
  "bitbucket.org" = "https://bitbucket.org/\${owner}/\${repository}/pull-requests/new?source=\${branch_name}&t=1";
  "github.com" = "https://github.com/\${owner}/\${repository}/compare/\${branch_name}?expand=1";
  "gitlab.com" = "https://gitlab.com/\${owner}/\${repository}/merge_requests/new?merge_request[source_branch]=\${branch_name}";
}

Declared by:

plugins.neogit.settings.graph_style

  • “ascii” is the graph the git CLI generates
  • “unicode” is the graph like https://github.com/rbong/vim-flog

Type: null or one of “ascii”, “unicode” or raw lua code

Default: null

Plugin default: "ascii"

Declared by:

plugins.neogit.settings.ignored_settings

Table of settings to never persist. Uses format “Filetype–cli-value”.

Type: null or (list of (string or raw lua code))

Default: null

Plugin default:

[
  "NeogitPushPopup--force-with-lease"
  "NeogitPushPopup--force"
  "NeogitPullPopup--rebase"
  "NeogitCommitPopup--allow-empty"
  "NeogitRevertPopup--no-edit"
]

Declared by:

plugins.neogit.settings.kind

Change the default way of opening neogit.

Type: null or one of “split”, “vsplit”, “split_above”, “tab”, “floating”, “replace”, “auto” or raw lua code

Default: null

Plugin default: "tab"

Declared by:

plugins.neogit.settings.notification_icon

Icon for notifications.

Type: null or string or raw lua code

Default: null

Plugin default: "󰊢"

Declared by:

plugins.neogit.settings.remember_settings

Persist the values of switches/options within and across sessions.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.neogit.settings.sort_branches

Value used for --sort option for git branch command. By default, branches will be sorted by commit date descending. Flag description: https://git-scm.com/docs/git-branch#Documentation/git-branch.txt—sortltkeygt Sorting keys: https://git-scm.com/docs/git-for-each-ref#_options

Type: null or string or raw lua code

Default: null

Plugin default: "-committerdate"

Declared by:

plugins.neogit.settings.telescope_sorter

Allows a different telescope sorter. Defaults to ‘fuzzy_with_index_bias’. The example below will use the native fzf sorter instead. By default, this function returns nil.

Example:

  require("telescope").extensions.fzf.native_fzf_sorter

Type: null or lua code string

Default: null

Declared by:

plugins.neogit.settings.use_default_keymaps

Set to false if you want to be responsible for creating ALL keymappings.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.neogit.settings.use_per_project_settings

Scope persisted settings on a per-project basis.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by: