How to show full file path in preview title #2091
Answered
by
drowning-cat
rbhanot4739
asked this question in
Q&A
-
I want the preview title to show the full file path instead of just the file name. Is there a way I can do that ? |
Beta Was this translation helpful? Give feedback.
Answered by
drowning-cat
Jul 30, 2025
Replies: 3 comments 5 replies
-
Give me a screenshot of where you want to see the preview title. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Variant 1picker = {
sources = {
files = {
on_change = function(picker, item)
vim.schedule(function()
picker.preview.win:set_title(item.file)
-- WARN: `picker.preview:set_title(item.file)` doesn't work
end)
end, picker = {
sources = {
files = {
on_change = function(picker, item)
vim.schedule(function()
picker.preview.title = item.file
picker:update_titles()
end)
end, Variant 2For
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rbhanot4739
-
I am trying to do a similar thing with a terminal window. local term = require'snacks.terminal'
term.open("ls", {win = {on_win = function(win) vim.schedule(function() win:set_title("list files") end) end}}) but this isn't working... Do you know what is wrong? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Variant 1
Variant 2
For
file
preview