Wikia

Vim Tips Wiki

Changes: User:Tonymec/zzsplash.vim

Edit

Back to page

m (See also)
(The code: email + new "Notes" section)
 
Line 7: Line 7:
 
" Name: zzsplash.vim
 
" Name: zzsplash.vim
 
" Version: 0.1
 
" Version: 0.1
" Maintainer: Tony Mechelynck <antoine.mechelynck@skynet.be>
+
" Maintainer: Tony Mechelynck <antoine.mechelynck@gmail.com>
" Last Change: Wed 30 Aug 2006
+
" Last Change: Tue 04 Aug 2009
 
"
 
"
 
" Installation instructions: Just drop it in the after/plugin subdirectory of
 
" Installation instructions: Just drop it in the after/plugin subdirectory of
Line 41: Line 41:
 
" In that case we haven't done anything yet.
 
" In that case we haven't done anything yet.
 
intro
 
intro
  +
</pre>
  +
  +
==Notes==
  +
If you copy the above section to (e.g.) $VIM/vimfiles/after/plugin/zzsplash.vim, beware of the following:
  +
* If the <nowiki><pre> and </pre></nowiki> tags were copied at the start and end of the text, remove them;
  +
* The following ''a posteriori'' edits are necessary to "interpret" HTML entities left in the text when copying from the wiki page:
  +
<pre>
  +
:%s/&amp;amp;/\&/g " change &amp;amp; to &
  +
:%s/&amp;lt;/</g " change &amp;lt; to <
  +
:%s/&amp;gt;/>/g " change &amp;gt; to >
  +
:%s/\%xA0/ /g " change literal no-break space to ordinary space
 
</pre>
 
</pre>
   

Latest revision as of 20:40, August 4, 2009

This is a "global plugin" which I use to try to make Vim's "splash screen" appear at the end of startup even in circumstances when Vim usually doesn't display it.

The codeEdit

" Custom global plugin to display the Vim splash screen
" even when started with one or more editfiles.
"
" Name:			zzsplash.vim
" Version:		0.1
" Maintainer:		Tony Mechelynck <antoine.mechelynck@gmail.com>
" Last Change:		Tue 04 Aug 2009
"
" Installation instructions: Just drop it in the after/plugin subdirectory of
" the directory named last in the 'runtimepath' option.

" This plugin intentionally has a name starting in "zz" so the VimEnter
" autocommand which it creates (below) is run as late as possible at the end
" of startup.


" The :intro command did not exist prior to version 5.
if version < 500
  finish
endif
" If there is no loaded buffer, we can let Vim do it.
" But the function we need was only defined in version 5.1
" (or under another name starting at 5.2, but the older name
" was retained).
if (version >= 501) && (buffer_name("") == "")
  finish
endif
" The VimEnter event was introduced in version 5.1
" Only define an autocommand if it is available
if has("autocmd") && (version >= 501)
  augroup zzsplash
    au VimEnter * intro
  augroup END
  finish
endif
" come here only if the current Vim was compiled with -eval
" or if it does not possess the VimEnter event.
" In that case we haven't done anything yet.
intro

NotesEdit

If you copy the above section to (e.g.) $VIM/vimfiles/after/plugin/zzsplash.vim, beware of the following:

  • If the <pre> and </pre> tags were copied at the start and end of the text, remove them;
  • The following a posteriori edits are necessary to "interpret" HTML entities left in the text when copying from the wiki page:
:%s/&amp;/\&/g                   " change &amp; to &
:%s/&lt;/</g                     " change &lt;  to <
:%s/&gt;/>/g                     " change &gt;  to >
:%s/\%xA0/ /g                    " change literal no-break space to ordinary space

See alsoEdit

CommentsEdit

Please add comments and questions about the above plugin here, not on the talk page, sign them by ~~~~ and separate unrelated entries by ----. — Tonymec 14:15, 3 August 2009 (UTC)


Around Wikia's network

Random Wiki