Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To open files in Grep's output to Vim's -o -mode

Tags:

vim

How can you put a list of files to Vim's -o -mode?

I have a list of files as Grep's output. I run unsuccessfully

1

grep -il sid * | vim -o 

2

grep -il sid * | xargs vim -o 

3

grep -il sid * | xargs vim 

4

vim -o `grep -il sid *` 

5

vim -o | grep -il sid * 
like image 268
Léo Léopold Hertz 준영 Avatar asked Aug 13 '09 23:08

Léo Léopold Hertz 준영


People also ask

How do I open a file in Vim?

Open a new or existing file with vim filename . Type i to switch into insert mode so that you can start editing the file. Enter or modify the text with your file. Once you're done, press the escape key Esc to get out of insert mode and back to command mode.

How do I open a file in Vim terminal?

You simply type vim into the terminal to open it and start a new file. You can pass a filename as an option and it will open that file, e.g. vim main.

How do I open multiple files in Vim?

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.


1 Answers

Try

vim -p `grep -il sid *` 

if you want to open the files in different tabs in the same window.

like image 90
asymmetric Avatar answered Oct 02 '22 22:10

asymmetric