Issuing :tabnew somefile will open somefile in a new tab to the right of the current tab. Can I somehow get Vim to open a tab to the left of the current tab?
Update: The suggested answers do allow me to open a new tab left, but they break file name auto completion, which is a no-go.
To utilize the behavior @romainl described without having to resort to knowing current tab page number use the following command:
. Note: it is perfectly save to use
0tabnew: this does what intended and makes new tab the first one, even though there is no tab page that has number below 1.If you are sure you never use this command with
++optor+cmdyou can use-complete=filejust after-bar. Note: besides its name it is not a completion option because it as well does filename expansion (and shows errors in case-nargs=1and globs expanded in too many filenames). Unfortunately this behavior is not even mentioned in documentation.