Latest LQ Deal: Linux Power User Bundle
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 06-22-2007, 03:13 PM   #1
Registered: Sep 2005
Distribution: Ubuntu
Posts: 249

Rep: Reputation: 30
vimrc function !./% with variable for arguments

In my .vimrc file, I have F7 bound to run the current document like an executable script. This is very very handy.

Current code:
nmap <silent> <F7> :!./% <CR>
But sometimes I would like to be able to set a variable, like say $ARGS, with some arguments to pass to the shell.

Future Code?:
let b:ARGS=""
nmap <silent> <F7> :!./% $ARGS <CR>
So while using vim I could do something like...

   :let ARGS="-t ext3 -o allow_others"
And then when I pressed F7, it would pass these arguments automatically to the shell. Anyone have an idea how to do this?


arguments, shell, vim, vimrc

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
bash script - variable arguments indikabandara19 Linux - Newbie 4 05-21-2007 10:40 PM
Question about a function that takes a variable amount of arguments daYz Programming 5 03-15-2007 01:59 AM
Variable arguments in C macros on AIX vincentfclarke AIX 1 05-27-2004 12:06 AM
C Function Arguments jpbarto Programming 6 04-23-2004 01:59 PM
Function accept() and its arguments. krajzega Programming 1 01-20-2004 01:26 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:29 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