From 68a4e8a979b4835b303bd6efe8aa291cfe56a26b Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 18 Dec 2020 11:44:16 +0100 Subject: [PATCH] Add mappings for --- .vim/plugin/keymap.vim | 21 +++++++++++++++++++++ .vim/plugin/menu.vim | 5 +++++ .vimrc | 3 +++ 3 files changed, 29 insertions(+) diff --git a/.vim/plugin/keymap.vim b/.vim/plugin/keymap.vim index 0d993c2..4ab46b2 100644 --- a/.vim/plugin/keymap.vim +++ b/.vim/plugin/keymap.vim @@ -14,3 +14,24 @@ endif " map :some vimcmds " you can check the result with :map + +" MapFastKeycode: helper for fast keycode mappings +" makes use of unused vim keycodes <[S-]F15> to <[S-]F37> +function! MapFastKeycode(key, keycode) + if s:fast_i == 46 + echohl WarningMsg + echomsg "Unable to map ".a:key.": out of spare keycodes" + echohl None + return + endif + let vkeycode = '<'.(s:fast_i/23==0 ? '' : 'S-').'F'.(15+s:fast_i%23).'>' + exec 'set '.vkeycode.'='.a:keycode + exec 'map '.vkeycode.' '.a:key + let s:fast_i += 1 +endfunction +let s:fast_i = 0 + +call MapFastKeycode('', "") +call MapFastKeycode('', "") +call MapFastKeycode('', "") +call MapFastKeycode('', "") diff --git a/.vim/plugin/menu.vim b/.vim/plugin/menu.vim index 4924663..0304d4f 100644 --- a/.vim/plugin/menu.vim +++ b/.vim/plugin/menu.vim @@ -27,6 +27,11 @@ function! PopulateMenu() exe "amenu PopUp.Create\\ global\\ code\\ reference\\ for\\ path :call AutotagsAdd()" exe "amenu PopUp.-Sep3- :" exe "amenu PopUp.Toggle\\ show\\ function :TlistToggle" + exe "amenu PopUp.-Sep3- :" + exe "amenu PopUp.Menu (lcn-menu)" + exe "amenu PopUp.hover (lcn-hover)" + exe "amenu PopUp.definition (lcn-definition)" + exe "amenu PopUp.rename (lcn-rename)" endfunc diff --git a/.vimrc b/.vimrc index 7f2b573..2b04cbe 100644 --- a/.vimrc +++ b/.vimrc @@ -31,6 +31,8 @@ " snippets) " look at :help index " or +" :verbose map +" or for all keys ":redir! > vim_maps.txt ":map " Normal, visual, select and operator bindings ":map! "insert and command-line mode bindings @@ -607,6 +609,7 @@ if v:version >= 800 nmap K (lcn-hover) nmap gd (lcn-definition) nmap cr (lcn-rename) + map (lcn-menu) endif endfunction autocmd FileType * call LC_maps()