LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2009, 11:18 AM   #1
kofucii
Member
 
Registered: May 2007
Location: Bulgaria
Distribution: Slackware, SCO Unix
Posts: 62

Rep: Reputation: 20
Vim - execute the file I'm editing


Hello,
how can i execute the file, that I'm editing at the moment in vim.
I don't mean something like this:
:!scriptname

I need a command that will save the file, in some buffer or temporary file, then will make it executable and run it. At the end I wish to map it to F1 for example.
 
Old 08-13-2009, 11:47 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Hi kofucci,

Have a look at macros, basic process is:

q then key_to_bind
perform actions
q

maybe something along the lines of:

qx
:w /tmp/test.sh
:! chmod u+x /tmp/test.sh
:! /tmp/test.sh
:! rm -f /tmp/test.sh
q

access by using '@x'

( I gave it a test, seems to work ok )


cheers
 
  


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
vim slow editing php files in ubuntu exodist Linux - Software 5 05-17-2008 03:18 PM
vim and vi editing question penguin_powered Programming 5 07-24-2005 06:43 PM
VIM: editing files via ftp robertmarkbram Linux - Software 2 10-17-2004 02:41 AM
Vim editing newbie needs help! andym Linux - Software 1 04-16-2003 04:59 AM
editing two files in vim schatoor Linux - Software 2 12-28-2002 09:56 AM


All times are GMT -5. The time now is 10:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration