1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
*unite-outline.txt*	outline source for unite.vim

Author  : h1mesuke <himesuke@gmail.com>
          Shougo <Shougo.Matsu at gmail.com>
Updated : 2012-01-11
Version : 0.5.1
License : MIT license {{{

	Permission is hereby granted, free of charge, to any person obtaining
	a copy of this software and associated documentation files (the
	"Software"), to deal in the Software without restriction, including
	without limitation the rights to use, copy, modify, merge, publish,
	distribute, sublicense, and/or sell copies of the Software, and to
	permit persons to whom the Software is furnished to do so, subject to
	the following conditions:
	The above copyright notice and this permission notice shall be
	included in all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
	EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
	MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
	IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
	CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
	TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
	SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}

CONTENTS				*unite-outline-contents*

	Introduction		|unite-outline-introduction|
	Install			|unite-outline-install|
	Usage			|unite-outline-usage|
	Settings		|unite-outline-settings|
	  Variables		  |unite-outline-variables|
	  Example		  |unite-outline-settings-example|
	Outline Info		|unite-outline-info|
	  Create Outline Info	  |unite-outline-info-create|
	  Attributes		  |unite-outline-info-attributes|
	  External Programs	  |unite-outline-info-external-programs|
	Functions		|unite-outline-functions|
	  Utility Functions	  |unite-outline-utility-functions|
	ToDo			|unite-outline-todo|
	Known Issues		|unite-outline-known-issues|
	ChangeLog		|unite-outline-changelog|

==============================================================================
INTRODUCTION				*unite-outline-introduction*

	*unite-outline* is a |unite|'s source which provides your Vim's buffer
	with the outline view. It parses the current buffer's content and
	extracts headings from the buffer. And then it shows the list of the
	headings using unite.vim's interface. When you select a heading from
	the list, you can jump to the corresponding location in the buffer.

	The methods for extracting headings can be implemented for each
	individual filetypes. You can customize them as you like with Vim
	script and can also create new ones for unsupported filetypes.

==============================================================================
INSTALL					*unite-outline-install*

	Install the distributed files into your Vim script directory which is
	usually $HOME/.vim, or $HOME/vimfiles on Windows.

	You can show the heading list of the current buffer with ":Unite
	outline" command if you succeeded the installation (and unite-outline
	supports the filetype of the buffer).


	C, C++, Java, etc~

		* Exuberant Ctags (Required)
		  http://ctags.sourceforge.net/

==============================================================================
USAGE					*unite-outline-usage*

SHOW HEADINGS ~

	To show the heading list of the current buffer, execute |:Unite|
	command with "outline" as a source parameter.
>
	:Unite outline
<
	unite-outline parses the current buffer's content and extracts
	headings from the buffer. And then it shows the list of the headings
	using unite.vim's interface. When you select a heading from the list,
	you can jump to the corresponding location in the buffer.

	In most cases, extracted headings are cached. Because unite-outline
	reuses the cached data as possible, subsequent extraction for the
	buffer will get much faster than the first time.

FILTER HEADINGS ~

	See |unite-usage|.

UPDATE HEADINGS ~

	If you want to forcefully update the heading list discarding the
	cached data, execute ":Unite outline" command with "!" as an outline
	source's parameter.
>
	:Unite outline:!
<
	Or, execute |<Plug>(unite_redraw)|, which is mapped to <C-l> by
	default, at the heading list in Normal mode.

	NOTE: From version 0.5.0, unite-outline updates headings automatically.
	See |unite-outline-filetype-option-auto-update| .

==============================================================================
SETTINGS				*unite-outline-settings*

------------------------------------------------------------------------------
VARIABLES				*unite-outline-variables*

	g:unite_source_outline_info	*g:unite_source_outline_info*

		Dictionary of outline infos.
		If you define an outline info on your vimrc, register the
		outline info to this Dictionary. Otherwise, you don't need to
		use it at all.

		See |unite-outline-info|, |unite-outline-info-create|.

		Default value is {}.

		Because all of the default outline infos, which have been
		included in the distributed archive, will be loaded by
		autoload functions later on demand, the initial value of this
		dictionary is empty.

				*g:unite_source_outline_indent_width*
	g:unite_source_outline_indent_width

		Indent width used in heading lists.

		Default value is 2.

				*g:unite_source_outline_filetype_options*
	g:unite_source_outline_filetype_options

		Dictionary of filetype specific options.

		You can configure filetype specific options for a filetype by
		giving a Dictionary, that consists of option-value pairs, to
		this variable with the filetype as a key.

		The generic filetype "*", that means all filetypes,  is
		available. If a filetype has no value for an option, the value
		of "*" for the option is applied.

		Default value is {}

		Example: >
		let g:unite_source_outline_filetype_options = {
		      \ '*': {
		      \   'auto_update': 1,
		      \   'auto_update_event': 'write',
		      \ },
		      \ 'cpp': {
		      \   'auto_update': 0,
		      \ },
		      \ 'javascript': {
		      \   'ignore_types': ['comment'],
		      \ },
		      \ 'markdown': {
		      \   'auto_update_event': 'hold',
		      \ },
		      \}
<
		FILETYPE OPTIONS ~

		auto_update	*unite-outline-filetype-option-auto-update*

			Whether unite-outline update headings automatically or
			not.

			Default value is 1.

			*unite-outline-filetype-option-auto-update-event*
		auto_update_event

			Event that triggers the auto-update of headings.
			One of the followings.

				Value		Trigger(s)
				--------------------------------------------
				"write"		|BufWritePost|
				"hold"		|BufWritePost|, |CursorHold|

			Default value is "write".

			NOTE: Headings are updated only when the buffer has
			been changed since the last update. If you choice
			"hold" as "auto_update_event", the interval of updates
			is specified by 'updatetime'.

		ignore_types	*unite-outline-filetype-option-ignore-types*

			List of heading types to be ignored.

			See the definition of the outline info to know about
			available heading types.

			Default value is []

					*g:unite_source_outline_max_headings*
	g:unite_source_outline_max_headings

		Maximum number of headings.
		unite-outline aborts the extraction if the number of extracted
		headings reaches the value of this variable.

		Default value is 1000.
					*g:unite_source_outline_cache_limit*
	g:unite_source_outline_cache_limit

		Threshold for persistent/on-memory caching.

		If the number of lines of the buffer is greater than the value
		of this variable, the cache of the extracted headings is
		stored in a file.

		Once the cache is stored in a file, unite-outline loads the
		headings from the file even at the first time of its execution
		after a reboot of Vim.

		Default value is 1000.
					*g:unite_source_outline_highlight*
	g:unite_source_outline_highlight

		Dictionary of highlight settings.
		You can change the highlight for each heading groups.

		Default value is {}

		Example: >
		let g:unite_source_outline_highlight = {
		      \ 'comment' : 'Comment',
		      \ 'expanded': 'Constant',
		      \ 'function': 'Function',
		      \ 'id'      : 'Special',
		      \ 'macro'   : 'Macro',
		      \ 'method'  : 'Function',
		      \ 'normal'  : 'Normal',
		      \ 'package' : 'Normal',
		      \ 'special' : 'Macro',
		      \ 'type'    : 'Type',
		      \ 'level_1' : 'Type',
		      \ 'level_2' : 'PreProc',
		      \ 'level_3' : 'Identifier',
		      \ 'level_4' : 'Constant',
		      \ 'level_5' : 'Special',
		      \ 'level_6' : 'Normal',
		      \ 'parameter_list': 'Normal',
		      \ }
<
		The patterns to specify the regions to be highlighted are
		defined in each filetypes' outline infos.

		See |unite-outline-info-highlight_rules|.

					*g:unite_source_outline_ctags_program*
	g:unite_source_outline_ctags_program

		String pointing to the absolute path of the ctags executable.

		Default value is ''

		Example: >
		let g:unite_source_outline_ctags_program =
		      \ '/usr/local/bin/ctags'
<

------------------------------------------------------------------------------
SETTINGS EXAMPLE			*unite-outline-settings-example*
>
	nnoremap [unite] <Nop>
	nmap f [unite]

	nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline outline<CR>

	call unite#set_buffer_name_option('outline', 'ignorecase', 1)
	call unite#set_buffer_name_option('outline', 'smartcase',  1)
<
==============================================================================
OUTLINE INFO				*unite-outline-info*

	Outline info is a Dictionary that implements the filetype specific way
	of extracting headings. Usually, it has some regexp patterns of
	headings and a callback function to create a heading from a line of
	the buffer.

	You can customize the creation of a heading list as you like by
	creating your own outline infos or modifying the default ones.

	When you try to show the heading list, the outline info for the
	current buffer's filetype is searched for.

	The search order is as follows:

	1. g:unite_source_outline_info.{filetype}
	2. outline#{filetype}#outline_info()
	3. unite#sources#outline#{filetype}#outline_info()
	4. unite#sources#outline#defaults#{filetype}#outline_info()

------------------------------------------------------------------------------
CREATE OUTLINE INFO			*unite-outline-info-create*

	There are two ways to create and use your own outline infos.

							[RECOMMENDED]
	A. Define an autoload function to return the outline info.

		* Create a file {filetype}.vim at
		  $HOME/.vim/autoload/unite/sources/outline/

		* Define unite#sources#outline#{filetype}#outline_info() in
		  the file.

			or

			* Create {filetype}.vim at
			  $HOME/.vim/autoload/outline/

			* Define outline#{filetype}#outline_info() in the
			  file.

		* Returns the outline info from the autoload function as its
		  return value.

		I recommend you to define an outline info in this manner
		because loading of the outline info is delayed until it is
		actually needed and it doesn't enlarge your vimrc.

		The default outline infos at
		$HOME/.vim/autoload/unite/sources/outline/defaults/ have been
		defined in this manner.

	B. Register the outline info to the global variable.

		* Define a Dictionary as the outline info and set it to
		  g:unite_source_outline_info.{filetype} at your vimrc.

		Example (for Ruby): >
		let g:unite_source_outline_info.ruby = {
		      \ 'heading': '^\s*\(module\|class\|def\)\>',
		      \ 'skip': {
		      \   'header': '^#',
		      \   'block' : ['^=begin', '^=end'],
		      \ },
		      \}
<
------------------------------------------------------------------------------
ATTRIBUTES				*unite-outline-info-attributes*

	The attributes of outline info are as follows:

EXTRACTING HEADINGS BY CALLBACK ~
					*unite-outline-info-heading-1*
	heading-1		String (Optional)

		Pattern that matches to the PREVIOUS line of a heading line.
		By setting this attribute, the outline info can extract the
		headings that follow a decoration line. For example,
>
		=========================================
		Heading 1
<
		or
>
		-----------------------------------------
		Heading 2
<
		or
>
		/****************************************
		 *
		 *   Heading 3
		 *
		 ****************************************/
<
		Because unite-outline see one more next line if the next line
		of a decoration line seems to be a blank line, the headings
		like the third example are extracted well.

		Example: >
		let s:outline_info = {
		      \ 'heading-1': '^[-=]\{10,}\s*$',
		      \ }
<
					*unite-outline-info-heading*
	heading			String (Optional)

		Pattern that matches to a heading line itself.

		Example (for HTML): >
		let s:outline_info = {
		      \ 'heading': '<[hH][1-6][^>]*>',
		      \ }
<
			*unite-outline-info-heading-pattern-restrictions*
		RESTRICTIONS ON HEADING PATTERNS ~

		There are the following restrictions on the regular
		expressions used in heading-1, heading or heading+1.

		1. Use 'magic' notation.			|/magic|
		2. Don't use any back references (\1..\9).	|/\1|

		These restrictions exist to maximize the speed of pattern
		matching. If you need any back references to extract headings,
		please use a pattern that has no back references and matches
		loosely and then filter the matched lines strictly again at
		create_heading() callback function.

					*unite-outline-info-heading+1*
	heading+1		String (Optional)

		Pattern that matches to the NEXT line of a heading line.
		By setting this attribute, the outline info can extract the
		headings that are followed by a decoration line like
		Markdown's headings. For example,
>
		Heading
		-------
<
		Example (for Markdown): >
		let s:outline_info = {
		      \ 'heading'  : '^#\+',
		      \ 'heading+1': '^[-=]\+$',
		      \ }
<					 *unite-outline-info-create_heading()*
	create_heading		Funcref (Optional)

		create_heading(
			{which}, {heading-line}, {matched-line}, {context})

		If defined, called whenever a heading is matched.
		It should return a heading object, that is a Dictionary.

		By defining this callback function, you can format the words
		of headings and decide the heading level (indent) of them.

		The arguments passed to create_heading() are as follows:

		* {which}		String
					Kind of the match.
					One of "heading-1", "heading" or
					"heading+1"

		* {heading-line}	String
					Line that is a heading.

		* {matched-line}	String
					Line that was matched.

					*unite-outline-context-object*
		* {context}		Dictionary
					Extra information about the current
					context. It contains the following
					attributes.

		    * heading_lnum	Number
		  			Line number of {heading-line}.

		    * matched_lnum	Number
		  			Line number of {matched-line}.

		    * lines		List
					List of all lines of the current
					buffer.

					An empty line has been prepended to
					the List to enable to use lnum as List
					index. Please beware it when you
					iterate the lines.

		    * buffer		Dictionary
					Buffer's information. It contains the
					following attributes.

		        * nr		Number
		    			Buffer number.

		        * path		String
		    			Path of the file edited on the buffer.

		        * filetype	String
		    			Filetype of the buffer.

					See autoload/unite/source/outline.vim
					for more available attributes.

		  * outline_info	Dictionary
		  			outline info

		You shouldn't rewrite any existing attributes of {context}
		because the Dictionary assigned to {context} is the same
		instance while the extraction.

					*unite-outline-heading-object*
		HEADING OBJECT ~

		create_heading() should return a heading object that is
		a Dictionary with the following attributes.

		* word		String (Required)
				Words of the heading displayed on the heading
				list window.

		* level		Number (Optional)
				Heading level.
				The heading will be indented according to the
				level. If omitted, set to 1.

				See |g:unite_source_outline_indent_width|.

		* type		String (Optional)
				Type of the heading.
				If omitted, set to "generic".

		If returns an empty Dictionary, it isn't considered as
		a heading and ignored.

		Example (for HTML): >
		function! s:outline_info.create_heading(which, heading_line, matched_line, context)
		  let level = str2nr(matchstr(a:heading_line, '<[hH]\zs[1-6]\ze[^>]*>'))
		  let heading = {
		        \ 'word' : "h" . level . ". " . s:get_text_content(level, a:context)
		        \ 'level': level,
		        \ 'type' : 'generic',
		        \ }
		  return heading
		endfunction
<
					*unite-outline-info-skip*
	skip			Dictionary (Optional)

		Dictionary to specify the ranges to be skipped while the
		extraction. There are the following sub attributes.

					*unite-outline-info-skip-header*
		header	String or List or Dictionary (Optional)
			It is set to prevent headings being extracted from the
			header part at the head of the buffer, in which the
			information about the author and/or the copyright
			notice exist.

			(a) If a String is set, it is considered as a pattern.

				If line 1 of the buffer is matched by the
				pattern, unite-outline skips to the line which
				isn't matched by the pattern.
>
				\ 'skip': {
				\   'header': '^#',
				\ },
<
			(b) If a List is set, it is considered as a pair of
			    patterns, the first one of which matches the
			    beginning of the header and the second one matches
			    the end.

				If line 1 of the buffer is matched by
				skip.header[0], unite-outline skips to the
				line which is matched by skip.header[1].
>
				\ 'skip': {
				\   'header': ['^/\*', '\*/\s*$'],
				\ },
<
			(c) If a Dictionary is set, it is assumed that
			    "leading" attribute is set to (a)'s pattern and/or
			    "block" attribute is set to (b)'s List.
			    unite-outline skips the header in the manner of
			    (a) and/or (b).
>
				\ 'skip': {
				\   'header': {
				\     'leading': '^//',
				\     'block'  : ['^/\*', '\*/\s*$'],
				\   },
				\ },
<
		block	List (Optional)	*unite-outline-info-skip-block*
			It is considered as a pair of patterns, the first one
			of which matches the beginning of a range to be
			skipped and the second one matches the end of the
			range.

			unite-outline skips all ranges that starts from the
			line matched by skip.block[0] to the line matched by
			skip.block[1].
>
			\ 'skip': {
			\   'block': ['^=begin', '^=end'],
			\ },
<
EXTRACTING HEADINGS BY YOURSELF ~
				*unite-outline-info-extract_headings()*
	extract_headings	Funcref (Optional)

		extract_headings( {context})

		If defined, called to extract headings.
		It should return a List of headings or a Tree of headings.

		By defining this callback function, you can implement your
		original logic to extract headings. Even if it is so difficult
		to extract headings by the pattern matching and callback
		strategy by create_heading(), you can use any external
		programs like ctags in extract_headings() to accomplish the
		extraction.

		The argument passed to extract_headings() is:

		* {context}	Dictionary
				Information about the current context.
				See |unite-outline-context-object|.

		extract_headings() should return a List of headings or a Tree
		of headings. Each of the headings must have "lnum" attribute
		in addition to the attributes described in
		|unite-outline-heading-object|.

		* lnum		Number (Required)
				Line number of a heading line.

		RETURNING A TREE OF HEADINGS ~

		If the outline info can know the tree structure of extracted
		headings in its extracting process, extract_headings() can
		return the headings as a Tree.

		You can build a Tree of headings in the manner shown in the
		following example.

		Example: >
		let s:Tree = unite#sources#outline#import('Tree')

		let root = s:Tree.new()
		call s:Tree.append_child(root, heading_A)
		call s:Tree.append_child(root, heading_B)
		call s:Tree.append_child(heading_A, heading_1)
		call s:Tree.append_child(heading_A, heading_2)
		call s:Tree.append_child(heading_B, heading_3)
<
		The headings at the top level must be children of the root
		node created by Tree.new(). The relations between each
		headings and its children can be made by Tree.append_child().

		As a result of the example code, a tree that has a structure
		shown in the following figure is built. extract_headings()
		must returns the root node, that never be displayed on the
		heading list window.
>
		root
		 |
		 +--heading_A
		 |   +--heading_1
		 |   +--heading_2
		 |
		 +--heading_B
		     +--heading_3
<
		Because the heading level can be decided from the depth of the
		node, each headings isn't required to have "level" attribute
		in this case.

FORMATTING ~
					*unite-outline-info-heading_groups*
	heading_groups		Dictionary (Optional)

		Dictionary used for categorizing headings to heading groups.
		unite-outline automatically adds "group" attribute to each
		headings using this Dictionary, that defines heading groups
		and their member types. Each groups is a List of heading
		types.

		unite-outline inserts a blank line between two headings that
		belong to different groups when the heading list is displayed.

		Example (for C++): >
		let s:outline_info = {
		  \ 'heading_groups': {
		  \   'namespace': ['namespace'],
		  \   'type'     : ['class', 'enum', 'struct', 'typedef'],
		  \   'function' : ['function'],
		  \   'macro'    : ['macro'],
		  \ },
		  \}
<
NARROWING ~
					*unite-outline-info-not_match_patterns*
	not_match_patterns	List (Optional)

		List of patterns to specify the parts of heading words that
		never match on narrowing.
		The parts of heading words that match to any of the patterns
		in the List are excluded from the words for which the matcher
		searches keywords.

SYNTAX HIGHLIGHTING ~
					*unite-outline-info-highlight_rules*
	highlight_rules		Dictionary (Optional)

		List of highlight rules, that are Dictionaries.
		Syntax highlights are defined in the order in the List before
		displaying a heading list. When two or more patterns match at
		the same position, |:syn-priority| rule is applied.

		Patterns must be surrounded by two identical characters.
		See |:syn-pattern| for details.

		Example (for Vim script): >
		let s:outline_info = {
		      \ 'highlight_rules': [
		      \   { 'name'     : 'comment',
		      \     'pattern'  : '/".*/' },
		      \   { 'name'     : 'augroup',
		      \     'pattern'  : '/\S\+\ze : augroup/',
		      \     'highlight': g:unite_source_outline_highlight.type },
		      \   { 'name'     : 'function',
		      \     'pattern'  : '/\S\+\ze\s*(/' },
		      \   { 'name'     : 'parameter_list',
		      \     'pattern'  : '/(.*)/' },
		      \ ],
		      \}
<
		If "highlight" attribute is omitted, the highlight specified
		by |g:unite_source_outline_highlight| variable is used.

	CACHING ~
					*unite-outline-info-is_volatile*
	is_volatile		Number (Optional)

		Whether extracted headings is cached or not.
		If set to none-zero, headings are not cached.

					*unite-outline-info-hooks*
HOOKS ~
					*unite-outline-info-initialize()*
	initialize		Funcref (Optional)

		initialize()

		If defined, called after loading the outline info.

		See |unite-outline-context-object| for {context}

					*unite-outline-info-before()*
	before			Funcref (Optional)

		before( {context})

		If defined, called before extracting headings.

		See |unite-outline-context-object| for {context}

					*unite-outline-info-after()*
	after			Funcref (Optional)

		after( {context})

		If defined, called after extracting headings.

		See |unite-outline-context-object| for {context}

------------------------------------------------------------------------------
EXTERNAL PROGRAMS			*unite-outline-info-external-programs*

	Some of the default outline infos use external program(s) to
	accomplish their extracting tasks.

	The external programs must be executable for Vim, in other words, they
	must be able to be executed by |system()| with the proper setting of
	PATH environment variable.

	C, C++, Java, etc~

		* Exuberant Ctags (Required)
		  http://ctags.sourceforge.net/

==============================================================================
FUNCTIONS				*unite-outline-functions*

					*unite#sources#outline#alias()*
	unite#sources#outline#alias( {alias}, {filetype})

		Defines an alias of {filetype}. By defining an alias, you can
		use the outline info for {filetype} in another filetype.

		Example: >
		call unite#sources#outline#alias('xhtml', 'html')
		call unite#sources#outline#alias('zsh',   'sh')
<
				*unite#sources#outline#get_outline_info()*
	unite#sources#outline#get_outline_info(
		{filetype} [, {reload} [, {nouser}]])

		Returns the outline info of {filetype}.
		When {reload} is non-zero, sources the script where the
		outline info is defined before getting it.
		When {nouser} is non-zero, skips searching user defined
		outline infos and returns one of the bundled.
		If the outline info is not found, returns an empty Dictionary.

				*unite#sources#outline#get_filetype_option()*
	unite#sources#outline#get_filetype_option(
		{filetype}, {key} [, {default}])

		Returns a value of option {key} for {filetype}.
		If the value of option {key} is not available, returns
		{default} if given otherwise returns 0.

				*unite#sources#outline#get_highlight()*
	unite#sources#outline#get_highlight( {name} ...)

		Returns a highlight group name associated with {name}.
		If {name} has no association, tries following arguments until
		the association is found. If not found finally, returns
		"Normal".

		See |g:unite_source_outline_highlight|.

					*unite#sources#outline#import()*
	unite#sources#outline#import( {module})

		Imports a built-in module.
>
		let s:Util = unite#sources#outline#import('Util')
<
				*unite#sources#outline#remove_cache_files()*
	unite#sources#outline#remove_cache_files()

		Remove all cache files.

UTILITY FUNCTIONS			*unite-outline-utility-functions*

	The followings are utility functions that are convenient when used in
	create_heading() or extract_headings().

	If you want to use them, please import Util module using
	unite#sources#outline#import() function.
>
	let s:Util = unite#sources#outline#import('Util')
	call s:Util.get_indent_level(a:context, h_lnum)
<
	If an utility function requires {context}, you need to pass the
	Dictionary received as {context} argument of create_heading() or
	extract_headings(). See |unite-outline-context-object|.

HEADINGS ~
					*unite-outline-Util.get_indent_level()*
	Util.get_indent_level( {context}, {lnum})

		Returns the level of the indentation of line {lnum}.

MATCHING ~
					*unite-outline-Util.join_to()*
	Util.join_to( {context}, {lnum}, {pattern} [, {limit}])

		Joins from line {lnum} to the line that matches to {pattern} into one
		String and then returns it. "\n" is put in between the joined lines.

		{limit} specifies the maximum number of lines to be joined.
		When {limit} is omitted, the default value 3 is used.
		When {limit} is negative, searches the matched line backward.

					*unite-outline-Util.neighbor_match()*
	Util.neighbor_match(
		{context}, {lnum}, {pattern} [, {range} [, {exclusive}]])

		Returns True if line {lnum} or one of its neighbor lines
		matches to {pattern}, otherwise returns False. {range}
		specifies the range of the neighbors to be tried to match.
		When {range} is omitted, the default value 1 is used. It means
		the neighbors are only the previous line and the next line.
		When {range} is a List, for example [m, n], it specifies that
		the neighbors are the previous m lines and the next n lines.

		When {exclusive} is given and non-zero, line {lnum} itself
		isn't be tried to match.

				*unite-outline-Util.neighbor_matchstr()*
	Util.neighbor_matchstr(
		{context}, {lnum}, {pattern} [, {range} [, {exclusive}]])

		Variety of |unite-outline-Util.neighbor_match()|.
		Returns the matched string not a boolean value.
		If there's no match, returns an empty String.

==============================================================================
TODO					*unite-outline-todo*

	* Add outline infos for D, Erlang, Go, Haskell, etc...

	* Issues - h1mesuke/unite-outline - GitHub
	  https://github.com/h1mesuke/unite-outline/issues

------------------------------------------------------------------------------
MESSAGE FROM THE AUTHOR

	Please send your nice outline info!

	I want unite-outline to support more and more filetypes. But, creating
	an outline info worth of using is not easy because it requires deep
	knowledge of the target filetype. So, it is virtually impossible for
	me to create outline infos for all filetypes around the world.

	If you have written an outline info for some filetype and think it is
	nice, please send it to me. I will bundle it to the distribution as
	the default outline info of the filetype.

	* Issues - h1mesuke/unite-outline - GitHub
	  https://github.com/h1mesuke/unite-outline/issues

	* Send a pull request - GitHub
	  https://github.com/h1mesuke/unite-outline/pull/new/master

==============================================================================
KNOWN ISSUES				*unite-outline-issues*

INCORRECT STRUCTURED TREE ~

	unite-outline internally builds a tree structure of headings to know
	the relationship among headings and traces the tree structure to
	accomplish its tree-aware narrowing task. Therefore, not only the
	matched headings but also their ancestors are displayed as the results
	of the narrowing.

	Outline infos for some filetypes decide the level of headings from
	their indentation depth at the buffer. In this case, the built tree
	may be structured incorrectly. As a result, the results of narrowing
	may contain headings that are neither matched nor ancestors of matched
	ones.

==============================================================================
CHANGELOG				*unite-outline-changelog*

0.5.1	2011-11-01

	* Changed unite#sources#outline#get_outline_info()'s interface.
	- And supported filetype redirection.
				|unite#sources#outline#get_outline_info()|

	* Deleted unite#sources#outline#get_default_outline_info()

	* Added a new hook.
	- initialize			|unite-outline-info-initialize|

	* Changed hook names.
	- initialize -> before		|unite-outline-info-before|
	- finalize   -> after		|unite-outline-info-after|

	* Refactoring the internal data management.

	* Improved the speed of tree-aware matching.
	- No recursive calls. The matcher does its task iteratively.

0.5.0	2011-9-06

	* Implemented the auto-update feature and added the following
	  filetype specific options.
	- auto_update	 |unite-outline-filetype-option-auto-update|
	- auto_update_event

0.3.8	2011-08-25

	* Improved the speed of heading extraction.
	  Some restrictions on the regular expressions used in heading-1,
	  heading or heading+1 were introduced along with this change.
			|unite-outline-info-heading-pattern-restrictions|

	* Added |g:unite_source_outline_filetype_options| variable.
	  g:unite_source_outline_ignore_heading_types variable was integrated
	  into this new variable as one filetype option.

	* Deprecated the following keymappings.
	- <Plug>(unite_outline_loop_cursor_down)
	- <Plug>(unite_outline_loop_cursor_up)

vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0:fdm=marker: