shorten paths relative to user homedir

This commit is contained in:
Senghan Bright 2021-01-19 05:15:40 +01:00
parent bbb81a6a58
commit 304a6bf887

View File

@ -14,7 +14,6 @@ local pickers = require "telescope.pickers"
local sorters = require "telescope.sorters"
local utils = require('telescope.utils')
-- local os_path_sep = vim.loop.os_uname().sysname == "Windows" and "\\" or "/"
local os_path_sep = utils.get_separator()
local show_scores = false
@ -56,6 +55,9 @@ local frecency = function(opts)
filename = path.make_relative(filename, cwd)
local homedir = vim.loop.os_homedir()
filename = "~/" .. path.make_relative(filename, homedir)
display_items = show_scores and {{entry.score, "Directory"}} or {}
table.insert(display_items, {filename, hl_filename})