Wednesday, June 24, 2015

Re: vim replace a string when a change occurred in another place

On 23.06.15 23:56, Rudra Banerjee wrote:
> Erik,
> Thanks for you comment....but it is solved. Now, another important
> thing....how to invoke it! Is it possible to have something like this:
>
> if (getline(".")) startswith "Program" au CursorMovedI call EdName()
>
> i.e. calling a autocmd conditionally possible?

One way is to add an extension to "Program" filenames, and then just use
the standard method described at ":h au". If you find that depressingly
M$-ish, then I'm forced to agree. The alternative of placing all the
files in one or a few directories, for detection by the pattern, may be
preferable.

Sadly, maddeningly, Vim's modelines only allow "set" commands, AFAICT.
That would otherwise be a delightfully elegant solution. (Though
doubtless not without security concerns, admittedly.)

Erik

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: