Home > linux > Open multiple vim tabs and windows simultaneously from command line

Open multiple vim tabs and windows simultaneously from command line

May 25Hits:0
Advertisement

I've got four files a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files a and b in the first tab and c and d in the second tab. Can I do this from command line?

I know there are -p and -O parameters, but they don't seem to cooperate. One only overwrites another from what I observed...

Answers

This command does what you want:

$ vim -c "edit a|split b|tabedit c|split d"

or, with shortened commands:

$ vim -c "e a|sp b|tabe c|sp d"

You should be able to open your files vertically splitted like this:

vim -O fileA.txt fileB.txt
vim -O fileC.txt fileD.txt

There are also some keys you can use for splitting.
Ctrl-W s for horizontal splitting
Ctrl-W v for vertical splitting
Ctrl-W q to close one

But you should know that different Vim instances have independent sessions.
Currently vim does not support to have seperate toplevel’ windows for the same process/session. It's on the ToDo list. (See :help todo and search for "top-level".)

Perhaps the following will brings you further, if you need to share the same buffer between multiple instances of vim: gnu screen - Working with vim on multiple monitors

Related Articles

  • Open multiple vim tabs and windows simultaneously from command lineMay 25

    I've got four files a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files a and b in the first tab and c and d in the second tab. Can I do this from command line? I know there are -p

  • Multiple PHP versions on windows server 2008 command line issueMarch 7

    I'm running server 2008 and have multiple versions of PHP installed. It looks like the initial version was 5.2.14. Then there are 2 more versions, 5.2.17 and 5.3.10 installed. They are in this directory structure: C:\program files\php - 5.2.14 C:\pro

  • How can I print multiple file types in Windows from the command line?July 19

    I have setup a PostScript printer called PSPinter to the FILE port. I can go into various programs (MS Word, Excel, Acrobat, etc.), and print the document to this printer. It asks me for a file name, and once it outputs the file, I can examine it and

  • How to install Windows Updates from command-lineMay 19

    Is it possible to install windows updates from the command-line? The graphical update tool doesn't seem to work so well in Windows 7. Sometimes it does, sometimes it doesn't... My problem is that I can't see any updates when I click to see the detail

  • Configuring Wi-Fi in WIndows XP from Command line?February 5

    Sometimes it doesn't connect (especially to an ad-hoc network) unless I press rescan button. How to control Wi-Fi connectivity in Windows XP from command line? (There's no 802.11-related things in XP's "netsh"). --------------Solutions----------

  • How to create a new terminal window from the command line in Red Hat Linux 5.3May 18

    I use PuTTY to get to my Red Hat Linux 5.3 workstation from my Windows laptop. Typically, if I want a new terminal on my Windows 7 workstation from another terminal or mc, I have to type start <ENTER>, and I will see a new terminal window running th

  • How to close one set of Tab identified in Chromium through Command lineSeptember 2

    How to close one set of Tab identified in Chromium thru Command line; As we can see that a set of tabs are represented thru a PID (process ID). I would like to know how to close the tabs from command line. We know the process ID, --------------Soluti

  • How to make windows 8.1 command line save commands history?September 19

    Exist a way to automatically save command history on windows 8.1 command line and have it available after close and open the command line program? --------------Solutions------------- You can do this with an addon. Source Is there a global, persisten

  • Open a new opera window from the command line in linux?November 3

    My opera version is 33.0.1990.43 running on ubuntu. I would like to open a new opera window through the command line (which is executed via a keyboard shortcut). I have tried to run different variations of opera --newwindow (taken from http://www.ope

  • How to change user credentials of windows service from command line?June 8

    How to change user credentials of windows service from command line? --------------Solutions------------- You're looking for: sc config <servicename> obj= <accountname> password= <password> The "sc" command will work on remote

  • Remotely stopping website in IIS7 on Windows 2008 via command line?July 30

    How do I remotely stop a website in IIS7, in Windows 2008, via command line? --------------Solutions------------- IISReset takes a computer name: IISReset <Computer> -Stop The easiest way I can think of by using a command line would be to use Powers

  • Change windows hostname from command lineJune 9

    This question is related to http://stackoverflow.com/questions/54989/change-windows-hostname-from-command-line, but I'm in a different situation. The netdom tool will not work on a computer not joined to a domain. I've tried setting the hostname from

  • How can I resize a window from the command line?March 29

    I've done some research but I always get to a tutorial to resize the command prompt window, and I want to resize any other window from the command line. --------------Solutions------------- One way may be to install AutoHotkey, set up an AHK script f

  • How can I do the 'latex bibtex latex latex' compiling using Windows without the command line? June 25

    This question already has an answer here: Tools for automating document compilation 25 answers I'm using LaTeX and JabRef on Windows. I set up my bibliography database and cited references in my LaTeX document. However, I do not know how to use the c

  • How can I import a security template in Windows 7 using command line?March 26

    I would like to remotely deploy some specific change in Security Policies to several computers via remote console (SSH). This is my just exported security template .inf file, extracted according (mostly) to these instructions : [Unicode] Unicode=yes

  • How do I bind Windows key using command line?May 19

    I want to map Windows key (without any additional key) on Ubuntu to be able to launch Terminal (xterm). I've already went through this information but I don't know how to go from there. How can I assign a shortcut to Windows key using command line? E

  • Recreating drag and drop to Chrome window from the command line?September 10

    Is it possible to recreate the functionality of dragging and dropping a file from Windows File Explorer to a Chrome window from the command line? I have a crx file that I can install by dragging it to the about:extensions page in Chrome, but can't in

  • mvim open file as new tab in existing window from the command lineFebruary 17

    I frequently use the command: mvim -p file1 file2 to open multiple files in one window as tabs. However it often happens that I subsequently want to open another file from the command line. How do I tell mvim to open it as a new tab in the existing o

  • Windows 7 - Modify "advanced settings" tab of Device Manager from command line

    Windows 7 - Modify "advanced settings" tab of Device Manager from command lineJuly 31

    I'm in a position where I need to enable Wake on LAN for roughly 50 machines. I don't want to have to go round every one and adjust the settings for it, but it's looking increasingly like I'll have to. The network cards have a setting in the "advance

  • VLC - Play two mp3s simultaneously from command lineOctober 27

    I'm using VLC 2.0.8 on Windows 7. How do I play two mp3s simultaneously from the command line (command line because to write a batch script that launches the mp3s)? I've tried vlc 1.mp3 2.mp3 and vlc 1.mp3 --input-slave 2.mp3 (I've seen the second on

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 1.224 s.