Review your favorite Linux distribution.
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-12-2006, 06:14 PM   #1
LQ Newbie
Registered: Jun 2003
Location: Lima, Peru
Distribution: Fedora Core 3
Posts: 17

Rep: Reputation: 0
Saving Macros in vim

Hi, I have assigned an often used combination of keys to a macro in vim, it's very simple, go to start of line and insert /* , then go to end of line and append */, basically this comments a line like:

var a=anything;
and put it like:

/*var a=anything;*/
I used qa to record my macro so I can call it with @a, I know, it's really basic, I have started with vim just one month ago, but still quite useful.

I want to know if this and other macros I create are saved somewhere so I can use them with any file whenever I want or I have to explicitly save them in some file.

I've read most of the manual and googled for it but couldn't find a precise answer.

Any ideas?

Old 01-12-2006, 06:42 PM   #2
Registered: Aug 2005
Location: China
Distribution: redhat(Fedora Core)->Debian Sid->Slackware
Posts: 91

Rep: Reputation: 15
You can check this :
And I did the things they said, when I define a macro following their idea and after restarting vim it also works, so you can try.
Old 01-12-2006, 06:50 PM   #3
LQ Newbie
Registered: Jun 2003
Location: Lima, Peru
Distribution: Fedora Core 3
Posts: 17

Original Poster
Rep: Reputation: 0
Hi, thanks a lot!, I'll take a look


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
NEdit macros theonebeyond Linux - Software 2 05-29-2018 06:04 PM
Macros In C drumstick Programming 8 11-21-2005 04:37 PM
Macros Twi7ch Linux - General 2 08-27-2005 09:37 PM
keystroke macros squip Programming 1 10-09-2003 12:46 PM
saving and not saving sessions on desktop ergo_sum Linux - Newbie 2 09-26-2003 07:27 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:06 AM.

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
Open Source Consulting | Domain Registration