Monday, August 6, 2018

Re: command when file is closed

On Monday 6 August 2018 11:30,
Dave Woodfall <dave@dawoodfall.net> put forth the proposition:
> On Saturday 4 August 2018 14:28,
> Michael Wagner <wagner_m_bremen@web.de> put forth the proposition:
> > Hello folks,
> >
> > I am on linux Debian and my signature files are handled by fortune. When
> > I add a new signature with vim, the dat file for the sigfile must also
> > be updated, to tell fortune the changes. At the moment I have an alias
> > for this
> >
> > alias vim-add-sig='vim + ~/sigs/signature + ~/sigs/signature_english && \\
> > for i in $(find ~/sigs/ -not -name "*.dat" -type f); do strfile $i; done'
> >
> > I'm sure it's possible to add the for loop in my .vimrc when I edit my
> > sigfiles, but I don't know how.
>
> :for {var} in {list}
> <do stuff>
> :endfo[r]
>
> See :help :for

Sorry, I just copy/pasted that without thinking (too early in the
am), but you don't need to prepend the : in a file.

for
..
endfor

There is also a while loop too, if you need one.

--

On a normal ascii line, the only safe condition to detect is a 'BREAK'
- everything else having been assigned functions by Gnu EMACS.
-- Tarl Neustaedter

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

--
--
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: