On Mon, 26 Jun 2006, Luc Hermitte wrote:
> * On Sun, Jun 25, 2006 at 12:06:51AM +0800, Dr Bean <[EMAIL PROTECTED]> wrote:
> > Another common idiom in perl is q//,qq//,qw//,qr// ...
> The main code is defined in plugin/common_brackets.vim, the filetype
> (C&C++) specializations beeing in ftplugin/c/c_brackets.vim.
> But I'm not sure this is the best way to define macros to q/, qq/,
> ... I think InsertSeq() is more adapted to the expansion of
> smart-abbreviations.
It was very easy to write a few smart abbreviations using InsertSeq().
I looked at the explanation in lh-map-tools/doc/lh-map-tools.txt,
but that was not even necessary. Following the example at the
definition of the function was enough.
inoremap <buffer> <silent> s/
\ <C-R>=InsertSeq('s/',
\ 's/!cursorhere!/!mark!/!mark!')<CR>
This allows me to type just:
s/
and get:
s/!cursorhere!/!mark/!mark!
This is quite helpful, I think.
--
Dr Bean Teaching: leaving
fingerprints over the tabula rasa.