Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 01-26-2005, 03:51 AM   #1
Registered: Sep 2004
Posts: 62

Rep: Reputation: 16
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:
: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, 08:56 AM   #2
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
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:
set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#


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 07:06 PM
Mapping Esc to windows key in Vim frankie_DJ Linux - Newbie 2 10-14-2004 03:56 PM
Backspace key mapping in vi arobic Linux - General 2 06-30-2004 02:30 PM
Arrow Key mapping lazlom AIX 5 06-21-2004 04:32 PM
mapping delete key sboyce57 Linux - Newbie 1 02-23-2004 12:05 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:17 PM.

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