Skip to content

Commit

Permalink
fix(nvim): use .dev-mode as a marker for developing plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
water-sucks committed Jun 28, 2024
1 parent 5a3ee7a commit 0aad147
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions home/profiles/base/nvim/lua/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ _G.use = function(name, spec)
-- This works around the automatic dev plugin functionality, and falls
-- back properly to the Nix-generated version if it exists.
if spec.dev then
spec.dev = nil

local dev_plugin_dir = vim.env.HOME .. "/Code/NeovimPlugins/" .. plugin_name
if vim.fn.isdirectory(dev_plugin_dir) > 0 then
local dev_mode_marker = io.open(dev_plugin_dir .. "/.dev-mode")

if dev_mode_marker ~= nil then
dev_mode_marker:close()

spec.dir = dev_plugin_dir
spec.dev = nil
return spec
end
end
Expand Down

0 comments on commit 0aad147

Please sign in to comment.