Vim: vim-surround and problem with 'html.autoClosingTags"

Created on 2 Jul 2018  路  8Comments  路  Source: VSCodeVim/Vim

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

BUG REPORT

What happened:

With vim-surround feature. If i do use tag, it seem working wrong. Like:

<tag></tag>Hello</tag>

Maybe because "html.autoClosingTags" setting, if i set it to false, everything working fine, but without html auto closing tag is painful :cry:

What did you expect to happen:

vim-surround feature should overwrite default auto closing tags feature of vscode.

How to reproduce it (as minimally and precisely as possible):

Like we have:

<div>
  hello
</div>

Firstly, ensure that "html.autoClosingTags" is "true" in setting.

Choose hello with visual mode, then type:

shift s < b >

I'll become:

<div>
  <b></b>hello</b>
</div>

Environment:

  • Extension (VsCodeVim) version: 0.14.1
  • VSCode version: 1.24.1
  • OS version: OSX High Sierra 10.13.4 & Ubuntu 18.04

Most helpful comment

Currently, I have to press another u after the surrounding work. Then the redundant tag is undone.

All 8 comments

@banminkyoz Same issue here. Nice to know it can be worked around. Side-note, how did you format the keyboard keys in your github issue? That's great.

Hi @typeoneerror, I do use kbd tag. It's quite useful 馃樃

@banminkyoz amazing! thank you.

Currently, I have to press another u after the surrounding work. Then the redundant tag is undone.

This is kind of annoying. I hope there's someone who could fix this

Wow, this issue is still exist. I'v opened this a year ago and i don't remember about it.

Since vscode plugins have some limit and vscode take a lot resources of my laptop. I'v learn to use vim instead. And it's one of my best decision in my developer life.

If you guys want to have easy vim config to work like vscode please check my neovim config and i'v also write purify (a theme which support a lots of language and framework).

And if you really love vim (can't code without hjkl and other vim's keys), you should give time to learn vim, vimscript in learn vimscript the hard way (free). Then you can understand how vim work and write your own plugins.

VSCode is very good but i'v choose Vim.

I think it's a bit late but I just found the solution for this issue. Just disable the built-in close tag inside VSCode and install the Auto Close Tag (by Jun Han) extension instead. The redundant tag is now gone.

For anyone that reads this, yeah and kyoz is right. You should learn VIm. It's almost a year since I saw this issue and that's probably about 8-10 months that I've been using Vim (neovim) and haven't gone back to VSCode ever since

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orn688 picture orn688  路  3Comments

cckowin picture cckowin  路  3Comments

lucastheisen picture lucastheisen  路  3Comments

st-schneider picture st-schneider  路  3Comments

triztian picture triztian  路  3Comments