Tuesday, August 25, 2009

Re: Creating a macro of EX commands

On Tue, Aug 25, 2009 at 09:15:20PM -0400, Steve Bertrand wrote:
> Hi all,
>
> I'd like to create 'macros' for EX commands that will allow me to
> perform common tasks without writing shell scripts, but can't quite find
> a solution.
>
> 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:
>
> - w
> - ! sudo { custom program that does an uninstall of my FBSD pkg }
> - ! perl make realclean
> - ! perl Makefile.PL
> - ! sudo make install
> - ! svn commit
>

It seems okay by defining a function in .vimrc:

function PerlBuild()
w
! echo hello
! sudo echo hello
endfun

map ,pb :call PerlBuild()<CR>


HTH,
Cheng


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: