vim-go maps the K key to doc lookup

Created on 10 Aug 2014  路  6Comments  路  Source: fatih/vim-go

Hi

I couldn't find information on how to unbind this key that vim-go seems to bind to looking up something. I use the K key myself for another mapping and I'm wondering if this can be turned off somehow.

Most helpful comment

setlocal would not work because you can't set custom commands to it unfortunaly. I've tried to make it work without any success. I only can set the globabl one which is a kill and not a solution.

However I made is customizable, just add this to your vimrc and it's good to go:

let g:go_doc_keywordprg_enabled = 0

All 6 comments

Ah

https://github.com/fatih/vim-go/blob/master/ftplugin/go.vim#L24

Not sure that these should be mapped by default. How about putting them as recommendations on the readme instead?

Hi @fent this is only for .go files. The K mapping is also a standard called kewordprg in Vim. By default it's set to open man pages however for Go packages it's better if it's calling :GoDoc

For now you can just remove that line for your case, however I can introduce a setting that overrides it for other users. However it's not the time worth because you are the only one that complained until now :) What do you think? What is your use case for K ?

I never found myself using the keywordprg action in vim, I mapped HJKL to moving between windows.

How about setting setlocal keywordprg="go doc" instead?

setlocal would not work because you can't set custom commands to it unfortunaly. I've tried to make it work without any success. I only can set the globabl one which is a kill and not a solution.

However I made is customizable, just add this to your vimrc and it's good to go:

let g:go_doc_keywordprg_enabled = 0

Thank you.

Thanks for this feature. I use K to move the cursor 10 lines up (analogous to k which moves one line up). So, it's really good that the vim-go mapping of K can be disabled.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MattFlower picture MattFlower  路  4Comments

danielmanesku picture danielmanesku  路  4Comments

andrejvanderzee picture andrejvanderzee  路  3Comments

cassiobotaro picture cassiobotaro  路  3Comments

groob picture groob  路  3Comments