diff --git a/OPTIONS.md b/OPTIONS.md index 250ae69b..10382e5a 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -289,6 +289,18 @@ Type: `boolean`, Default: `false` Use fullscreen for the fzf-load floating window. +#### globals.winopts.title + +Type: `string`, Default: `nil` + +Controls title display in the fzf window, set by the calling picker. + +#### globals.winopts.title_pos + +Type: `string`, Default: `center` + +Controls title display in the fzf window, possible values are `left|right|center`. + #### globals.winopts.treesitter Type: `boolean`, Default: `false` diff --git a/README.md b/README.md index c8c08031..a755f85b 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,7 @@ winopts = { -- Backdrop opacity, 0 is fully opaque, 100 is fully transparent (i.e. disabled) backdrop = 60, -- title = "Title", - -- title_pos = "center", -- 'left', 'center' or 'right' + -- title_pos = "center", -- 'left', 'center' or 'right' fullscreen = false, -- start fullscreen? -- enable treesitter highlighting for the main fzf window will only have -- effect where grep like results are present, i.e. "file:line:col:text" diff --git a/doc/fzf-lua-opts.txt b/doc/fzf-lua-opts.txt index b931712b..63cbf2b3 100644 --- a/doc/fzf-lua-opts.txt +++ b/doc/fzf-lua-opts.txt @@ -1,4 +1,4 @@ -*fzf-lua-opts.txt* For Neovim >= 0.8.0 Last change: 2025 January 05 +*fzf-lua-opts.txt* For Neovim >= 0.8.0 Last change: 2025 January 06 ============================================================================== Table of Contents *fzf-lua-opts-table-of-contents* @@ -378,6 +378,23 @@ Use fullscreen for the fzf-load floating window. +globals.winopts.title *fzf-lua-opts-globals.winopts.title* + +Type: `string`, Default: `nil` + +Controls title display in the fzf window, set by the calling picker. + + + +globals.winopts.title_pos *fzf-lua-opts-globals.winopts.title_pos* + +Type: `string`, Default: `center` + +Controls title display in the fzf window, possible values are +`left|right|center`. + + + globals.winopts.treesitter *fzf-lua-opts-globals.winopts.treesitter* Type: `boolean`, Default: `false` diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index 2639de18..851b3620 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -52,6 +52,7 @@ M.defaults = { zindex = 50, backdrop = 60, fullscreen = false, + title_pos = "center", treesitter = { enabled = false, fzf_colors = { ["hl"] = "-1:reverse", ["hl+"] = "-1:reverse" } diff --git a/lua/fzf-lua/profiles/default-title.lua b/lua/fzf-lua/profiles/default-title.lua index 6419db97..49b3474b 100644 --- a/lua/fzf-lua/profiles/default-title.lua +++ b/lua/fzf-lua/profiles/default-title.lua @@ -4,13 +4,13 @@ local function title(str, opts) winopts = { -- title = { { " " .. str .. " ", "IncSearch" } }, title = " " .. str .. " ", - title_pos = "center", } }) end return { desc = "defaults using title instead of prompt", defaults = { prompt = false }, + winopts = { title_pos = "center" }, files = title("Files"), buffers = title("Buffers"), tabs = title("Tabs"), @@ -43,8 +43,7 @@ return { manpages = title("Man Pages"), lsp = { title_prefix = "LSP", - winopts = { title_pos = "center" }, - symbols = { title_prefix = "LSP", winopts = { title_pos = "center" } }, + symbols = { title_prefix = "LSP" }, finder = title("LSP Finder"), code_actions = title("Code Actions"), },