Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a new file, and open it in a new tab in a single command?

Tags:

vim

Simple question, with Vim can I create a new file, and open it in a new tab in one command?

At the moment I am:

  • :new to create a new file
  • :tab split to get this file into a new tab
  • :tabp to go back to the previous tab
  • :q to close the other instance of the file
  • :tabn to go to my new file

Bit of a mouthful for what would in other text editors be a single action, is this possible?

Thanks

like image 561
JMK Avatar asked Dec 25 '22 09:12

JMK


1 Answers

Maybe this is what you are looking for:

:tabe[dit] {filename}

Of course, {filename} can also be an existing file.

like image 65
Peque Avatar answered Dec 28 '22 17:12

Peque