1"
2" Filename: creamrc
3" Updated:  2006-10-27 07:14:16EDT
4"
5" Cream -- An easy-to-use configuration of the famous Vim text editor
6" [ http://cream.sourceforge.net ] Copyright (C) 2001-2011 Steve Hall
7"
8" License
9" GNU General Public License (GPL) {{{1
10"
11" This program is free software; you can redistribute it and/or modify
12" it under the terms of the GNU General Public License as published by
13" the Free Software Foundation; either version 3 of the License, or
14" (at your option) any later version. [
15" http://www.gnu.org/licenses/gpl.html ]
16"
17" This program is distributed in the hope that it will be useful, but
18" WITHOUT ANY WARRANTY; without even the implied warranty of
19" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20" General Public License for more details.
21"
22" You should have received a copy of the GNU General Public License
23" along with this program; if not, write to the Free Software
24" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25" 02111-1307, USA.
26"
27" 1}}}
28"
29
30" CRITICAL SETTINGS: (Don't use fold markers yet!)
31
32" nocompatible (behave like Vim, not Vi)
33set nocompatible
34
35" cpoptions (exclude characters from literal mappings)
36set cpoptions-=<
37
38" shellslash (use a common path separator across all platforms)
39" convert all backslashes to forward slashes on expanding filenames.
40" Enables consistancy in Cream between Windows and Linux platforms,
41" but BE CAREFUL! Windows file operations require backslashes--any
42" paths determined manually (not by Vim) need to be reversed.
43set shellslash
44
45" TODO: version check
46if v:version < 700
47	echo "Cream now supports only Vim 7.0 and above. Please use Cream 0.38 for older Vim versions."
48	finish
49endif
50
51let s:debug = "\n  INITIALIZATION:\n\n"
52
53" Cream_checkdir() {{{1
54function! Cream_checkdir(dir)
55" if directory doesn't exist, try to make it
56
57let s:debug = s:debug . "Cream_checkdir(): {dir} == \"" . a:dir . "\"\n"
58
59	if !isdirectory(a:dir)
60
61		let tmp = a:dir
62
63		" system call prep
64		if has("win32")
65			" remove trailing slash (Win95)
66			let tmp = substitute(tmp, '\(\\\|/\)$', '', 'g')
67			" remove escaped spaces
68			let tmp = substitute(tmp, '\ ', ' ', 'g')
69			" convert slashes to backslashes
70			let tmp = substitute(tmp, '/', '\', 'g')
71let s:debug = s:debug . "Cream_checkdir(): has(win32)\n"
72		endif
73
74		" mkdir (quote, regardless of spaces)
75		set noshellslash
76let s:debug = s:debug . "Cream_checkdir(): mkdir \"" . tmp . "\"\n"
77		call system("mkdir " . '"' . tmp . '"')
78let s:debug = s:debug . "Cream_checkdir(): mkdir   v:shell_error == \"" . v:shell_error . "\"\n"
79		set shellslash
80
81		" retest
82		if !isdirectory(tmp)
83			return -1
84		endif
85
86	endif
87
88	return 1
89
90endfunction
91
92" path initializations
93" Cream_init() ($CREAM)   $VIMRUNTIME/cream {{{1
94function! Cream_init()
95" establish $CREAM
96" o Valid value is writable:
97"   * $HOME/.cream in Linux
98"   * $VIMRUNTIME/cream/  in Windows
99" o $HOME on Windows is trouble
100"   * Doesn't exist for Win95/98/ME
101"   * May not be multi-user on WinNT/2K/XP and Cygwin setups
102" o We don't escape the value of $CREAM, since its value might be used
103"   in a shell call
104
105	" use $CREAM if present
106	if exists("$CREAM")
107
108		" accept as is
109
110let s:debug = s:debug . "Cream_init(): $CREAM exists: \n  $CREAM = " . $CREAM . "\n"
111
112	" use $VIMINIT fragment if present
113	elseif exists("$VIMINIT")
114
115let s:debug = s:debug . "Cream_init(): $VIMINIT exists.\n"
116
117		" set $CREAM to a subdirectory below *this* file
118		" remove initial 'source '
119		let $CREAM = strpart($VIMINIT, 7)
120		" if first 7 chars don't equal "source ", quit
121		if strpart($VIMINIT, 0, 7) !=? "source "
122			echo "---------------------------------------------------------------------"
123			echo " WARNING! First 7 chars of $VIMINIT isn't \"source \""
124			echo "   $VIMINIT = " . $VIMINIT
125			echo "   $CREAM   = " . $CREAM
126			echo "---------------------------------------------------------------------"
127			let $CREAM = ""
128let s:debug = s:debug . "Cream_init(): $VIMINIT first seven chars don't match.\n"
129			return -1
130		endif
131		" expand full path, minus filename head
132		"let $CREAM = fnamemodify(expand($VIMINIT), ":p:h")
133		let $CREAM = fnamemodify(expand($CREAM), ":p:h")
134		" add cream sub-directory
135		if     filewritable($CREAM . "/cream") == 2
136			let $CREAM = $CREAM . "/cream/"
137		elseif filewritable($CREAM . "/.cream") == 2
138			let $CREAM = $CREAM . "/.cream/"
139		else
140			" error?
141		endif
142
143let s:debug = s:debug . "Cream_init(): $CREAM: " . $CREAM . "\n"
144
145	" defaults
146	else
147
148		" convert all backslashes to forward slashes on Windows
149		if has("win32")
150
151			let $CREAM = $VIMRUNTIME . "/cream/"
152			" get rid of path spaces
153			if v:version >= 602
154				let $CREAM = fnamemodify($CREAM, ":8")
155			endif
156			" change backslashes to slashes
157			let $CREAM = substitute($CREAM, '\', '/', "g")
158			" fix UNC servername
159			let $CREAM = substitute($CREAM, '^//', '\\', "g")
160
161			""*** DEBUG: fallback
162			"if filewritable($CREAM) != 2
163			"    let $CREAM = $VIMRUNTIME . "/cream/"
164			"endif
165			""***
166let s:debug = s:debug . "Cream_init(): (no envvars): has(win32):\n  $CREAM = " . $CREAM . "\n"
167
168		else
169			let $CREAM = $VIMRUNTIME . "/cream/"
170let s:debug = s:debug . "Cream_init(): (no envvars): !has(win32): \n  $CREAM = " . $CREAM . "\n"
171		endif
172
173	endif
174
175	" return error if $CREAM doesn't exist
176	if !exists("$CREAM")
177let s:debug = s:debug . "Cream_init(): no $CREAM discovered.\n"
178		return -1
179	endif
180
181	" ensure trailing slash
182	if $CREAM !~ '/$' && $CREAM !~ '\$'
183		if has("win32") || has("dos32") || has("win16") || has("dos16") || has("win95")
184			let $CREAM = $CREAM . '\'
185		else
186			let $CREAM = $CREAM . '/'
187		endif
188	endif
189
190endfunction
191
192" Cream_init_userdir()    ~/.cream {{{1
193function! Cream_init_userdir()
194" Set g:cream_user by finding or creating a location for user files.
195
196	let mydir = ""
197	let s:debug = s:debug . "Cream_init_userdir(): begin...\n"
198
199	" environment var
200	if exists("$CREAM_USER")
201		if s:Cream_init_userdir_try($CREAM_USER)
202			let s:debug = s:debug . "Cream_init_userdir(): using $CREAM_USER.\n"
203		else
204			echo "    $CREAM_USER not a valid pathfor user files failed, trying defaults..."
205		endif
206	endif
207
208	if has("win32")
209		" <0.38 migration: We test if $HOMEDRIVE$HOMEPATH exists
210		" BEFORE attempting to create it. If it does NOT exist, we try
211		" $USERPROFILE before coming back to try it again.
212"		if     s:Cream_init_userdir_try(fnamemodify($HOMEDRIVE . $HOMEPATH, ":p"))
213		let mydir = fnamemodify($HOMEDRIVE . $HOMEPATH, ":p") . "/.cream"
214		if isdirectory(mydir)
215		\ && filewritable(mydir) == 2
216		\ && s:Cream_init_userdir_try(fnamemodify($HOMEDRIVE . $HOMEPATH, ":p"))
217				let s:debug = s:debug . "Cream_init_userdir(): has(win32): $HOMEDRIVE and $HOMEPATH used.\n"
218
219		elseif     s:Cream_init_userdir_try(fnamemodify($USERPROFILE, ":p"))
220			let s:debug = s:debug . "Cream_init_userdir(): has(win32): $USERPROFILE used.\n"
221		elseif  s:Cream_init_userdir_try(fnamemodify($HOMEDRIVE . $HOMEPATH, ":p"))
222			let s:debug = s:debug . "Cream_init_userdir(): has(win32): $HOMEDRIVE and $HOMEPATH used.\n"
223		" Vim always discovers $HOME, even on Win95 without one declared!!
224		elseif s:Cream_init_userdir_try(fnamemodify($HOME, ":p"))
225			let s:debug = s:debug . "Cream_init_userdir(): has(win32): $HOME used.\n"
226		" fallback (Win95)
227		elseif s:Cream_init_userdir_try(fnamemodify($CREAM, ":p"))
228			let s:debug = s:debug . "Cream_init_userdir(): has(win32): $CREAM used.\n"
229		else
230			" fails by here
231		endif
232	else
233		call s:Cream_init_userdir_try($HOME)
234		let s:debug = s:debug . "Cream_init_userdir(): !has(win32): $HOME used.\n"
235	endif
236
237	" verify
238	if !exists("g:cream_user")
239		let s:debug = s:debug . "ERROR: Cream_init_userdir(): g:cream_user not found.\n\n"
240		return -1
241	elseif filewritable(g:cream_user) != 2
242		let s:debug = s:debug . "ERROR: Cream_init_userdir(): g:cream_user (\"" . g:cream_user . "\") path not writable.\n\n"
243		return -1
244	else
245		let s:debug = s:debug . "Cream_init_userdir(): g:cream_user == \"" . g:cream_user . "\"\n"
246	endif
247
248endfunction
249
250" s:Cream_init_userdir_try() {{{1
251function! s:Cream_init_userdir_try(path)
252" Test {path} exists, process, create/use /.cream/ sub if so.
253
254	" stop if already defined
255	if exists("g:cream_user")
256		let s:debug = s:debug . "  s:Cream_init_userdir_try(): g:cream_user already exists, skipping \"" . a:path . "\".\n"
257		return
258	endif
259
260	" test root path
261	if filewritable(a:path) == 2
262		let s:debug = s:debug . "  s:Cream_init_userdir_try(): tested \"" . a:path . "\" exists and writable.\n"
263	elseif isdirectory(a:path)
264		let s:debug = s:debug . "  s:Cream_init_userdir_try(): tested \"" . a:path . "\" exists, but not writable.\n"
265		return
266	else
267		let s:debug = s:debug . "  s:Cream_init_userdir_try(): tested \"" . a:path . "\" doesn't exist.\n"
268		return
269	endif
270
271	let mydir = a:path
272
273	" process
274	" simplify if possible
275	if has("win32")
276		if v:version >= 602
277			let mydir = fnamemodify(mydir, ":8")
278			let s:debug = s:debug . "  s:Cream_init_userdir_try(): has(win32): fnamemodify(mydir, \":8\") == \"" . mydir . "\"\n"
279		endif
280	endif
281	" remove trailing slash (such as Win95 "C:\")
282	let mydir = substitute(mydir, '\(\\\|/\)$', '', 'g')
283
284	" add .cream/ and try to make it
285	let mydir = mydir . '/.cream/'
286	if !Cream_checkdir(mydir)
287		let s:debug = s:debug . "  s:Cream_init_userdir_try(): processed and \"/.cream/\" appended path \"" . mydir . "\" not made.\n"
288		return
289	endif
290
291	" process g:cream_user to Vim format
292	let g:cream_user = mydir
293	if has("win32")
294		" convert backslashes to slashes
295		let g:cream_user = escape(substitute(g:cream_user, '\', '/', 'g'), ' \')
296		" escape any spaces or backslashes remaining
297		let g:cream_user = escape(g:cream_user, ' \')
298	endif
299
300	let s:debug = s:debug . "  s:Cream_init_userdir_try(): g:cream_user set to \"" . g:cream_user . "\"\n"
301	return 1
302
303endfunction
304
305" Cream_init_viewdir()    ~/.cream/views {{{1
306function! Cream_init_viewdir()
307" file view retainage
308
309	if exists("$CREAM_VIEW")
310	\&& filewritable($CREAM_VIEW) == 2
311
312		execute "set viewdir=" . escape($CREAM_VIEW, ' \')
313let s:debug = s:debug . "Cream_init_viewdir(): good $CREAM_VIEW found: &viewdir: " . &viewdir . "\n"
314
315	" default
316	else
317
318		" (remember, g:cream_user is simplified and escaped)
319		let mydir = g:cream_user . "views"
320
321let s:debug = s:debug . "Cream_init_viewdir(): no $CREAM_VIEW found: mydir: " . mydir . "\n"
322
323		" if directory doesn't exist, try to make it
324		call Cream_checkdir(mydir)
325
326		if filewritable(mydir) == 2
327			" we set a script global, only so viminfo (following) can
328			" use it
329			let s:cream_views = mydir
330			execute "set viewdir=" . mydir
331let s:debug = s:debug . "Cream_init_viewdir(): no $CREAM_VIEW found: &viewdir: " . &viewdir . "\n"
332
333		else
334			" failure
335let s:debug = s:debug . "Cream_init_viewdir(): no $CREAM_VIEW found: mydir not writable.\n"
336			return -1
337		endif
338
339	endif
340
341endfunction
342
343" Cream_init_viminfo()    ~/.cream/views {{{1
344function! Cream_init_viminfo()
345" setting/history/etc. file location
346
347	" execute statement (everything but path)
348	" \"100 escaped twice: once for itself, once for the quote
349	let myviminfo = "set viminfo='500,\\\"100,%,!,h,n"
350
351	" $CREAM_VIEW
352	if exists("$CREAM_VIEW")
353	\&& filewritable($CREAM_VIEW) == 2
354
355		execute myviminfo . escape($CREAM_VIEW, ' \') . "/.viminfo"
356
357	" default
358	else
359
360		execute myviminfo . s:cream_views . "/.viminfo"
361
362	endif
363
364	" must exist (directory has already been tested and is writable)
365
366endfunction
367
368" Cream_init_spelldicts() ~/.cream/spelldicts {{{1
369function! Cream_init_spelldicts()
370" backup file location
371
372	" (remember, g:cream_user is simplified and escaped)
373	let mydir = g:cream_user . "spelldicts"
374
375	" if directory doesn't exist, try to make it
376	call Cream_checkdir(mydir)
377
378	if filewritable(mydir) != 2
379let s:debug = s:debug . "Cream_init_spelldicts(): directory not made: mydir: " . mydir . "\n"
380		return -1
381	endif
382
383endfunction
384
385" Cream_init_backupdir()  ~/.cream/tmp {{{1
386function! Cream_init_backupdir()
387" backup file location
388
389	let prior = ""
390
391	" $CREAM_BAK (environmental variable)
392	if exists("$CREAM_BAK")
393	\&& filewritable($CREAM_BAK) == 2
394
395		let prior = $CREAM_BAK
396let s:debug = s:debug . "Cream_init_backupdir(): good $CREAM_BAK: prior: " . prior . "\n"
397
398	" default
399	else
400
401
402		" (remember, g:cream_user is simplified and escaped)
403		let mydir = g:cream_user . "tmp"
404
405let s:debug = s:debug . "Cream_init_backupdir(): no $CREAM_BAK: mydir: " . mydir . "\n"
406
407		" if directory doesn't exist, try to make it
408		call Cream_checkdir(mydir)
409
410		if filewritable(mydir) != 2
411let s:debug = s:debug . "Cream_init_backupdir(): mydir not writable: mydir: " . mydir . "\n"
412			return -1
413		else
414			let prior = mydir
415		endif
416
417	endif
418
419	" append comma to default if non-empty
420	if prior != ""
421		let prior = prior . ","
422	endif
423
424	" set
425	execute "set backupdir=" . prior . "./bak,."
426
427endfunction
428
429" Cream_init_directory()  ./  (swap files) {{{1
430function! Cream_init_directory()
431" swap file location
432" (Always with file to avoid overwritten by second user)
433
434	if exists("$CREAM_SWP")
435	\&& filewritable($CREAM_SWP) == 2
436		" use variable
437		execute "set directory=" . $CREAM_SWP . ",."
438let s:debug = s:debug . "Cream_init_directory(): $CREAM_SWP found: &directory: " . &directory . "\n"
439	else
440		execute "set directory=."
441let s:debug = s:debug . "Cream_init_directory(): no $CREAM_SWP: &directory: " . &directory . "\n"
442	endif
443
444endfunction
445
446" 1}}}
447" loader
448" Cream() {{{1
449function! Cream()
450" load the project
451" * return 1 on load, -1 on fatal error, 2 on terminal abort
452
453	" initialize (once--note behave module may try again ;)
454	if !exists("g:cream_init")
455
456		" $CREAM
457		let init = Cream_init()
458let s:debug = s:debug . "Cream(): Cream_init(): init: " . init . "\n\n"
459		if init == -1
460			echo "\n Error: Unable to find Cream installation.\n"
461			return -1
462		endif
463
464		"" vi behavior should stop here (but still can't read globals)
465		"if exists("g:CREAM_BEHAVE")
466		"    if g:CREAM_BEHAVE ==? "vi"
467		"        return 1
468		"    endif
469		"endif
470
471		" g:cream_user
472		let init = Cream_init_userdir()
473let s:debug = s:debug . "Cream(): Cream_init_userdir() == " . init . "\n\n"
474		if init == -1
475			echo "\n Error: Unable to find a location for user files.\n"
476			return -1
477		endif
478
479		" &viewdir
480		let init = Cream_init_viewdir()
481let s:debug = s:debug . "Cream(): Cream_init_viewdir(): init: " . init . "\n\n"
482		if init == -1
483			echo "\n Error: Unable to find a location for view files.\n"
484			return -1
485		endif
486
487		" spelldicts
488		let init = Cream_init_spelldicts()
489let s:debug = s:debug . "Cream(): Cream_init_spelldicts(): init: " . init . "\n\n"
490		if init == -1
491			echo "\n Error: Unable to find a location for spell dictionaries.\n"
492			return -1
493		endif
494
495		" these are automatic
496		call Cream_init_viminfo()
497		call Cream_init_backupdir()
498		call Cream_init_directory()
499		let g:cream_init = 1
500
501	endif
502
503	""*** BROKEN: vim behavior should stop here, but still can't read
504	""            globals so it doesn't.
505	"if exists("g:CREAM_BEHAVE")
506	"    if g:CREAM_BEHAVE ==? "vim"
507	"        return 1
508	"    endif
509	"endif
510	""***
511
512""*** DEBUG:
513"" as loading...
514"echo "---------------------------------------------------------------------"
515"echo " DEBUG: "
516"echo "   $VIMINIT    = " . $VIMINIT
517"echo "   $CREAM      = " . $CREAM
518"echo "   &viewdir    = " . &viewdir
519"echo "   &viminfo    = " . &viminfo
520"echo "   &backupdir  = " . &backupdir
521"echo "   &directory  = " . &directory
522"echo "---------------------------------------------------------------------"
523"
524"" one line paste-in
525"echo "\n $CREAM = " . $CREAM . "\n &viewdir = " . &viewdir . "\n &viminfo = " . &viminfo . "\n &backupdir = " . &backupdir . "\n &directory = " . &directory . "\n"
526"
527""***
528
529let s:debug = s:debug . "Cream():\n"
530let s:debug = s:debug . "   $VIMINIT    = " . $VIMINIT . "\n"
531let s:debug = s:debug . "   $CREAM      = " . $CREAM . "\n"
532let s:debug = s:debug . "   &viewdir    = " . &viewdir . "\n"
533let s:debug = s:debug . "   &viminfo    = " . &viminfo . "\n"
534let s:debug = s:debug . "   &backupdir  = " . &backupdir . "\n"
535let s:debug = s:debug . "   &directory  = " . &directory . "\n"
536
537	" load the loader
538
539" *** Note: Uncomment this line to abort loading ***
540"finish
541
542	if filereadable($CREAM . "cream.vim") > 0
543let s:debug = s:debug . "Cream(): loader found.\n"
544		execute "source " . $CREAM . "cream.vim"
545	else
546let s:debug = s:debug . "Cream(): loader not found.\n"
547		echo "\n Error: Unable to find Cream loader.\n"
548		return -1
549	endif
550
551	return 1
552
553endfunction
554
555" 1}}}
556" debugging
557" Cream_debug_info_local() {{{1
558function! Cream_debug_info_local()
559" modularize Cream debug info
560	return s:debug
561endfunction
562
563	" Cream_debug_info() {{{1
564function! Cream_debug_info()
565" Return system, Vim and Cream info.
566
567	call confirm(
568		\ "Debugging Cream startup. This may take a few seconds...\n" .
569		\ "\n", "&Ok", 1, "Info")
570
571	" utility functions
572	function! <SID>CheckDir(n)
573		if isdirectory(a:n)
574			echo 'directory "' . a:n . '" exists'
575		else
576			echo 'directory "' . a:n . '" does NOT exist'
577		endif
578	endfunction
579	function! <SID>CheckFile(n)
580		if filereadable(a:n)
581			echo '"' . a:n . '" is readable'
582		else
583			echo '"' . a:n . '" is NOT readable'
584		endif
585	endfunction
586
587	" collect initialization debugging info, too.
588	let tmp = Cream_debug_info_local()
589	let tmp = tmp . "\n  POST INITIALIZATION:\n"
590
591	" Cream debug info on @x (silent call this to avoid echo)
592    silent call s:Cream_debug_info_get()
593    let tmp = tmp . @x
594    let @x = ""
595
596	delfunction <SID>CheckDir
597	delfunction <SID>CheckFile
598
599	return tmp
600
601endfunction
602
603" s:Cream_debug_info_get() {{{1
604function! s:Cream_debug_info_get()
605" Place Cream debug info into @x.
606" Note: This value is placed in register rather than returned
607"       so that it isn't echoed by the calling function.
608
609	let @x = ""
610	redir @x
611
612	let mymore = &more
613	set nomore
614
615	echo "Report generated: " . strftime("%Y-%m-%dT%H:%M:%S")
616
617	" system info
618	echo "\nSystem Info ----------------------------------------------------- {{" . nr2char(123) . "1\n"
619	if has("unix")
620		echo system("uname -a")
621	endif
622
623    let myshellslash = &shellslash
624    set noshellslash
625	silent! echo system("set")
626    let &shellslash = myshellslash
627
628	" vim version info
629	echo "\nVersion --------------------------------------------------------- {{" . nr2char(123) . "1\n"
630	version
631
632	" current session arguments
633	echo "\nArguments ------------------------------------------------------- {{" . nr2char(123) . "1\n"
634	args
635
636	" paths, files and directories
637	echo "\nDirectories and Files ------------------------------------------- {{" . nr2char(123) . "1\n"
638	echo '$VIM = "' . $VIM . '"'
639	call <SID>CheckDir($VIM)
640	echo '$VIMRUNTIME = "' . $VIMRUNTIME . '"'
641	call <SID>CheckDir($VIMRUNTIME)
642	call <SID>CheckFile(&helpfile)
643	call <SID>CheckFile(fnamemodify(&helpfile, ":h") . "/tags")
644	call <SID>CheckFile($VIMRUNTIME . "/menu.vim")
645	call <SID>CheckFile($VIMRUNTIME . "/filetype.vim")
646	call <SID>CheckFile($VIMRUNTIME . "/syntax/synload.vim")
647
648	" settings
649	echo "\nSettings -------------------------------------------------------- {{" . nr2char(123) . "1\n"
650	set all
651	set termcap
652
653	" autocommands
654	if has("autocmd")
655		echo "\nAutocommands ------------------------------------------------ {{" . nr2char(123) . "1\n"
656		autocmd
657	endif
658
659	" mappings
660	echo "\nMappings -------------------------------------------------------- {{" . nr2char(123) . "1\n"
661	echo "\nNormal mode mappings -------------------------------------------- {{" . nr2char(123) . "2\n"
662	nmap
663	echo "\nVisual mode mappings -------------------------------------------- {{" . nr2char(123) . "2\n"
664	vmap
665	echo "\nInsert mode mappings -------------------------------------------- {{" . nr2char(123) . "2\n"
666	imap
667	echo "\nCommand-line mode mappings -------------------------------------- {{" . nr2char(123) . "2\n"
668	cmap
669	echo "\n  2}}" . nr2char(125) . "\n"
670
671	" abbreviations
672	echo "\nAbbreviations --------------------------------------------------- {{" . nr2char(123) . "1\n"
673	abbreviate
674
675	" highlighting
676	echo "\nHighlighting ---------------------------------------------------- {{" . nr2char(123) . "1\n"
677	highlight
678
679	" variables
680	echo "\nVariables ------------------------------------------------------- {{" . nr2char(123) . "1\n"
681	let
682
683	" Cream info
684	echo "\nCream ----------------------------------------------------------- {{" . nr2char(123) . "1\n"
685	if exists("g:cream_version") | echo "g:cream_version = " . g:cream_version | else | echo "no g:cream_version" | endif
686	if exists("g:cream_version_str") | echo "g:cream_version_str = " . g:cream_version_str | else | echo "no g:cream_version_str" | endif
687	if exists("g:cream_updated") | echo "g:cream_updated = " . g:cream_updated | else | echo "no g:cream_updated" | endif
688    if exists("g:cream_dev") | echo "g:cream_dev = " . g:cream_dev | else | echo "no g:cream_dev" | endif
689	if exists("g:cream_mail") | echo "g:cream_mail = " . g:cream_mail | else | echo "no g:cream_mail" | endif
690
691	echo "\n$VIM/*"
692	echo globpath($VIM, "*")
693
694	echo "\n$VIMRUNTIME/*"
695	echo globpath($VIMRUNTIME, "*")
696
697	echo "\n$CREAM/*"
698	echo globpath($CREAM, "*")
699	echo "\n$CREAM/addons/*"
700	echo globpath($CREAM, "addons/*")
701	echo "\n$CREAM/bitmaps/*"
702	echo globpath($CREAM, "bitmaps/*")
703
704	echo "\n  1}}" . nr2char(125) . "\n"
705	echo "\n  vim:foldmethod=marker\n"
706	redir END
707
708	let &more = mymore
709
710    " Note: @x contains this function's return value info at this
711    " point. (See header note for explanation.)
712
713endfunction
714
715" 1}}}
716
717call Cream()
718
719" vim:filetype=vim:foldmethod=marker
720