nvim-telescope / telescope-frecency.nvim

A telescope.nvim extension that offers intelligent prioritization when selecting files from your editing history.
MIT License
777 stars 37 forks source link

specify home directory for workspaces #21

Closed marconetto closed 3 years ago

marconetto commented 3 years ago

According to the documentation, to add the workspaces in the configuration it seems I need to put the full path. The issue is that /home/my_username/... may change depending on the machine I am. I tried $HOME and ~/ (e.g. $HOME or ~/.config) to specify the entries but neither seems to detect the workspace. Is there a way to specify "home directory" without adding the full path?

workspaces = { ["conf"] = "/home/my_username/.config", ["data"] = "/home/my_username/.local/share", ["project"] = "/home/my_username/projects", ["wiki"] = "/home/my_username/wiki" }

BTW: great extension!

Conni2461 commented 3 years ago

Someone would need to expand it. Either @sunjon or you.

So something like this should work for your config:

workspaces = {
  ["conf"] = vim.fn.expand("~/.config"),
  ["data"] = vim.fn.expand("~/.local/share"),
  ["project"] = vim.fn.expand("~/projects"),
  ["wiki"] = vim.fn.expand("~/wiki")
}
sunjon commented 3 years ago

I think doing via by user config is fine, as suggested by @Conni2461. I' m going to look again at the whole workspace concept soon, if it changes, I'll include support for expanding paths.