Split out plugin loading into individual modules
This commit is contained in:
parent
faf4739711
commit
763130d6b2
12 changed files with 343 additions and 418 deletions
19
.config/nvim/plugin/showmappings.vim
Normal file
19
.config/nvim/plugin/showmappings.vim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
" Show all mapped keys in a list - from https://stackoverflow.com/questions/13990136/display-a-ordered-vim-keyboard-mapping
|
||||
function! s:ShowMaps()
|
||||
let old_reg = getreg("a") " save the current content of register a
|
||||
let old_reg_type = getregtype("a") " save the type of the register as well
|
||||
try
|
||||
redir @a " redirect output to register a
|
||||
" Get the list of all key mappings silently, satisfy "Press ENTER to continue"
|
||||
silent map | call feedkeys("\<CR>")
|
||||
redir END " end output redirection
|
||||
vnew " new buffer in vertical window
|
||||
put a " put content of register
|
||||
" Sort on 4th character column which is the key(s)
|
||||
%!sort -k1.4,1.4
|
||||
finally " Execute even if exception is raised
|
||||
call setreg("a", old_reg, old_reg_type) " restore register a
|
||||
endtry
|
||||
endfunction
|
||||
" use :ShowMaps to call the function
|
||||
command! ShowMappings call s:ShowMaps() " Enable :ShowMaps to call the function
|
||||
Loading…
Add table
Add a link
Reference in a new issue