Vim: Right tab not working

Created on 6 Jul 2017  路  6Comments  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Environment:

  • VSCode Version:1.13.1
  • VsCodeVim Version: 0.9.0
  • OS: Linux

What happened:
Selecting a line or more than on line and pressing tab doesn't move right the text as it used to. Left tab works fine. If I disable the VsCodeVim extension the right tab works fine.

V, j, j, Tab or V, Tab

What did you expect to happen:
Move right the selected lines.
How to reproduce it:
Select multiple lines and tap Tab

statuby-design

Most helpful comment

fixed by adding following to my keybindings.json

    {
        "key": "tab",
        "command": "-extension.vim_tab",
        "when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
    }

If this is 'by design' then this is a case of broken design IMHO. :)

This tab-behavior works this way in all IDE's that have vi plugin/support that I work with (intelliJ, Eclipse).

Suggest this needs to be an option to make it less confusing for users of this plugin if absolute Vim compatibility is desired (I thought the plugin was itself broken/behaving badly and looked at plugin configs before finding this solution so such an option would have made that clear what was going on, didn't realize it was intentional and most users I think are going to be more frustrated than delighted if the current default behavior is left intact).

All 6 comments

@inaki6martinez <Tab> doesn't do that in vim, so we don't really support it.

You want to be using > to tab things in vim.

Thanks.
But it was was working before, wasn't it?

So, I have mapped Tab to indent in vim visual mode, how do I do the same in VSCode vim mode.

" indenting
vmap <Tab> >gv
vmap <S-Tab> <gv

You can achieve the desired mapping by adding the following to your settings.json 馃槃

Im noticing strange behaviour when making selections with the mouse or block selections with ctrl-v, but linewise selections work as expected.

  "vim.otherModesKeyBindings": [
        {
            "before": ["S-Tab"],
            "after": ["<", "g", "v"]
        },
        {
            "before": ["Tab"],
            "after": [">", "g", "v"]
        }
    ]

fixed by adding following to my keybindings.json

    {
        "key": "tab",
        "command": "-extension.vim_tab",
        "when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
    }

If this is 'by design' then this is a case of broken design IMHO. :)

This tab-behavior works this way in all IDE's that have vi plugin/support that I work with (intelliJ, Eclipse).

Suggest this needs to be an option to make it less confusing for users of this plugin if absolute Vim compatibility is desired (I thought the plugin was itself broken/behaving badly and looked at plugin configs before finding this solution so such an option would have made that clear what was going on, didn't realize it was intentional and most users I think are going to be more frustrated than delighted if the current default behavior is left intact).

I agree with @Chillee. Our philosophy is to try to be like vanilla "vim" as much as possible. To provide a counter example, vsvim (vim emulator for Visual Studio) adopts the same pattern -- is a NOP in visual mode.

In any case, the supplied remapping should satisfy most users who want this.

Was this page helpful?
0 / 5 - 0 ratings