liuchengxu/vim-which-key

Allow "let" mapping

gianfrappe opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
I would really like vim-which-key to allow mapping of "let" along with "set".
For example the following "set" mappings works

let g:which_key_map['c'] = {
      \ 'name' : '+configuration',
      \ 't' : [':set expandtab!'                , 'expand tab'],
      \ 's' : {
        \ 'name' : '+spell',
        \ 'e' : [':set spell spelllang=en', 'en'],
        \ 'n' : [':set spell spelllang=', 'none'],
        \ },
      \ }

But the following "let" mappings don't (even though they work if just used in command line mode)

let g:which_key_map['t'] = {
      \ 'name' : '+tools' ,
      \ 'y' : [':let @+=expand("%:p")', 'yank file name'],
      \ 'Y' : [':let @+=expand("%")', 'yank file path']
      \ }

Describe the solution you'd like
Make vim-which-key allow for "let" mappings

Describe alternatives you've considered
None

Additional context
None

Try to wrap it using a function or command, ref #126.