Skip to content

Commit

Permalink
feat(nvim): make plug.nvim optional
Browse files Browse the repository at this point in the history
to allow a development of plug.nvim
  • Loading branch information
spywhere committed Sep 29, 2023
1 parent 8791887 commit f9fdd40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/nvim/lua/lib/const.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config_home = fn.stdpath('config')
pack_site = fn.stdpath('data') .. '/site/pack'

lua_home = config_home .. '/lua'
plug_nvim_path = pack_site .. '/plug/start/plug.nvim/lua/plug.lua'
plug_nvim_path = pack_site .. '/plug/opt/plug.nvim/lua/plug.lua'
plugin_home = config_home .. '/plugged'

prequire = function (...)
Expand Down
6 changes: 5 additions & 1 deletion configs/nvim/lua/lib/plugin-manager.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
local M = {}

M.is_installed = function ()
return fn.filereadable(vim.fn.expand(plug_nvim_path)) ~= 0
local is_installed = fn.filereadable(vim.fn.expand(plug_nvim_path)) ~= 0
if is_installed then
vim.cmd('packadd! plug.nvim')
end
return is_installed
end

M.install = function ()
Expand Down

0 comments on commit f9fdd40

Please sign in to comment.