Background scenario: When I was debugging one VimScript, some code is not 
executed. The reason is that unmap raises one error and the VimScript exits on 
this error. Because one empty try-catch is place around the code, it's not very 
obvious what's the problem. After locating the problem finally, I begin to 
think maybe this default behavior is not very intuitive.

    try
        unmap <non-exiting-map>
        code-should-be-executed-but-not-due-to-previous-error
    catch
    endtry

This is some simple code to illustrate that vim reports error on removing non 
existing mapping, experimentally. It will fail on the last line, saying sth 
like "E31: No such mapping".

    map <F10> :echo 'hello'
    unmap <F10>
    unmap <F10>

What's the rational behind this design? Personally, I would consider removing 
non existing mappings perfectly OK, and it should continue as usual.

PS: This question is asked in 
[SO](http://stackoverflow.com/questions/17618707/vim-remove-non-existing-mapping?noredirect=1#comment25654399_17618707),
 and moved here as recommended.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui