sponsor Vim development Vim logo Vim Book Ad

basic Tip #106: Mail signature rotation: Supersimple one-line solution

 tip karma   Rating 0/4, Viewed by 998 

created:   September 3, 2001 22:21      complexity:   basic
author:   brz*      as of Vim:   6.0

Hallo,
next solution for _most_simple_ signature rotater:
You can only put one line to your .vimrc || _vimrc:
map <Leader>ms :e c:\sign.txt<CR>ggV/--<CR>k"*xG$a<C-R><C-O>*<Esc>:w<CR>:bd<CR>G$a<C-M><Esc>"*P

Must exist file (from eg above) c:\sign.txt, with content:
--
first signature
--
second signature
--
third signature
--

When You finished mail, only call shortcut \ms and 'first signature' will be insert in your mail. In c:\sign.txt will be first signature pushed to the end of this file. When You want use other signature, only press 'u' and \ms again
(Or You can change \ms to e.g. <F12>, indeed. ) You can change this and append one part like 'basic' from command and append 'changing' part from .signature file, as you like...
Ok, one unpleasant thing is here: your signature must not contain '--' (signature separator)...
Anyhow, I find it useful
brz* <[email protected]>
http://brz.d2.cz/

 rate this tip  Life Changing Helpful Unfulfilling 

<<combining move and scroll | C/C++: convert enum to string table >>

Additional Notes

[email protected], September 5, 2001 6:59
The official signature separator is '-- ' (i.e. dash dash space.) It would be better to use that in the expression and the signature file.
[email protected], January 9, 2002 6:41
And also a patch could be not to search --, but ^--$, then you can have -- in your signature.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo