mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2024-11-01 08:31:13 +00:00
Merge pull request #1 from itslychee/plugin_improvements
Various improvements to the plugin
This commit is contained in:
commit
f50828ef06
1 changed files with 16 additions and 9 deletions
|
@ -34,15 +34,22 @@ M.setup = function(user_config)
|
|||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("DirenvAllow", function()
|
||||
M.allow_direnv()
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("DirenvDeny", function()
|
||||
M.deny_direnv()
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("DirenvCheck", function()
|
||||
M.check_direnv()
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("Direnv", function(opts)
|
||||
local cmds = {
|
||||
["allow"] = M.allow_direnv,
|
||||
["deny"] = M.deny_direnv,
|
||||
["reload"] = M.check_direnv,
|
||||
}
|
||||
local cmd = cmds[string.lower(opts.fargs[1])]
|
||||
if cmd then
|
||||
cmd()
|
||||
end
|
||||
end, {
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
return { "allow", "deny", "reload" }
|
||||
end,
|
||||
})
|
||||
|
||||
setup_keymaps({
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue