ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I use "makeprg=gcc\ -o\ %<\ %" in my .vimrc and from within vim I just type ":make" and it compiles my C code. But I have to exit vim everytime and run the compiled code to see the result. I was wondering if I could see the output without exiting vim. I know I could use ":!./code" but I want something that would compile the code and show me the result at the same time without me exiting vim.
I have found you answered a question about vim compiler so I thought maybe you can help me. I tried to learn vim and have wrote a simple code. I now need to compile it to see how it work but I am not sure how. I have SUSU 9.3 installed and I used YaST to installed gcc so I know it is there. After writting and saving vim code, how do I compile/run it? it may sound stupid but I am just now sure how to go about it, I mean what command should I use?
please help.
In post #2 I describe how you can attach a function key (F3 and F4 in the example) to a piece of code that will compile (F3) or compile and run (F4) a piece of c code written in vi(m).
I'm not sure what it is you are actually looking for:
A) in general how to compile using gcc,
or
B) compiling (and possibly running) code without leaving the vi editor.
The answer I gave in post #2 deals with B (not having to quit vi to compile and/or run the code you just typed).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.