diff --git a/config/nvim/after/ftplugin/zsh.lua b/config/nvim/after/ftplugin/zsh.lua new file mode 100644 index 0000000..3c265c3 --- /dev/null +++ b/config/nvim/after/ftplugin/zsh.lua @@ -0,0 +1,15 @@ +-- Eryn Wells + +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 diff --git a/config/nvim/ftdetect/zsh.lua b/config/nvim/ftdetect/zsh.lua new file mode 100644 index 0000000..1e748af --- /dev/null +++ b/config/nvim/ftdetect/zsh.lua @@ -0,0 +1,6 @@ +-- Eryn Wells + +vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, { + pattern = {"*/zsh/*"}, + command = "setfiletype zsh", +}) diff --git a/zshenv b/zshenv index 998665f..1b45e80 100644 --- a/zshenv +++ b/zshenv @@ -13,6 +13,7 @@ init_env_fpath() { fi fpath=($user_fpath $fpath) + export FPATH } init_env_fpath