[nvim] made winbar use $HOME

This commit is contained in:
Afonso Franco 2024-06-08 18:05:38 +01:00
parent f56d6c5a37
commit 8bda12555b
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54

View file

@ -21,11 +21,11 @@ function M.render()
-- sure to pick the longest prefix). -- sure to pick the longest prefix).
---@type table<string, string> ---@type table<string, string>
local special_dirs = { local special_dirs = {
DOTFILES = "/Users/afonso/.config", DOTFILES = "$HOME/.config",
HOME = vim.env.HOME, HOME = vim.env.HOME,
PROJECTS = "/Users/afonso/projects", PROJECTS = "$HOME/projects",
["University"] = "/Users/afonso/projects/University", ["University"] = "$HOME/projects/University",
["Personal"] = "/Users/afonso/projects/Personal", ["Personal"] = "$HOME/projects/Personal",
} }
for dir_name, dir_path in pairs(special_dirs) do for dir_name, dir_path in pairs(special_dirs) do
if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then