I know I can open the last closed (:q) file in Vim by using :e#. This will open the file in the current tab. How would I perform the same task but open the file in a new Vim tab. Also I am interested in how to open the file in a new split instead of the current tab.
I know I can open the last closed ( :q ) file in Vim
Share
#is simply an Ex special character that will be replaced with the name of the alternate file. Do an:ls, and the alternate file will be marked with a#there also.#can similarly be used with:tabnewandsplit. In the examples below I’ll use:tabein place of:tabnewas:tabeis a shorter alias for:tabnew(search for either in the help docs)::tabe#:split#; this can be abbreviated to:sp#, and:vsp#for a vertical split.Using a buffer number from
:ls, e.g. buffer number 5 you can also::sp#5; alternately:sb5if theswitchbufoption contains thenewtabspecifier – see:help switchbuf:vsp #5(there is no:vsb):tabe #5