VsCode VIM - How to open "New Untitled File"
Asked Answered
V

3

14

In VsCode VIM (vanilla installation), how would you execute Ctrl + N? When inspecting the keyboard shortcut, it looks like this:

enter image description here

I tried the plain way in VIM by running :new, but it opened a new tab within the same editor instead of a whole new tab.

Ideally, I'm looking for a plain way to do this without having to re-map any keys. I'm a big proponent of using vanilla tooling so I can easily transfer machine without having to carry around my re-mappings.

Vita answered 14/2, 2020 at 17:26 Comment(2)
Perhaps :enew is what youre afterSeineetmarne
@D.BenKnoble That was the answer. You should post it and I'll accept it.Vita
S
16

In vim, I use :enew to start a brand new file.

Seineetmarne answered 15/2, 2020 at 23:38 Comment(1)
The only thing that sucks is it doesn't work if you're in the default "Welcome" screen.Vita
R
9

You can try :e

Example

:e test.js

Or install extension like this : https://github.com/dkundel/vscode-new-file

Raggletaggle answered 15/2, 2020 at 5:34 Comment(2)
This isn't a great answer. A plugin shouldn't be required to open a new file in my opinion.Vita
Great, :e works for me. :enew gives me a E488 error.Corset
L
1

In --NORMAL--
:e or :enew then press enter.
This will create new and open a new file tap.

Levison answered 6/11, 2023 at 3:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.