I was wondering if there's a way to open multiples files with Vim, but each file on a specific line number. I explain :
I often use the syntax : vim my/way/too/far/file +120 in order to edit this file at line 120 because gcc told me too :)
Now what i'm looking for is a way to do this for multiples files at the same time!
Of course, vim file1 +xx file2 +xx ... won't work (the + option only affect first file ... don't ask me why)
So if anyone know a way to fix this? I didn't found it in the manpage...
By the way, sometimes, file1 maybe the same file as file2 ...
Ctrl-W w to switch between open windows, and Ctrl-W h (or j or k or l ) to navigate through open windows. Ctrl-W c to close the current window, and Ctrl-W o to close all windows except the current one. Starting vim with a -o or -O flag opens each file in its own split.
Suppose you have opened a file on Vim editor and you want to split it vertically. To achieve this: Enter command mode by pressing the ESC button. Press the keyboard combination Ctrl + w , followed by the letter 'v' .
Here's a way : vim +6 file1 +"sp +3 file2"
.
Change sp
to tabnew
if you prefer tabs.
But it would be really useful only if someone could make a script with it...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With