harpoon icon indicating copy to clipboard operation
harpoon copied to clipboard

Telescope preview with long file path

Open nkien0204 opened this issue 1 year ago • 2 comments

When I use Harpoon as extension of Telescope to open a file with really long path, it just display from the beginning, and I can not see the file name. The problem is if I have 2 different files but same directory, Telescope will show exactly the same and I think it quite inconvenience!

image

I think this will better if it perform like the other Telescope preview windows, always show the file name. Like this:

image

nkien0204 avatar Dec 11 '23 13:12 nkien0204

The #512 PR would allow you to use the path_display = { "truncate" }-config for telescope. If it's already set - inside your telescope defaults - it should just work!

require("telescope").extensions.harpoon.marks({
    path_display = { "truncate" },
})

or

require("telescope").extensions.harpoon.marks(
    require("telescope.themes").get_dropdown({
        path_display = { "truncate" },
    })
)

or

-- when setting up telescope:
require("telescope").setup({
    defaults = {
        path_display = { "truncate" },
    },
})

-- when using a keymap:
require("telescope").extensions.harpoon.marks()

...

kimabrandt-flx avatar Feb 04 '24 20:02 kimabrandt-flx

@ThePrimeagen can we please merge this awesome feature.. long path names makes the actual filenames non-visible

idelice avatar Feb 21 '24 10:02 idelice