wookayin / dotfiles

:house: Personal dotfiles for *NIX systems
https://dotfiles.wook.kr/
MIT License
360 stars 105 forks source link

Tab switch keys do not work after updating #43

Closed geonyeong-park closed 11 months ago

geonyeong-park commented 1 year ago

Hi, thank you for your nice dotfiles! Recently i updated version and found that the tab-switching command is changed in neovim (or maybe nerdtree?). I have used to use gt, gT or (#number)gt to switch a tab, but it does not work anymore. Could you give some directions on how to read your help files? sorry that i'm newbie in this field.

wookayin commented 1 year ago

Hello, thanks for your interest and using my dotfiles.

I see that gt and gT keys are mapped (when LSP is enabled) to LSP type definitions: https://github.com/wookayin/dotfiles/blob/master/nvim/lua/config/lsp.lua#L61

In vim, you can check the keymappings using:

:map gt

or

:Maps

followed by some keyword. Such mapping has existed since July 2022. When the buffer does not have any language server client attached (E.g. on Nerdtree or some other normal buffers), gt and gT will work as the default behavior (switching tabs).

I agree (in my principles of deciding keymaps) that it's not good to override the default key in an agressive way, but I somehow prefer gt being goto type-definition. Personally I use [t, ]t for navigating tabs (prev tab / next tab) because it's more consistent with other motions ([c, ]c, [d, ]d, etc.) But I also wish I could use [#number]gt... Let me think about how to avoid the conflict with the default keys.

wookayin commented 11 months ago

1gt, 2gt, 3gt, etc. would now work as well as gt (goto type definition).