32804Re: execute commands in macros based on key mappings
- Oct 1, 2002On Tue, 1 Oct 2002, Lukas Ruf wrote:
> Since not everyone follows the rules for writing emails properly (asLook into :help silence
> mentioned for example on Sven's home page), the execution of macros
> fails if anything cannot be found.
> Is there a way such that I can get vim neglect the result of a command
> (like search-backwards) and get the execution of all the macros being
> carried out irrespective of whether one command fails.
And/or use if statements. Here is my function:
exe "normal! /^$\<CR>ma"
if search("^> ---*$", "bw")
if getline('.') =~ "--$"
exe "normal! o ^ You have bad sig delimiter. Insert space after '--'.\<cr>"
exe "normal! VGd'az\<cr>"
search() dies gracefully when string is not detected.
- << Previous post in topic Next post in topic >>