Loading ...
Sorry, an error occurred while loading the content.

113680Vim and pseudorandom mail signatures (Was: Top/End of file not active with Ctrl-Home/Ctrl-End with vim on a gnome terminal)

Expand Messages
  • Tony Mechelynck
    Apr 9, 2010
      On 17/02/10 14:41, Jean Johner wrote:
      > I am delighted by Tony's foot citations. Each time different.
      > Regards.

      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.
      function Fortune()
      " 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.
      if !exists("g:FORTUNE")
      let g:FORTUNE = 0
      if !exists("g:FORTUNECYCLE")
      let g:FORTUNECYCLE = 5
      if !exists("s:sysFortunes")
      let s:sysFortunes =
      \ (system("which fortune") != "") && (!v:shell_error)
      if !exists("s:bramFortunes")
      let s:bramFortunes =
      \ filereadable(expand("~/fortunes.txt"))
      if s:sysFortunes && (g:FORTUNE || (!s:bramFortunes))
      let @+ = "-- \n" . system("fortune -a")
      elseif s:bramFortunes
      new ~/fortunes.txt
      silent 1;/^-- $/-1d +
      $put +
      let @+ = ""
      let g:FORTUNE = g:FORTUNE + 1
      let g:FORTUNE = 0
      return @+
      map <F5> :echo Fortune()<CR>
      if &vi !~ '!'
      set vi^=! " insert in front
      " to avoid clobbering ,n<filename>
      " which must be last

      Best regards,
      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
    • Show all 7 messages in this topic