Fandom

Vim Tips Wiki

Insert mail signatures from a rotating file

1,624pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Tip 106 Printable Monobook Previous Next

created 2001 · complexity basic · author brz · version 6.0


By adding the following line to your vimrc, you can use a simple email signature rotator:

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

This rotator expects the user to have a file at the location C:/sign.txt with the following information:

--
first signature
--
second signature
--
third signature
--

When a user finishes an email, they may call the shortcut \ms and the 'first signature' will be inserted into the email. This will also push the first signature in C:\sign.txt to the end of the file. To change to a different signature from the one which is next in the file type u and \ms again.

The sign.txt file must employ a signature separator like the following: '-- '.

CommentsEdit

Also on Fandom

Random Wiki