From 9df988ef284ff261a76c8de26904af91fb2713c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 12 May 2022 12:57:38 +0200 Subject: [PATCH] Add more ideavim mappings --- symlinks/config/nvim/init.lua | 13 ------------ symlinks/config/nvim/plugin/vimconf_utils.lua | 20 +++++++++++++++++++ symlinks/ideavimrc | 6 ++++++ 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 symlinks/config/nvim/plugin/vimconf_utils.lua diff --git a/symlinks/config/nvim/init.lua b/symlinks/config/nvim/init.lua index 4777eb0..a4d72b0 100644 --- a/symlinks/config/nvim/init.lua +++ b/symlinks/config/nvim/init.lua @@ -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, {}) diff --git a/symlinks/config/nvim/plugin/vimconf_utils.lua b/symlinks/config/nvim/plugin/vimconf_utils.lua new file mode 100644 index 0000000..7609d60 --- /dev/null +++ b/symlinks/config/nvim/plugin/vimconf_utils.lua @@ -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", "vec", edit_vim_config) +vim.keymap.set("n", "vep", edit_vim_plugins) +vim.keymap.set("n", "vcr", reload_vim_config) diff --git a/symlinks/ideavimrc b/symlinks/ideavimrc index 5daf8e9..795c0a5 100644 --- a/symlinks/ideavimrc +++ b/symlinks/ideavimrc @@ -33,6 +33,7 @@ nmap dc (ChooseDebugConfiguration) nmap ac (ShowIntentionActions) nmap tb (Annotate) +nmap - :Ex 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 vec :EditVimConfig +nmap vep :EditVimConfig +nmap vrc :ReloadVimConfig