LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-26-2005, 02:51 AM   #1
dvm
Member
 
Registered: Sep 2004
Posts: 62

Rep: Reputation: 15
mapping a key to compile a program in vim


Hi to everyone. I recently came upon the map option in vim. So I thought I could map the F5 key to save me the trouble of pressing the semicolon and up keys too many times. The problem is I want to parse the filename. For example if my filename is "file.cpp" I'd like to do:
:w
:g++ -o file file.cpp
Is there a way to get only the filename, without the extension so I can pass it to -o?
Thanks in advance.
 
Old 01-26-2005, 07:56 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
I don't use g++ so I don't know about its vim errorformats and related things, but try this.

For reference, this is what I have to compile using javac and an errorformat line to be able to navigate (and highlight) errors in the code as reported by javac:
Code:
set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
Håkan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mapping Key functions - AGH TomalakBORG Linux - Laptop and Netbook 3 04-08-2005 06:06 PM
Mapping Esc to windows key in Vim frankie_DJ Linux - Newbie 2 10-14-2004 02:56 PM
Backspace key mapping in vi arobic Linux - General 2 06-30-2004 01:30 PM
Arrow Key mapping lazlom AIX 5 06-21-2004 03:32 PM
mapping delete key sboyce57 Linux - Newbie 1 02-22-2004 11:05 PM


All times are GMT -5. The time now is 03:13 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration