heavenshell / vim-jsdoc

Generate JSDoc to your JavaScript code.
BSD 3-Clause "New" or "Revised" License
452 stars 44 forks source link

poor choice of default keybind #33

Closed DanielFGray closed 9 years ago

DanielFGray commented 9 years ago

<C-l> is used for redrawing the screen, overriding this as a default is a very poor choice IMO.

I'd like to suggest <leader>jd, or (my personal favorite) not defining any keybinds and let the user do it manually.

ryanoasis commented 9 years ago

@DanielFGray that's a good point I use <leader>d myself.

nmap <silent> <leader>d <Plug>(jsdoc)

I think the default is okay especially since it only affects javascript files but I can definitely see the other side of the coin (let the user decide and never setup a default).

http://stevelosh.com/blog/2011/09/writing-vim-plugins/#mapping-keys-the-right-way has some good thoughts on this

DanielFGray commented 9 years ago

I think the default is okay especially since it only affects javascript files

I spend a lot of time in JavaScript files and this default means I can't refresh the screen, and I use tpope's sensible that adds :nohlsearch to <C-l>, which I rely a lot on..

It is of course easily fixed, I just find it a really poor choice. Providing default keybinds is one thing, overriding defaults is another.

I also feel the need to point out your use of nmap above would be much better as a nnoremap, as per the the link you added.

ryanoasis commented 9 years ago

You make good points and I don't disagree with any of them :laughing: . I am not really sure why I responded (bad habit maybe). I think I will wait to let others, particularly @heavenshell, weigh in :smile:

heavenshell commented 9 years ago

Thx for pointing out. I Removed default mapping. https://github.com/heavenshell/vim-jsdoc/commit/694a52b799380a2d3c012b2f62f96cd3c1046163

So you can write your favorite keymapping to your .vimrc.