[zsh,nvim] Set up vim's &path based on zsh's FPATH

This commit is contained in:
Eryn Wells 2023-03-29 12:52:01 -07:00
parent 711dd78a2f
commit d1e8f59c53
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,15 @@
-- Eryn Wells <eryn@erynwells.me>
local zshFPath = vim.env.FPATH
if zshFPath then
local paths = vim.split(zshFPath, ":")
vim.bo.path = ".," .. table.concat(paths, ",") .. ",,"
else
local defaultFPath = {
"~/.dotfiles/zsh/func/**",
"~/.zsh/func/**",
"/usr/local/share/zsh/site-functions",
"/usr/share/zsh/site-functions"
}
vim.bo.path = ".," .. table.concat(defaultFPath) .. ",,"
end