1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Let users to define custom icons and color for files on the config file

Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
This commit is contained in:
hasecilu
2025-03-14 13:58:16 -06:00
committed by Stefan Haller
parent 1eb00d8d14
commit 8ec37f80b7
8 changed files with 105 additions and 9 deletions

View File

@ -57,6 +57,9 @@ type GuiConfig struct {
BranchColors map[string]string `yaml:"branchColors" jsonschema:"deprecated"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
BranchColorPatterns map[string]string `yaml:"branchColorPatterns"`
// Custom icons for filenames and file extensions
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-files-icon--color
CustomIcons CustomIconsConfig `yaml:"customIcons"`
// The number of lines you scroll by when scrolling the main window
ScrollHeight int `yaml:"scrollHeight" jsonschema:"minimum=1"`
// If true, allow scrolling past the bottom of the content in the main window
@ -707,6 +710,18 @@ type CustomCommandMenuOption struct {
Value string `yaml:"value" jsonschema:"example=feature,minLength=1"`
}
type CustomIconsConfig struct {
// Map of filenames to icon properties (icon and color)
Filenames map[string]IconProperties `yaml:"filenames"`
// Map of file extensions (including the dot) to icon properties (icon and color)
Extensions map[string]IconProperties `yaml:"extensions"`
}
type IconProperties struct {
Icon string `yaml:"icon"`
Color string `yaml:"color"`
}
func GetDefaultConfig() *UserConfig {
return &UserConfig{
Gui: GuiConfig{