Tuesday, August 25, 2009

Re: Creating a macro of EX commands

CHEN Cheng wrote:
> On Tue, Aug 25, 2009 at 09:15:20PM -0400, Steve Bertrand wrote:

>> Essentially, if I'm developing a Perl module, I'd like to assign a
>> keystroke that will allow me to do a series of tasks, given that my pwd
>> is in the module root, and I want the macro to be accessible via my
>> vimrc, if possible:

[ snip ]

> It seems okay by defining a function in .vimrc:
>
> function PerlBuild()
> w
> ! echo hello
> ! sudo echo hello
> endfun
>
> map ,pb :call PerlBuild()<CR>

Thanks Cheng,

That was very helpful.

Even though I've copied a few code snips from the wiki, your post
prompted me to test out:

:help function

...even though I've always been told I should use vi(m), I never would
have believed I could do so much with an "editor".

Sheesh. I still can't believe it, even though I'm editing four files in
two windows on a dual-head monitor, grabbing info from the command line,
writing to the repository, testing written code, doing diffs and writing
errors from executed code to a logfile, folding all functions, disabling
colo(u)rs when I want to, highlighting also when I want to...

I'm dizzy from how fast I can do things. If anything, Vim has been a
detriment to my mental stability...

...for once, my brain doesn't have an excuse for having to move it's
fingers from their natural position on the keyboard, thus it receives no
break ;)

Steve

No comments: