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

1gg hangs neovim #118

Closed
xzfc opened this issue Jul 5, 2021 · 8 comments · Fixed by #383
Closed

1gg hangs neovim #118

xzfc opened this issue Jul 5, 2021 · 8 comments · Fixed by #383
Labels
question Further information is requested

Comments

@xzfc
Copy link

xzfc commented Jul 5, 2021

More generally, it seems that two-letter commands starting with 1 hang neovim (e.g., 1gg, 10dd). But, e.g., 9dd and 10} work fine.

Probably related to #17.

$ nvim --version | head -3
NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
@folke
Copy link
Owner

folke commented Jul 5, 2021

I'm not able to reproduce this. Can you make a minimal config to trigger this?

@folke folke added the question Further information is requested label Jul 5, 2021
@xzfc
Copy link
Author

xzfc commented Jul 5, 2021

Found the offending keybinding: 1gD. Minimal config based on #117:

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'folke/which-key.nvim'
call plug#end()

autocmd VimEnter * PlugClean! | PlugUpdate --sync | close

lua << EOF
require("which-key").setup{}
EOF

" https://github.com/neovim/neovim/blob/5d6ecfa3c7447009da75842c611ea1b9f1db83e7/runtime/doc/lsp.txt#L50
nnoremap <silent> 1gD   <cmd>lua vim.lsp.buf.type_definition()<CR>

nvim --noplugin -u basic.vim basic.vim

@folke
Copy link
Owner

folke commented Jul 5, 2021

That's a really odd key binding. Not sure what that one was chosen to be put in the docs. Either way, I'll see if I can fix this properly.

@folke
Copy link
Owner

folke commented Jul 5, 2021

I think that's actually a typo in the LSP docs 😅

A better set of default bindings can be found on the lspconfig readme

@folke
Copy link
Owner

folke commented Jul 5, 2021

Can you check wether it even works with that binding without WhichKey?

@xzfc
Copy link
Author

xzfc commented Jul 5, 2021

I think it's mimicking a built-in vim mapping 1gD. And this binding example is already removed from the latest neovim docs. It works tho.

I can solve it for me by removing it from my config (since I'm not using this particular mapping anyway), but IMO which-key shouldn't hang if a weird but valid mapping is present.

@folke folke closed this as completed in 2d2954a Jul 5, 2021
@folke
Copy link
Owner

folke commented Jul 5, 2021

I just pushed a fix for this. Thank you for reporting!

@xzfc
Copy link
Author

xzfc commented Jul 6, 2021

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants