snacks.nvim/docs/lazygit.md
Teppei Taguchi 59ae7cf162
docs(readme, lazygit): fix typos (#16)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
Fixes minor typos in documentation.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2024-11-07 13:50:13 +01:00

2.6 KiB

🍿 lazygit

Automatically configures lazygit with a theme generated based on your Neovim colorscheme and integrate edit with the current neovim instance.

image

⚙️ Config

---@class snacks.lazygit.Config: snacks.terminal.Opts
---@field args? string[]
---@field theme? snacks.lazygit.Theme
{
  -- automatically configure lazygit to use the current colorscheme
  -- and integrate edit with the current neovim instance
  configure = true,
  theme_path = vim.fs.normalize(vim.fn.stdpath("cache") .. "/lazygit-theme.yml"),
  -- Theme for lazygit
  theme = {
    [241]                      = { fg = "Special" },
    activeBorderColor          = { fg = "MatchParen", bold = true },
    cherryPickedCommitBgColor  = { fg = "Identifier" },
    cherryPickedCommitFgColor  = { fg = "Function" },
    defaultFgColor             = { fg = "Normal" },
    inactiveBorderColor        = { fg = "FloatBorder" },
    optionsTextColor           = { fg = "Function" },
    searchingActiveBorderColor = { fg = "MatchParen", bold = true },
    selectedLineBgColor        = { bg = "Visual" }, -- set to `default` to have no background colour
    unstagedChangesColor       = { fg = "DiagnosticError" },
  },
  win = {
    style = "lazygit",
  },
}

🎨 Styles

lazygit

{}

📚 Types

---@alias snacks.lazygit.Color {fg?:string, bg?:string, bold?:boolean}
---@class snacks.lazygit.Theme: table<number, snacks.lazygit.Color>
---@field activeBorderColor snacks.lazygit.Color
---@field cherryPickedCommitBgColor snacks.lazygit.Color
---@field cherryPickedCommitFgColor snacks.lazygit.Color
---@field defaultFgColor snacks.lazygit.Color
---@field inactiveBorderColor snacks.lazygit.Color
---@field optionsTextColor snacks.lazygit.Color
---@field searchingActiveBorderColor snacks.lazygit.Color
---@field selectedLineBgColor snacks.lazygit.Color
---@field unstagedChangesColor snacks.lazygit.Color

📦 Module

Snacks.lazygit()

---@type fun(opts?: snacks.lazygit.Config): snacks.win
Snacks.lazygit()

Snacks.lazygit.log()

Opens lazygit with the log view

---@param opts? snacks.lazygit.Config
Snacks.lazygit.log(opts)

Snacks.lazygit.log_file()

Opens lazygit with the log of the current file

---@param opts? snacks.lazygit.Config
Snacks.lazygit.log_file(opts)

Snacks.lazygit.open()

Opens lazygit, properly configured to use the current colorscheme and integrate with the current neovim instance

---@param opts? snacks.lazygit.Config
Snacks.lazygit.open(opts)