Nikolai Weibull wrote: > a readkeys() can't be far behind. Having a readkey() - singular > probably makes more sense - function would allow us (i.e., me) to do > something like this:
We already have getchar(), that basically does this. > function! s:DeleteComment(inclusive) > " Delete a language-specific comment > : > : > endfunction > > function! s:Delete() > let key = readkey() > let object = '' > if key == 'a' || key == 'i' > let object = readkey() > if object == 'c' > return s:DeleteComment(key == 'a') > endif > endif > call feedkeys(key . object) > endfunction > > map <buffer> <silent> d <Esc>:call <SID>Delete()<CR> > > That is, the input sequence "dac" would delete a comment. Entering > something else would just be fed to Vim as always. > > It would also be nice if the keys read by readkey() came up in the > 'showcmd' buffer. > > And for anyone suggesting I map "dac" directly, consider the fact that > "dd" will be delayed, which is, to me, unacceptable. > > One could map 'd' to map 'ac' once pressed, but it would be hard to > make sure that 'ac' was unbound if the user cancelled the command in > any way. Can't you do this with ":omap"? -- Proofread carefully to see if you any words out. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
