How do you understand mapleader and localmapleader in vim?

  question, vim

I am a novice and have recently learned to use the vimwkiki plug-in, but some of the shortcut keys inside cannot be used.
3. Mappings |vimwiki-mappings|
3.1. Global mappings |vimwiki-global-mappings|
3.2. Local mappings |vimwiki-local-mappings|
————————————————————————

  1. vimwiki_<Leader>wh*

<Leader>wh Convert current wiki page to HTML.
Maps to |:Vimwiki2HTML|
To remap: >
:nmap <Leader>wc <Plug>Vimwiki2HTML
————————————————————————
According to vimwiki’s help document, the local maps described in section 3.2 are problematic.

Baidu is searching for two key words, both of which are duplicate content. Google, and some don’t understand t.t.

Do you need to set the value of localmapleader in vimrc to use the vimwiki-local-mappins shortcut key?

The version of vimwiki I use is Version: 2.0.1 ‘stu’

Quoting vim Chinese Documents (http://vimcdoc.sourceforge.net) explanation:

在一个全局插件里应该使用 <Leader> 而在一个文件类型插件里应该用 <LocalLeader>。
"mapleader" 和 "maplocalleader" 可以是相同的。尽管如此,如果你把它们设为不同,
全局插件和文件类型插件的映射冲突的机会是不是会小一点呢?例如,你可以保持把
"mapleader" 设置为缺省的反斜杠,而设置 "maplocalleader" 为下划线。

The problem that I encountered that the Vimwiki2HTML shortcut key could not be used was that < buffer > was “playing tricks”.

After installing the vimwiki plug-in with pathogen, there is a vimwiki.vim file under ~/.vim/bundle/vimwiki/ftplugin, which contains a shortcut key for converting wiki to HTML defined as follows:

if !hasmapto('<Plug>Vimwiki2HTML')
  nmap <buffer> <Leader>wh <Plug>Vimwiki2HTML
endif
nnoremap <script><buffer>
      \ <Plug>Vimwiki2HTML :Vimwiki2HTML<CR>

< buffer > limits the scope of this shortcut, then this shortcut will only be valid for files with the suffix vimwiki, and will not work for files in other formats.

I was not familiar with ftplugin and the scope of the shortcut key before, so I didn’t bring up the shortcut key. I also thank @ XUELING for her warm help.

Finally, add that mapleader and localmapleader are customizable.

let mapleader = "\\"
let localmapleader = ","

You can also use vimwiki if you also encounter problems that some shortcut keys cannot be used.

:set filetype=vimwiki

I hope this answer will be helpful to netizens who encounter the same problem.