Rory Campbell-Lange wrote:
I'd like to:

    1. Select some text
    2. Hit a key sequence such as ;t
    3. Be prompted for a tag (I'll input something like 'b' or 'h1')
4. The text selection will be wrapped in -- say -- <b>text selection</b>

What doesn't work so far:
map ;t <ESC>:call Tag_Maker()<CR>
function! Tag_Maker()
        let l:tagger = input("tag? ")
    normal  @zd
        execute "normal i<" . l:tagger . ">"
        normal @zp
        execute "normal a</" . l:tagger . ">"
endfunction

Basically I don't know what I'm doing with the execute and normal
commands. I'm sorry to say that a read of usr_41 hasn't helped much!

Rory

It might work (untested) with "zd and "zp instead of @zd and @zp

Or just d and p if you don't mind clobbering the default register (the above clobbers register z instead).


Best regards,
Tony.

Reply via email to