From 138697980b68ce7d4f0661c752691ffe5dbb72b0 Mon Sep 17 00:00:00 2001 From: Nazeeh ElDirghami <32499832+Nazeehe@users.noreply.github.com> Date: Fri, 16 Jul 2021 08:20:25 -0700 Subject: feat: Add ability to have a user defined function to format the path display (#1000) --- lua/telescope/config.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lua/telescope/config.lua') diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua index e5a3ead..d7962c4 100644 --- a/lua/telescope/config.lua +++ b/lua/telescope/config.lua @@ -190,6 +190,15 @@ local telescope_defaults = { path_display can also be set to 'hidden' string to hide file names + path_display can also be set to a function for custom formatting of + the path display. Example: + + -- Format path as "file.txt (path\to\file\)" + path_display = function(opts, path) + local tail = require("telescope.utils").path_tail(path) + return string.format("%s (%s)", tail, path) + end, + Default: {}]] }, -- cgit v1.2.3