LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-21-2008, 01:24 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
compile code from within the editor - vim or emacs


i am trying to compile c, sh, perl, php & ruby code without exiting vim and prefer that vim would take me to the lines where the errors are. is this something that could be done by default by vim v7? the other option would be to, i guess, run two shells in parallel.

i have installed a few plugins (for ruby, php and svn) and i guess i am a bit tired of tweaking .vimrc and/or installing just-another-plugin to do something with vim. however, i don't want to use a gui based bloated ide.

would emacs be a better alternative to vim?

thanks for any suggestions.
 
Old 05-21-2008, 02:03 AM   #2
nc3b
Member
 
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32
You can run any shell command from vim, for example
Code:
:! make
or
Code:
:! ls
etc.
Don't know about emacs but I'm pretty sure it's also got something like this.

EDIT
http://www.linux.com/articles/57727

Last edited by nc3b; 05-21-2008 at 02:07 AM. Reason: Added a vim tips link
 
Old 05-21-2008, 02:10 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This linux.com has a link to plugins for bash
http://www.linux.com/articles/114359

The target page also has a similar startup script for gvim C/C++ programming:
http://vim.sourceforge.net/scripts/s...?script_id=213
 
Old 05-21-2008, 02:46 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Emacs key sequence to compile : C-x M-m
After that the you have the change to edit the command to compile (default 'make' of course). Press enter.

The output show in new buffer. double click or press enter on a error message to take you to line in the source file where the error occurred.

More info here: http://www.gnu.org/software/emacs/ma...mpilation.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim or Emacs, what's best for a developer MrMark Linux - Newbie 10 02-18-2007 08:04 AM
where is the .emacs file in the emacs source code tarball? aizkorri Programming 2 01-13-2007 02:05 PM
How do I program in Emacs/Vim? coolblue Programming 5 07-29-2005 03:00 AM
regarding colors in vim and emacs pranith Linux - Newbie 0 02-10-2005 03:10 AM
Emacs or Vim? Whats best for me? wiggywag Linux - Software 19 10-15-2003 06:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration