Merge pull request #1 from itslychee/plugin_improvements

Various improvements to the plugin
This commit is contained in:
raf 2024-07-04 14:20:24 +00:00 committed by GitHub
commit f50828ef06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,15 +34,22 @@ M.setup = function(user_config)
return return
end end
vim.api.nvim_create_user_command("DirenvAllow", function() vim.api.nvim_create_user_command("Direnv", function(opts)
M.allow_direnv() local cmds = {
end, {}) ["allow"] = M.allow_direnv,
vim.api.nvim_create_user_command("DirenvDeny", function() ["deny"] = M.deny_direnv,
M.deny_direnv() ["reload"] = M.check_direnv,
end, {}) }
vim.api.nvim_create_user_command("DirenvCheck", function() local cmd = cmds[string.lower(opts.fargs[1])]
M.check_direnv() if cmd then
end, {}) cmd()
end
end, {
nargs = 1,
complete = function()
return { "allow", "deny", "reload" }
end,
})
setup_keymaps({ setup_keymaps({
{ {