Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VsCode VIM - How to open "New Untitled File"

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.

like image 932
Kellen Stuart Avatar asked Feb 14 '20 17:02

Kellen Stuart


People also ask

How do I create a .VS Code folder?

The File > Add Folder to Workspace command brings up an Open Folder dialog to select the new folder. Once a root folder is added, the Explorer will show the new folder as a root in the File Explorer. You can right-click on any of the root folders and use the context menu to add or remove folders.

How do you add a template to VS Code?

In VSCode, open a folder that will contain your new project. Use the Command Palette to execute the command "Project: Create Project From Template". A list of available templates should appear. Select the desired template.


2 Answers

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

like image 148
D. Ben Knoble Avatar answered Oct 10 '22 04:10

D. Ben Knoble


You can try :e

Example

:e test.js

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

like image 34
pho mai Avatar answered Oct 10 '22 04:10

pho mai