mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2024-11-23 00:30:42 +00:00
add user commands for calling Direnv manually
This commit is contained in:
parent
91558d1edc
commit
8567799d76
1 changed files with 11 additions and 1 deletions
|
@ -14,7 +14,7 @@ local function setup_keymaps(keymaps, mode, opts)
|
|||
for _, map in ipairs(keymaps) do
|
||||
local options =
|
||||
vim.tbl_extend("force", { noremap = true, silent = true }, opts or {})
|
||||
vkms(mode, map[1], map[2], options)
|
||||
vim.api.nvim_set_keymap(mode, map[1], map[2], options)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -33,6 +33,16 @@ 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, {})
|
||||
|
||||
setup_keymaps({
|
||||
{
|
||||
config.keybindings.allow,
|
||||
|
|
Loading…
Reference in a new issue