Vim open files pipe




















As a result, Vim will open that file. In the command you've typed, the output of sed is piped to the standard input of vim. Since you're passing '-' as the argument to Vim, it assumes that the text to edit is what is coming through the standard input. This text is the filename, but not the contents of the file.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Open a file using vim from the output of pipe command Ask Question.

Asked 6 years, 10 months ago. Active 6 years, 10 months ago. Barry Arthur Barry Arthur 21 1 1 bronze badge. The solution is to use xargs -o vim I added the following to my. Weston Ganger Weston Ganger 1, 1 1 gold badge 9 9 silver badges 10 10 bronze badges.

Here is a simpler xargs solution than those already mentioned: find -name somefile. Cory Klein Cory Klein Searene Searene 1 1 silver badge 4 4 bronze badges. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 5. Related 3. Hot Network Questions. When you run a source file, if something goes wrong, you may see a stack trace of error lines. You may want to jump to the specific lines in that file.

If you are already in Neovim and want to open a file and go to a particular line, you can use :e or :edit command:. If you have used a command, how do you repeat that command without typing it again in the command line? Then, at any prompt, you can type Ctrl - X followed by Ctrl - E. This will open your current command line in your configured editor e. Make your edits, save and exit, and the command will be executed as though you had typed it on the command line, including pipelines and the like.

Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?

Learn more. How to invoke vim editor and pipe output to bash Ask Question. Asked 5 years, 8 months ago. Active 5 years, 8 months ago. Viewed 14k times. My usual workflow goes something like this: vim I edit and save my file as file. Improve this question. From within vim, issue the command :w! Note: the space between w and! Ok - that's great. I didn't know you could pipe vim output from within vim itself. This serves my purposes, but for my future knowledge, is it possible to solve my problem exactly how I intended it to be solved?

Can you post your function? What do you mean when you talk about the problem you soon encountered second last paragraph? I don't get that.



0コメント

  • 1000 / 1000