On 2009-06-04, Wu, Yue wrote:
> vim has a feature, say you've moved to the end of a line, now if
> you still hit "l", then vim will "bing" or "flash the
> screen"(depends on your setting) to warn you that you're doing a
> null work. The question is, how can I produce this side effect in
> vimscript?
The only way I know of to do this is to execute an escape while in
normal mode.
normal \<Esc>
Here's a snippet from one of my scripts that uses this as part of
displaying an error message.
if &modified && (a:bang != "!")
if &errorbells
normal \<Esc> " Generate a bell
endif
echohl ErrorMsg
echo "No write since last change (use ! to override)"
echohl None
return
endif
HTH,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---