Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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

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

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, 10:47 AM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652
Hi kofucci,

Have a look at macros, basic process is:

q then key_to_bind
perform actions

maybe something along the lines of:

:w /tmp/
:! chmod u+x /tmp/
:! /tmp/
:! rm -f /tmp/

access by using '@x'

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



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

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