mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-30 04:24:35 +02:00
feat: fzf_colors based on Neovim colorscheme
This commit is contained in:
parent
60d472a569
commit
4947802191
1 changed files with 58 additions and 17 deletions
|
@ -9,7 +9,6 @@ LazyVim.pick.commands = {
|
||||||
---@param opts? FzfLuaOpts
|
---@param opts? FzfLuaOpts
|
||||||
LazyVim.pick._open = function(command, opts)
|
LazyVim.pick._open = function(command, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
|
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
|
||||||
opts.cmd = "git ls-files --exclude-standard --cached --others"
|
opts.cmd = "git ls-files --exclude-standard --cached --others"
|
||||||
end
|
end
|
||||||
|
@ -35,22 +34,7 @@ return {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[1] = "default-title",
|
[1] = "default-title",
|
||||||
fzf_colors = {
|
fzf_colors = true,
|
||||||
["fg"] = { "fg", "FzfLuaNormal" },
|
|
||||||
["bg"] = { "bg", "FzfLuaNormal" },
|
|
||||||
["hl"] = { "fg", "Special" },
|
|
||||||
["fg+"] = { "fg", "Visual" },
|
|
||||||
["bg+"] = { "bg", "Visual" },
|
|
||||||
["hl+"] = { "fg", "Special" },
|
|
||||||
["info"] = { "fg", "NonText" },
|
|
||||||
["border"] = { "fg", "FzfLuaBorder" },
|
|
||||||
["gutter"] = { "bg", "FzfLuaNormal" },
|
|
||||||
["query"] = { "fg", "FzfLuaNormal" },
|
|
||||||
["prompt"] = { "fg", "FzfLuaNormal" },
|
|
||||||
["pointer"] = { "fg", "FzfLuaMarker" },
|
|
||||||
["marker"] = { "fg", "FzfLuaMarker" },
|
|
||||||
["header"] = { "fg", "FzfLuaNormal" },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
|
@ -120,6 +104,63 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- remove when https://github.com/ibhagwan/fzf-lua/pull/1244 gets merged
|
||||||
|
{
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local config = require("fzf-lua.config")
|
||||||
|
if opts.fzf_colors ~= true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- My PR that supports native colors
|
||||||
|
if config.defaults.fzf_colorscheme ~= nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fallback to setting colors manually
|
||||||
|
local links = {
|
||||||
|
Normal = "FzfLuaNormal",
|
||||||
|
CursorLine = "FzfLuaCursorLine",
|
||||||
|
Match = "Special",
|
||||||
|
Info = "NonText",
|
||||||
|
Border = "FzfLuaBorder",
|
||||||
|
Gutter = "FzfLuaNormal",
|
||||||
|
Query = "FzfLuaNormal",
|
||||||
|
Prompt = "Special",
|
||||||
|
Pointer = "Special",
|
||||||
|
Marker = "FzfColorsPointer",
|
||||||
|
Spinner = "FzfColorsPointer",
|
||||||
|
Header = "FzfLuaTitle",
|
||||||
|
Scrollbar = "FzfColorsBorder",
|
||||||
|
Separator = "FzfColorsBorder",
|
||||||
|
}
|
||||||
|
for name, link in pairs(links) do
|
||||||
|
name = "FzfColors" .. name
|
||||||
|
vim.api.nvim_set_hl(0, name, { link = link, default = true })
|
||||||
|
end
|
||||||
|
opts.fzf_colors = {
|
||||||
|
["fg"] = { "fg", "FzfColorsNormal" },
|
||||||
|
["bg"] = { "bg", "FzfColorsNormal" },
|
||||||
|
["hl"] = { "fg", "FzfColorsMatch" },
|
||||||
|
["fg+"] = { "fg", "FzfColorsCursorLine" },
|
||||||
|
["bg+"] = { "bg", "FzfColorsCursorLine" },
|
||||||
|
["hl+"] = { "fg", "FzfColorsMatch" },
|
||||||
|
["info"] = { "fg", "FzfColorsInfo" },
|
||||||
|
["border"] = { "fg", "FzfColorsBorder" },
|
||||||
|
["separator"] = { "fg", "FzfColorsSeparator" },
|
||||||
|
["scrollbar"] = { "fg", "FzfColorsScrollbar" },
|
||||||
|
["gutter"] = { "bg", "FzfColorsGutter" },
|
||||||
|
["query"] = { "fg", "FzfColorsQuery", "regular" },
|
||||||
|
["prompt"] = { "fg", "FzfColorsPrompt" },
|
||||||
|
["pointer"] = { "fg", "FzfColorsPointer" },
|
||||||
|
["marker"] = { "fg", "FzfColorsMarker" },
|
||||||
|
["spinner"] = { "fg", "FzfColorsSpinner" },
|
||||||
|
["header"] = { "fg", "FzfColorsHeader" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = function()
|
opts = function()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue