Vscode-neovim: remap `gt` and `gT` doesn't work on markdown files

Created on 20 Aug 2020  路  10Comments  路  Source: asvetliakov/vscode-neovim

hi,
currently i'm using <tab> and <s-tab> instead of gt and gT to switch between tabs. however these rebinding keys have no effect on markdown files

" use <tab> and <s-tab> to switch between tabs
nmap <tab> gt
nmap <s-tab> gT

pls note that gt and gT work as expected.

need more info

Most helpful comment

@Shatur95 nice catch

filetype is safe to use and can be useful to set per-type specific options/keys. Probably the markdown one, or some vim plugin overrides <tab>/<s-tab> bindings. Should be fixable by putting something like without disabling it:

autocmd FileType markdown nmap <tab> gt

See #115

Also few vim plugins require filetype to work, see #114

All 10 comments

Does it happen only in markdown files ?

@asvetliakov yes, it's only happened in markdown files so far.

<Tab> and <S-Tab> can be blocked by vscode emmet keybindings or by some other extension here. Try to set "emmet.triggerExpansionOnTab": false in config, also check these keybindings in vscode

@asvetliakov "emmet.triggerExpansionOnTab": false is set on default, emmet also exclude markdown as default. i also checked every keybindings related to <tab>, <s-tab>. i have no idea why this only happened to markdown file, other file types works as expected. moreover, gt and gT worked in markdown. i'm clueless if this is neovim bug or not.

updated: i switched to vscode-vim plugin and <tab> and <shift+tab> rebinding keys worked for me. so i think this is vscode-neovim bug.

Could you try filetype plugin off in your vimrc?

Could you try filetype plugin off in your vimrc?

genius, it worked for me 馃憤 thank you @Shatur95

is there any caveat if i turn it off?

This option disables settings for specific file extensions. Most likely some plugin or your markdown settings were conflicting with this plugin. It is recommended to disable such stuff in VSCode.

@Shatur95 nice catch

filetype is safe to use and can be useful to set per-type specific options/keys. Probably the markdown one, or some vim plugin overrides <tab>/<s-tab> bindings. Should be fixable by putting something like without disabling it:

autocmd FileType markdown nmap <tab> gt

See #115

Also few vim plugins require filetype to work, see #114

filetype is safe to use and can be useful to set per-type specific options/keys.

Of course! To be more clear: I recommended to disable Markdown specific settings or plugins that can conflict with VSCode Neovim plugin or just not needed in VSCode.

By the way, I have filetype disabled inside VSCode. But only because I am not using any file type specific settings in VSCode or plugins that need this feature.

autocmd FileType markdown nmap <tab> gt

this doesn't fix the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kkorus picture kkorus  路  4Comments

joshua7v picture joshua7v  路  4Comments

Shatur95 picture Shatur95  路  4Comments

pieterdd picture pieterdd  路  4Comments

erlais picture erlais  路  3Comments