Hi all,

I've created key mappings in my ~/.vimrc file to automate creating empty 
XHTML, C/C++ and PERL files as well as mappings that automate putting in 
commonly used statements and commands like:

printf("",);
and
<a href=""></a>

and then I just fill in the blanks but I'm finding having so many 
mappings is actually slowing Vim down. Is there a way to do something like:

"------------------------- C/CPP SECTION -----------------------------
if FileType = c,cpp
     vmap ,pr diprintf("\n", );<ESC>2F"pf a
     set makeprg=gcc\ -o\ %<\ %\ -lnsl\ -lsocket\ -lresolv\ -Wall\ -O2
     ...
end if
"------------------------- X/HTML SECTION ----------------------------
if FileType = xhtml,html
     vmap ,ahref di<a href=""></a><ESC>2F"pf>p
     map ,ol i<ol><CR><TAB><li><CR></li><CR><BS></ol><Up><Up><c-o><s-$>
     ...
end if
"---------------------------------------------------------------------

so all irrelevant sections are ignored for current document type and 
don't slow Vim down?


Cheers and TIA,
Steve

--
SunOS, TCP/IP and Vim
What more could you want?!

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

Reply via email to