Skip to content

Latest commit

 

History

History
109 lines (86 loc) · 2.92 KB

lazygit.md

File metadata and controls

109 lines (86 loc) · 2.92 KB

🍿 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,
  -- extra configuration for lazygit that will be merged with the default
  -- snacks does NOT have a full yaml parser, so if you need `"test"` to appear with the quotes
  -- you need to double quote it: `"\"test\""`
  config = {
    os = { editPreset = "nvim-remote" },
    gui = { nerdFontsVersion = "3" },
  },
  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)