Vim external command output to new buffer


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Vim external command output to new buffer
# 1  
Old 11-04-2010
Vim external command output to new buffer

Hi,

From inside Vim, I'm looking for a way to use the contents of the current buffer, pass it to an external executable, and then return the output from the executable into a new Vim buffer.

I know that I can do something like %!<executable>, but that will overwrite the contents of the current buffer.

Thanks in advance!
# 2  
Old 11-04-2010
Copy the original to another buffer first?
# 3  
Old 11-05-2010
Thanks for the reply, but is there a more direct solution?

Your suggestion seems like more of a workaround.

Thanks.
# 4  
Old 11-05-2010
Create a macro to do it all at once? Vim buffers are like files, so :w name and :e name create file 'name' and switch the buffer to the new file. I do not see any fancy buffer-switch or other-buffer commands. There are many vim extensions and plugins, though. This looked a bit interesting:

minibufexpl.vim - Elegant buffer explorer - takes very little screen space : vim online

Vim buffer FAQ - Vim Tips Wiki

Easier buffer switching - Vim Tips Wiki

scratch.vim - Plugin to create and use a scratch Vim buffer : vim online
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi / vim - Insert a external command response

I would like to execute and external command and insert it into a particular area of the file I am editing. Note that I have the ORIGINAL AT&T vi training doc dated 1987. Doesnt explain it. As an example, in a vi editor I have I would like the result : After executing the following... (1 Reply)
Discussion started by: popeye
1 Replies

2. Shell Programming and Scripting

Redirect output to memory instead of an external file

I use the following as an example. I find myself always doing this and I believe my scripts would run much faster if I put the sed results into a place in memory rather than writing to files. Again, its not about sed, its about redirecting to a place in memory rather than an external file. ... (5 Replies)
Discussion started by: popeye
5 Replies

3. Shell Programming and Scripting

Jumbled output in expect_out(buffer)

I have a code like this : set ipv6_acl_max_chars test_acl_max_chars123456a789%s%d2345678ww134rt789qa23456789012345%c89012%a56789012x4r67890test_acl_max_chars1234567890.01234aabcdob34567aBC0 spawn telnet $myip expect "Login:" { send "admin\r" } expect "Password:" {send "admin\r" }... (0 Replies)
Discussion started by: ylucki
0 Replies

4. Shell Programming and Scripting

vim command for a search

how can i search each line for ROCT and ROCT1.ROCT1 will be always 1 line after ROCT. Both the patterns will be found at the end of the line (in alternate lines) <pattern file> (rising edge-triggered flip-flop clocked by ROCT) Endpoint:... (2 Replies)
Discussion started by: dll_fpga
2 Replies

5. Shell Programming and Scripting

how to invoke external program and capture its output

Hi all, I am using an external binary to view memory starting from a specific address and i want to automate this via PERL however there are problems. Hope you can help me ..thx The output of the programme is like below: bash-3.2$ mem_disp 12B21D20 100 Opening RO Data Memory File scp.ro... (4 Replies)
Discussion started by: ekckabatop
4 Replies

6. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

7. Shell Programming and Scripting

copy tail output to an external file in perl

The below code works to tail client.log file. but I want to copy the output into an external file /home/tail.txt Can anyone please help. #!/opt/bin/perl -w open my $pipe, "-|", "/usr/bin/tail", "/var/log/client.log" or die "could not start tail on /var/log/client.log : $!"; print while... (2 Replies)
Discussion started by: sureshcisco
2 Replies

8. UNIX for Dummies Questions & Answers

Vim: Warning: Output is not to a terminal

I'm using Debian, connected via SSH using Putty, and trying to run the command: dpkg --configure -ato run a package that didn't complete due to my having to disconnect while it was running. It gives this message: dpkg: dependency problems prevent configuration of php5-dev: php5-dev... (3 Replies)
Discussion started by: stulancs
3 Replies

9. Shell Programming and Scripting

How to redirect the output to a buffer/clipboard ?

Hi, I was wondering if there is a way by which I can redirect the output of a command to the buffer so that if I do a Ctrl+v or Alt+v it should paste the data. Ex : cat myfile.txt | grep hello . Hello there 1 Hello there 2 The output of the file should go to the buffer(clipboard info) so... (1 Reply)
Discussion started by: preethgideon
1 Replies

10. Programming

buffer the output

Hai Friends I am writing a cgi program in C. The CGI program has a link to start my tcp chat server... The tcp chat server prints some information when it starts... I have captured the informations and sent to the client browser through the cgi program... But the output is displayed all... (6 Replies)
Discussion started by: collins
6 Replies
Login or Register to Ask a Question