113680Vim and pseudorandom mail signatures (Was: Top/End of file not active with Ctrl-Home/Ctrl-End with vim on a gnome terminal)
- Apr 9, 2010
On 17/02/10 14:41, Jean Johner wrote:
> I am delighted by Tony's foot citations. Each time different.
I use Vim (compiled with +clipboard, +viminfo and +windows) to generate
them, with the help of:
- a file of funny signatures from Bram's site, modified (IIRC) so that
each individual sig starts with a "dash-dash-space" separator
- the GNU "fortune" program
Both of these are optional, but if neither is present then of course no
funny signatures will be generated.
Here's the relevant snippet from my vimrc; I don't notice the
open-and-shut auxiliary window except by the disappearance of any
|more-prompt| that may be present beforehand.
if has('clipboard') && has('viminfo') && has('windows')
" the above tests if Vim has clipboard support _compiled-in_
" we should actually test if the clipboard is _available_
" but that is a non-obvious thing on Unix Vim in console mode.
" In order to remember them in the viminfo,
" the first two variables defined below
" must have names starting with an uppercase letter
" and containing no lowercase letters.
let g:FORTUNE = 0
let g:FORTUNECYCLE = 5
let s:sysFortunes =
\ (system("which fortune") != "") && (!v:shell_error)
let s:bramFortunes =
if s:sysFortunes && (g:FORTUNE || (!s:bramFortunes))
let @+ = "-- \n" . system("fortune -a")
silent 1;/^-- $/-1d +
let @+ = ""
let g:FORTUNE = g:FORTUNE + 1
if g:FORTUNE >= g:FORTUNECYCLE
let g:FORTUNE = 0
map <F5> :echo Fortune()<CR>
if &vi !~ '!'
set vi^=! " insert in front
" to avoid clobbering ,n<filename>
" which must be last
The Advertising Agency Song:
When your client's hopping mad,
Put his picture in the ad.
If he still should prove refractory,
Add a picture of his factory.
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
- << Previous post in topic