exvim / main

This is the main repository for exVim!
exvim.github.io
MIT License
739 stars 169 forks source link

<Leader> bind error in plugins #121

Open Tiny-Box opened 7 years ago

Tiny-Box commented 7 years ago

According to the document, if I want to modify the value of <leader>, it‘s recommended to modify .vimrc.local, but it doesn't work about ex-gsearch.

Because the loading order of the .vimrc files, .vimrc.plugins will be first loaded. On line 48~52

Plugin 'exvim/ex-gsearch'

call exgsearch#register_hotkey( 100, 0, '<leader>gs', ":EXGSearchToggle<CR>", 'Toggle global search window.' )
call exgsearch#register_hotkey( 101, 0, '<leader>gg', ":EXGSearchCWord<CR>", 'Search current word.' )
call exgsearch#register_hotkey( 102, 0, '<leader><S-f>', ":GS ", 'Shortcut for :GS' )
is default '\' at this time. Even if I set the value of `` in `.vimrc.local`, `'gs'` is still `\gs`. There is a dirty fix way: set the value of `` on top of `.vimrc.plugins` file, but it destroyed the previous design about load order. It's better way to modify `register_hotkey` function.
jwu commented 7 years ago

Will the mapleader variable solve your problem? Basically, it will re-map the <leader> to any key you wish. You can learn it from :hep mapleader in Vim.

Tiny-Box commented 7 years ago

Did I use the wrong way to set the value of <leader>? I insert one line in .vimrc.local:

let mapleader = ","

In vim, :echo mapleader is ,, but if I want to global search current word under cursor by <leader>gg, ,gg doesn't work, \gg can work well.

My system is OS X EI Capitan 10.11.5, the version of vim is 7.3.