Writing profiles for fun

Neven Has haski at sezampro.yu
Tue Oct 15 14:34:58 PDT 2002


Yes, being lazy is a wonderful thing. ;)

Even though I'm just updating my profile to 4.0, there are a lot of
elements that have to be added, so just before Chapter 6, which is sooo
long and boring, this thing crossed my mind.

It's a Vim plugin (or whatever it's called) for easier adding of new
ALFS elements.

I'm not a Vim guru, so it might look primitive, but it works. Feel free
to improve it. For example, adding <option> in elements that use it
would be good, as it's much easier to remove it with two key strokes,
than to write it. One can add the mappings for those inner elements too,
like <source> and <destination>. Also, we could automatically add three
<stages> in <package>, etc. etc.

When you're few TABs away from the first column, the inserted element
won't be indented well. I would like to see that fixed too, for example.

BTW, just :source it and it's "ALT-a NNN" in Insert mode. NNN can be
"mkd" for <mkdir>, "con" for <configure> etc.

Also, if you type slow, you could ":set timeout!", or something.

Hope you find it useful,

Neven
-------------- next part --------------
" Vim file for making the creation of ALFS profiles fun.
" Written by Neven Has <haski at sezampro.yu>
" 
" Do improve and modify, but please send me the changes too.


imap <M-a>alf 
	\<alfs version=""><CR>
	\</alfs>

imap <M-a>che 
	\<check></check>

imap <M-a>con 
	\<configure base=""><CR>
	\<Tab><param></param><CR>
	\</configure>

imap <M-a>cop 
	\<copy><CR>
	\<Tab><source></source><CR>
	\<Tab><destination></destination><CR>
	\</copy>

imap <M-a>exe 
	\<execute command="" base=""><CR>
	\<Tab><param></param><CR>
	\</execute>

imap <M-a>lin 
	\<link base=""><CR>
	\<Tab><target></target><CR>
	\<Tab><name></name><CR>
	\</link>

imap <M-a>mak 
	\<make base=""><CR>
	\<Tab><param></param><CR>
	\</make>

imap <M-a>mkd 
	\<mkdir base=""><CR>
	\<Tab><name></name><CR>
	\</mkdir>

imap <M-a>mov 
	\<move><CR>
	\<Tab><source></source><CR>
	\<Tab><destination></destination><CR>
	\</move>

imap <M-a>own 
	\<ownership user="" group=""><CR>
	\<Tab><name></name><CR>
	\</ownership>

imap <M-a>pac 
	\<package name="" version=""><CR>
	\</package>

imap <M-a>pat 
	\<patch base=""><CR>
	\<Tab><param>-N</param><CR>
	\<Tab><param>-p1</param><CR>
	\<Tab><param>-i </param><CR>
	\</patch>

imap <M-a>per 
	\<permissions base="" mode=""><CR>
	\<Tab><name></name><CR>
	\</permissions>

imap <M-a>rem 
	\<remove></remove>

imap <M-a>sea 
	\<search_replace><CR>
	\<Tab><file></file><CR>
	\<Tab><find></find><CR>
	\<Tab><replace></replace><CR>
	\</search_replace>

imap <M-a>sta 
	\<stage><CR>
	\<Tab><stageinfo><CR>
	\<Tab><Tab><base></base><CR>
	\<Tab></stageinfo><CR>
	\</stage>

imap <M-a>stm 
	\<stamp name="" version=""/>

imap <M-a>tex 
	\<textdump><CR>
	\<Tab><file></file><CR>
	\<Tab><content><CR>
	\<Tab><Tab>=<CR>
	\<Tab></content><CR>
	\</textdump>

imap <M-a>unp 
	\<unpack><CR>
	\<Tab><source></source><CR>
	\<Tab><destination></destination><CR>
	\</unpack>


More information about the alfs-discuss mailing list