Vim Tips Wiki
Advertisement
Tip 106 Printable Monobook Previous Next

created September 3, 2001 · complexity basic · author brz · version 6.0


Next solution for _most_simple_ signature rotater: You can only put one line to your .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)...

Comments

The official signature separator is '-- ' (i.e. dash dash space.) It would be better to use that in the expression and the signature file.


Advertisement