Is it possible to redirect vim input?

74 views
Skip to first unread message

GoTouch Go

unread,
Jul 4, 2015, 2:54:11 AM7/4/15
to vim...@googlegroups.com
Hi there,

I am looking to make vim work with gdb in an easy way I like. I looked around and does not seem to see a solution. There is gdbmgr but that means I still need to type in gdb command which is too long.

What I prefer is to let vim get input from my program, which sends editing input to vim so as to show a file, go to specific line, etc. This way I can press Fn hot keys, send commands to gdb, and move the cursor in vim as well. I can still edit in vim, and save the change, recompile and restart gdb.

So what I am looking to is basically sending input to vim through a pipe. Do you know a way to do so? vim probably does not get input from STDIN because reading from STDIN cannot respond to individual key strokes.

Thanks for any clue.

Steve B

unread,
Jul 5, 2015, 2:36:17 PM7/5/15
to vim...@googlegroups.com
That's not what you asked for but in case of, cgdb is an ncurses
interface to GDB modeled after Vim.
https://cgdb.github.io/

Steve

Benji Fisher

unread,
Jul 6, 2015, 8:51:29 AM7/6/15
to vim...@googlegroups.com
Also not what you asked for, but the client-server functionality was designed for this sort of thing.  Have you read

:help remote.txt

yet?

-- 
HTH
Benji Fisher 

Ben Fritz

unread,
Jul 6, 2015, 11:13:27 AM7/6/15
to vim...@googlegroups.com, gotou...@gmail.com

If you are writing some sort of toplevel command program, you can send commands to Vim using the "netbeans" interface. From :help netbeans-intro:

> The NetBeans interface was initially developed to integrate Vim into the
> NetBeans Java IDE, using the external editor plugin. This NetBeans plugin no
> longer exists for recent versions of NetBeans but the protocol was developed
> in such a way that any IDE can use it to integrate Vim.

> The NetBeans protocol of Vim is a text based communication protocol, over a
> classical TCP socket. There is no dependency on Java or NetBeans. Any language
> or environment providing a socket interface can control Vim using this
> protocol. There are existing implementations in C, C++, Python and Java. The
> name NetBeans is kept today for historical reasons.

Jacek Czaja

unread,
Jul 8, 2015, 6:46:31 AM7/8/15
to vim...@googlegroups.com, b.s...@gmx.com
Hi I use GDB from Vim, using following plugin:

http://www.vim.org/scripts/script.php?script_id=4582

GoTouch Go

unread,
Jul 8, 2015, 5:27:38 PM7/8/15
to vim...@googlegroups.com
Thanks all. Just took a quick look at clientserver (remote.txt) and netbeans.txt which give a lot info about this kind of integration of vim.

I probably can use them for my goal. I just want to make gdb easier to use, maybe spoiled by windows debugger key bindings but it is just so easier than gdb command line.

My motivation is to make it easy to try rust in a more interactive way: type in lines of code, compile (which is quite fast), run / step through it and display variable values and output. This will not support profound use of gdb easily but should be good enough as a start. Obviously this can apply to other languages as well.

tlux

unread,
Jul 10, 2015, 10:42:39 AM7/10/15
to vim...@googlegroups.com
On 08/07/15 03:07, Jacek Czaja wrote:
> Hi I use GDB from Vim, using following plugin:
>
> http://www.vim.org/scripts/script.php?script_id=4582
>
>
>
>
Hi, thank you so much for the above link. I've been looking for
a way to integrate gdb into vim and this plugin is just great!

Regards,
tlux.
Reply all
Reply to author
Forward
0 new messages