Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Leader> bind error in plugins #121

Open
Tiny-Box opened this issue Oct 20, 2016 · 2 comments
Open

<Leader> bind error in plugins #121

Tiny-Box opened this issue Oct 20, 2016 · 2 comments

Comments

@Tiny-Box
Copy link

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 <leader> in .vimrc.local, '<leader>gs' is still \gs.

There is a dirty fix way: set the value of <leader> 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
Copy link
Member

jwu commented Oct 20, 2016

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants