Add more ideavim mappings

main
Ensar Sarajčić 2022-05-12 12:57:38 +02:00
parent c6ff26368d
commit 9df988ef28
3 changed files with 26 additions and 13 deletions

View File

@ -39,16 +39,3 @@ vim.cmd("set path+=**")
-- automatically rebalance windows on vim resize
vim.cmd("autocmd VimResized * :wincmd =")
vim.api.nvim_create_user_command("EditVimConfig", function()
vim.cmd("edit $VIMHOME/init.lua")
end, {})
vim.api.nvim_create_user_command("EditVimPlugins", function()
vim.cmd("edit $VIMPLUGINS")
end, {})
vim.api.nvim_create_user_command("ReloadVimConfig", function()
require("plenary.reload").reload_module("esensar", true)
vim.cmd("source $MYVIMRC")
end, {})

View File

@ -0,0 +1,20 @@
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
vim.api.nvim_create_user_command("EditVimConfig", edit_vim_config, {})
vim.api.nvim_create_user_command("EditVimPlugins", edit_vim_plugins, {})
vim.api.nvim_create_user_command("ReloadVimConfig", reload_vim_config, {})
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)

View File

@ -33,6 +33,7 @@ nmap <leader>dc <Action>(ChooseDebugConfiguration)
nmap <leader>ac <Action>(ShowIntentionActions)
nmap <leader>tb <Action>(Annotate)
nmap - :Ex<CR>
command! Start action Run
if &ide =~? 'rider'
@ -55,3 +56,8 @@ command! Sync action Android.SyncProject
command! Format action ReformatCode
command! EditVimConfig e ~/.ideavimrc
command! ReloadVimConfig action IdeaVim.ReloadVimRc.reload
command! Warnings action ActivateProblemsViewToolWindow
nmap <leader>vec :EditVimConfig<CR>
nmap <leader>vep :EditVimConfig<CR>
nmap <leader>vrc :ReloadVimConfig<CR>