[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    confirmation promts for user defined commands
From:       Neil Zanella <nzanella () cs ! mun ! ca>
Date:       2003-12-18 6:45:16
[Download RAW message or body]


Hello,

Suppose I define a command to strip all whitespace immediately preceding
the newline character. I define such a command and assign it to key F8
with the map command. At a later time, I cannot recall exactly which
key I assigned this particular function to, so I would like to
encode a confirmation question into the map command or using
some other mechanism so that when I press F8 the bottom line
where ex commands are displayed displays the question:

"Remove redundant whitespace at end of lines? (y/n)"

If I type y, the command is executed, otherwise it is not.

The nice thing about having such a question at the bottom of
the screen, is that the question serves as a visual aid to
confirm to the user that the function associated with the
given key is really what the user thought (without the
user having to go back to inspecting the .vimrc file).

Is it possible to program such confirmation prompts into
custom key maps with vim?

Thanks,

Neil

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic