LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-22-2007, 04:13 PM   #1
sadarax
Member
 
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:
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?:
Code:
let b:ARGS=""
nmap <silent> <F7> :!./% $ARGS <CR>
So while using vim I could do something like...

Code:
   :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?
 
  


Reply

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


All times are GMT -5. The time now is 07:23 AM.

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