Comments (16)
vim-which-key takes mappings from :map
, what do :map <leader>lb
and other :map <leader>l
say?
from vim-which-key.
:map l output screenshot below
Hitting SPACE (my leader) invokes which-key, screenshot:
from vim-which-key.
Looks like if more than one chars are in the leader
mapping, only one of them shows up. Here's the full output of :map <leader>
. Note how I have many <leader>h
bindings, but only two show up.
from vim-which-key.
Have you updated vim-which-key to the latest version? If so, please provide a minimal vimrc to help reproduce. It works for me.
from vim-which-key.
from vim-which-key.
Updated to d326c18 on master, still have this issue. Do you have your minimal .vimrc to check against? Can you share?
from vim-which-key.
Also, I don't fully understand +prefix
usage. I have nmap <leader>l :set list!<CR>
, and if I remove it from my .vimrc
, I see l -> +prefix
in which-key
window, selecting it shows all leader bindings of l
.
from vim-which-key.
Quick example:
set nocompatible
call plug#begin()
Plug 'liuchengxu/vim-which-key'
call plug#end()
let g:mapleader="\<Space>"
nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
nnoremap <Leader>1 :echom "THis is one"<cr>
let g:which_key_map = {}
let g:which_key_map.1 = ['echom "This is one"', "One"]
call which_key#register('<Space>', "g:which_key_map")
+prefix
is the default group name, see https://github.com/liuchengxu/vim-which-key/blob/master/plugin/which_key.vim#L21, that means you have a number of mappings leading by <Leader>l*
. However, if you have a mapping <Leader>l
, then vim-which-key will display it rhs instead.
from vim-which-key.
from vim-which-key.
rhs means right-hand-side, see :h rhs
.
from vim-which-key.
Thanks. Can you share the .vimrc section related to which-key, which produces the screenshot you sent earlier
from vim-which-key.
Here is my config https://github.com/liuchengxu/space-vim. I also change the highlight of WhichKeyDesc in the pict:
highlight WhichKeyDesc ctermfg=68 guifg=#5f87d7
from vim-which-key.
However, if you have a mapping
<Leader>l
, then vim-which-key will display it rhs instead.
I have only this l
key mapped in my .vimrc:
nmap <leader>l :set list!<CR>
lusty explorer provides these:
nmap <silent> <Leader>lf :LustyFilesystemExplorer<CR>
nmap <silent> <Leader>lr :LustyFilesystemExplorerFromHere<CR>
nmap <silent> <Leader>lb :LustyBufferExplorer<CR>
nmap <silent> <Leader>lg :LustyBufferGrep<CR>
If I understand you, which-key would only show nmap <leader>l :set list!<CR>
mapping.
But if you look this screenshot, one of the lusty's l
mappings is also shown.
Your .vimrc suggest the use of dictionary for such cases, is it needed for such cases (single letter and same letter in multiple letter combinations, like l
and lb
)?
from vim-which-key.
By default it will show other <leader>l*
instead of <leader>l
only, see https://github.com/liuchengxu/vim-which-key/blob/master/plugin/which_key.vim#L13. You could try this if you don't want that:
let g:which_key_flatten = 0
If you have two mappings <Leader>l
and <Leader>lb
, when you press <Leader>l
, I don't know whether you want to trigger <Leader>l
or in the middle of <Leader>lb
, see :h ttimeoutlen
, so I suggest avoid such mappings. Don't map <Leader>l
when you have <Leader>l*
mappings.
Read https://github.com/liuchengxu/vim-which-key#configuration and the doc please.
from vim-which-key.
from vim-which-key.
Closing then. Feel free to reopen if you still have questions.
from vim-which-key.
Related Issues (20)
- [bug] conflict with fastfold.vim
- [bug] when buftype=quickfix, vim-whick-key will change the window where cursor stays
- How `which_key_use_floating_win' works? HOT 1
- Sort which-key entries by description instead of actual keys HOT 2
- Allow calling lua functions directly? HOT 1
- 突然无法使用 HOT 3
- Using map <nowait>
- How to make the background transparent? HOT 1
- Using lua doesn't seem to work HOT 3
- Name <Tab> prefix HOT 2
- Show only the mappings provided by dictionary HOT 7
- Hide all mappings that do not have a description. HOT 1
- Add documentation on how to map lua functions
- Recent commit to improve keycode merging broke which-key for me HOT 9
- Domain name has been sold? HOT 3
- Mason Registry Error HOT 2
- In visual mode, which key seems to make cursor jump before command actually executed HOT 4
- Buffer local mappings are cached even with g:which_key_run_map_on_popup set to 1 HOT 1
- Exit key setting to a list of keys doesn't work HOT 2
- Is there a way to set a padding for the floating popup window ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-which-key.