2022-05-12 19:12:01 +00:00
|
|
|
-- Vim configuration utility commands
|
|
|
|
|
2022-05-12 10:57:38 +00:00
|
|
|
local function edit_vim_config()
|
|
|
|
vim.cmd("edit $VIMHOME/init.lua")
|
|
|
|
end
|
|
|
|
|
|
|
|
local function edit_vim_plugins()
|
|
|
|
vim.cmd("edit $VIMPLUGINS")
|
|
|
|
end
|
|
|
|
|
|
|
|
local function reload_vim_config()
|
|
|
|
require("plenary.reload").reload_module("esensar", true)
|
|
|
|
vim.cmd("source $MYVIMRC")
|
|
|
|
end
|
|
|
|
|
2022-05-12 19:12:01 +00:00
|
|
|
vim.api.nvim_create_user_command(
|
|
|
|
"EditVimConfig",
|
|
|
|
edit_vim_config,
|
|
|
|
{ desc = "Edit vim configuration ($MYVIMRC - init.lua)" }
|
|
|
|
)
|
|
|
|
vim.api.nvim_create_user_command("EditVimPlugins", edit_vim_plugins, { desc = "Edit plugin list file" })
|
|
|
|
vim.api.nvim_create_user_command("ReloadVimConfig", reload_vim_config, { desc = "Reload init.lua and all lua files" })
|
2022-05-12 10:57:38 +00:00
|
|
|
|
|
|
|
vim.keymap.set("n", "<Leader>vec", edit_vim_config)
|
|
|
|
vim.keymap.set("n", "<Leader>vep", edit_vim_plugins)
|
|
|
|
vim.keymap.set("n", "<Leader>vcr", reload_vim_config)
|