danchoi / ri.vim

browse ri documentation from Vim
http://github.com/danchoi/ri.vim
MIT License
114 stars 15 forks source link

Allow user to skip the default mappings. #27

Closed mpereira closed 9 years ago

mpereira commented 9 years ago

Fixes https://github.com/danchoi/ri.vim/issues/10.

This is useful because most people set their mappings after plugins are loaded and prefer to not edit plugins by hand.

sunaku commented 9 years ago

:+1: I would suggest combining the two if-statement clauses into a single one:

if get(g:, 'ri_no_mappings') && !hasmapto("ri#OpenSearchPrompt",'n')
sunaku commented 9 years ago

Oh, and shouldn't the if-statement really be checking for the lack of the g:ri_no_mappings variable? i.e. if get(g:, 'ri_no_mappings') should be if !get(g:, 'ri_no_mappings') :sweat_smile:

mpereira commented 9 years ago

Yeah... that's what I get for writing vimscript at 10pm after work I guess.

Weird thing is I tested the change on a buffer and it seemed to work. Go figure.

wikimatze commented 9 years ago

I will have a look over this and check if it works.

wikimatze commented 9 years ago

Thanks for the contribution.