forked from Shougo/unite.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unite.txt
4064 lines (3308 loc) · 130 KB
/
unite.txt
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
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*unite.txt* Unite and create user interfaces.
Version: 6.4
Author: Shougo <[email protected]>
Documentation Author: ujihisa <ujihisa at gmail com>
License: MIT license
CONTENTS *unite-contents*
Introduction |unite-introduction|
Usage |unite-usage|
Install |unite-install|
Configuration Examples |unite-examples|
Interface |unite-interface|
Commands |unite-commands|
Variables |unite-variables|
Sources variables |unite-sources-variables|
Kind variables |unite-kind-variables|
Filter variables |unite-filter-variables|
Key mappings |unite-key-mappings|
Functions |unite-functions|
Options |unite-options|
Sources |unite-sources|
Kinds |unite-kinds|
Actions |unite-actions|
Filters |unite-filters|
Create source |unite-create-source|
Create kind |unite-create-kind|
Create filter |unite-create-filter|
External source |unite-external-sources|
Denite |unite-denite|
FAQ |unite-faq|
==============================================================================
INTRODUCTION *unite-introduction*
*unite* or *unite.vim* is a common extensible interface for searching and
displaying lists of information from within vim. It can display and search
through any arbitrary source, from files and directories to buffers and
registers.
The difference between |unite| and similar plug-ins like |fuzzyfinder|,
|ctrl-p| or |ku| is, |unite| provides a standard interface for any sources.
The API is flexible enough that it can be used to build your own interface.
==============================================================================
USAGE *unite-usage*
To browse a list of currently open buffers like |:ls| command.
>
:Unite buffer
<
To browse a list of files in the current working directory.
>
:Unite file
<
To browse recursive list of all the files under the current working
directory.
>
:Unite file_rec
<
Or you can combine sources, to browse files and buffers.
>
:Unite file buffer
<
There are a number of command line flags (see |unite-options|), for
example to set an initial search term (foo) to filter files search.
>
:Unite -input=foo file
<
You don't have to use |:execute| for dynamic arguments.
You can use evaluation cmdline by ``.
Note: In the evaluation, The special characters(spaces, "\" and ":")
are escaped automatically.
>
:Unite -buffer-name=search%`bufnr('%')` line:forward:wrap<CR>
<
Invoking unite will create a horizontal split buffer by default.
>
:Unite file
<
This example lists all the files in the current directory. You can select one
in the unite window by moving the cursor with normal Vim navigation,
e.g. j and k. Pressing Enter on a candidate and it will open it in a new
buffer.
Enter will trigger the default action, which in the case of "file" is open,
however alternate actions can be defined. These alternative actions can be
invoked with <Tab>. See also |unite-actions| to read on about different
actions.
You can also narrow down the list of candidates with a keyword. By entering
insert mode in a unite window, the cursor will jump to the unite prompt (" ")
at the top of the window. Typing at the unite prompt will filter the candidate
list.
You can also use the wild card "*" as an arbitrary character sequence.
>
*hisa
<
This example matches hisa, ujihisa, or ujihisahisa.
Two consecutive wild cards recursively match directories.
>
**/foo
<
This example would match bar/foo or buzz/bar/foo.
Note: The unite action |unite-source-file_rec| (read: file recursive) does a
recursive file search by default without the need to set wildcards.
Multiple keywords can be used to narrow down the candidates. They are
separated by either a space " " or a pipe "|", and act like a logical AND.
>
foo bar
foo|bar
<
This example matches "foobar" and "foobazbar", but not "foobaz"
Specify negative conditions with a bang "!".
>
foo !bar
<
This example matches candidates that contain "foo" but not "bar".
Specify command execution after the action with a ":".
>
" Jump to line 3.
foo :3
" Search for "bar".
foo :/bar
" Execute :diffthis command.
foo :diffthis
<
See |unite_default_key_mappings| for other actions.
==============================================================================
INSTALL *unite-install*
Install the distributed files into your Vim script directory which is usually
~/.vim/, or $HOME/vimfiles on Windows. You should consider to use one of the
famous package managers for Vim like vundle or neobundle to install the
plugin.
After installation you can run unite with the |:Unite| command and append the
sources to the command you wish to select from as parameters. However, it's a
pain in the ass to run the command explicitly every time, so I recommend you
set a key mapping for the command.
Note: MRU sources are split. To use mru sources, you must install |neomru|.
https://github.com/Shougo/neomru.vim
==============================================================================
EXAMPLES *unite-examples*
With all of the flexibility and power that unite gives you it is recommended
that you create some normal mode mappings for invoking unite in your .vimrc
file.
A simple mapping that will configure <leader>-f to browse for a file in the
current working directory:
>
nnoremap <leader>f :<C-u>Unite file<CR>
<
The same mapping, but instead start in insert mode so any typing will filter
the candidate list:
>
nnoremap <leader>f :<C-u>Unite -start-insert file<CR>
<
The popular recursive file search, starting insert automatically and using
fuzzy file matching:
>
call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <leader>r :<C-u>Unite -start-insert file_rec<CR>
<
Note: with large projects this may cause some performance problems. Normally
it is recommended to use |unite-source-file_rec/async| source, which requires
|vimproc|. The mapping might look something like this:
>
nnoremap <leader>r :<C-u>Unite -start-insert file_rec/async:!<CR>
<
Since you can pass in multiple sources into unite you can easily create a
mapping that will open up a unite pane with the sources you frequently use.
To see buffers, recent files then bookmarks:
>
nnoremap <silent> <leader>b :<C-u>Unite buffer bookmark<CR>
<
Much more sophisticated mappings can be configured to quickly find what you
need in vim.
More advanced configuration example:
>
" The prefix key.
nnoremap [unite] <Nop>
nmap f [unite]
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
\ -buffer-name=files buffer bookmark file<CR>
nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir
\ -buffer-name=files buffer bookmark file<CR>
nnoremap <silent> [unite]r :<C-u>Unite
\ -buffer-name=register register<CR>
nnoremap <silent> [unite]o :<C-u>Unite outline<CR>
nnoremap <silent> [unite]f
\ :<C-u>Unite -buffer-name=resume resume<CR>
nnoremap <silent> [unite]ma
\ :<C-u>Unite mapping<CR>
nnoremap <silent> [unite]me
\ :<C-u>Unite output:message<CR>
nnoremap [unite]f :<C-u>Unite source<CR>
nnoremap <silent> [unite]s
\ :<C-u>Unite -buffer-name=files -no-split
\ jump_point file_point buffer_tab
\ file_rec:! file file/new<CR>
" Start insert.
"call unite#custom#profile('default', 'context', {
"\ 'start_insert': 1
"\ })
" Like ctrlp.vim settings.
"call unite#custom#profile('default', 'context', {
"\ 'start_insert': 1,
"\ 'winheight': 10,
"\ 'direction': 'botright',
"\ })
autocmd FileType unite call s:unite_my_settings()
function! s:unite_my_settings()"{{{
" Overwrite settings.
imap <buffer> jj <Plug>(unite_insert_leave)
"imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
imap <buffer><expr> j unite#smart_map('j', '')
imap <buffer> <TAB> <Plug>(unite_select_next_line)
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
imap <buffer> ' <Plug>(unite_quick_match_default_action)
nmap <buffer> ' <Plug>(unite_quick_match_default_action)
imap <buffer><expr> x
\ unite#smart_map('x', "\<Plug>(unite_quick_match_jump)")
nmap <buffer> x <Plug>(unite_quick_match_jump)
nmap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
imap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
nmap <buffer> <C-j> <Plug>(unite_toggle_auto_preview)
nmap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
imap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
nnoremap <silent><buffer><expr> l
\ unite#smart_map('l', unite#do_action('default'))
let unite = unite#get_current_unite()
if unite.profile_name ==# 'search'
nnoremap <silent><buffer><expr> r unite#do_action('replace')
else
nnoremap <silent><buffer><expr> r unite#do_action('rename')
endif
nnoremap <silent><buffer><expr> cd unite#do_action('lcd')
nnoremap <buffer><expr> S unite#mappings#set_current_sorters(
\ empty(unite#mappings#get_current_sorters()) ?
\ ['sorter_reverse'] : [])
" Runs "split" action by <C-s>.
imap <silent><buffer><expr> <C-s> unite#do_action('split')
endfunction"}}}
<
==============================================================================
INTERFACE *unite-interface*
------------------------------------------------------------------------------
COMMANDS *unite-commands*
:Unite [{options}] {sources} *:Unite*
Unite can be invoked with one or more sources. This can be
done by specifying the list on the command line, separated by
spaces. The list of candidates (the matches found in the
source by your filter string) will be ordered in the same
order that you specify the {sources}.
If {sources} are empty, you can input source name and args
manually.
For example:
:Unite file buffer
Will first list the files, then list the buffers.
See also |unite-sources| the available sources.
In case you are already in a unite buffer, the narrowing text
is stored.
Unite can accept a list of strings, separated with ":", after
the name of sources. You must escape ":" and "\" with "\"
in parameters themselves. "::" is an abbreviation argument.
It depends on the sources how the parameters are interpreted.
Examples:
"file:foo:bar": the parameters of source file are
["foo", "bar"].
"file:foo\:bar": the parameter of source file is
["foo:bar"].
"file:foo::bar": the parameters of source file are
["foo", "", "bar"].
{options} are options for a unite buffer: |unite-options|
:UniteWithCurrentDir [{options}] {sources} *:UniteWithCurrentDir*
Equivalent to |:Unite| except that it targets the current
directory for the initial narrowing text.
:UniteWithBufferDir [{options}] {sources} *:UniteWithBufferDir*
Equivalent to |:Unite| except that it targets the buffer's
directory for the initial narrowing text.
:UniteWithProjectDir [{options}] {sources} *:UniteWithProjectDir*
Equivalent to |:Unite| except that it targets the project
directory for the initial narrowing text.
:UniteWithInput [{options}] {sources} *:UniteWithInput*
Equivalent to |:Unite| except that it will prompt the user for
narrowing text before opening the unite buffer.
*:UniteWithInputDirectory*
:UniteWithInputDirectory [{options}] {sources}
Equivalent to |:Unite| except that it will prompt the user for
narrowing directory before opening the unite buffer.
:UniteWithCursorWord [{options}] {sources} *:UniteWithCursorWord*
Equivalent to |:Unite| except that it targets the word under
the cursor for the initial narrowing text.
:UniteResume [{options}] [{buffer-name}] *:UniteResume*
Reuses the unite buffer named {buffer-name} that you opened
previously. Narrowing texts or candidates are
as-is. If {options} are given, context information gets
overridden.
Note: Reuses the last unite buffer you used in current tab if
you skip specifying {buffer-name}.
:UniteClose [{buffer-name}] *:UniteClose*
Closes the unite buffer with {buffer-name}.
Note: Closes the last unite buffer you used in current tab if
you skip specifying {buffer-name}.
:[count]UniteNext [{buffer-name}] *:UniteNext*
Do the default action with the next candidate in the unite
buffer with {buffer-name}.
You can use it like |:cnext|.
:[count]UnitePrevious [{buffer-name}] *:UnitePrevious*
Do the default action with the previous candidates in the
unite buffer with {buffer-name}.
You can use it like |:cprevious|.
:UniteFirst [{buffer-name}] *:UniteFirst*
Do the default action with the first candidate in the unite
buffer with {buffer-name}.
You can use it like |:cfirst|.
:UniteLast [{buffer-name}] *:UniteLast*
Do the default action with the last candidate in the unite
buffer with {buffer-name}.
You can use it like |:clast|.
:UniteDo {command} *:UniteDo*
Executes a {command} for each candidate's default action.
You can use it like |:argdo|.
Example:
Concider a JavaScript file with the code below.
>
/* jshint unused: true */
var variable = 1;
function foo () {
console.log('Hello foo!')
}
function bar () {
console.log('Good bye bar!')
}
<
Apply JsHint (http://jshint.com/) linting tool to the
example.
>
test.js: line 6, col 30, Missing semicolon.
test.js: line 10, col 33, Missing semicolon.
test.js: line 3, col 5, 'variable' is defined but never used.
test.js: line 5, col 10, 'foo' is defined but never used.
test.js: line 9, col 10, 'bar' is defined but never used.
<
Syntastic (https://github.com/scrooloose/syntastic) can
use JsHint to populate the location list with those warnings.
So, use the quick fix external source to populate a Unite
buffer with those issues.
>
:Unite location_list
<
Use "semicolon" as narrowing text so there is only one type of
error.
>
test.js: line 6, col 30, Missing semicolon.
test.js: line 10, col 33, Missing semicolon.
<
Then, use UniteDo to apply a fix to these lines using a single
command.
>
:UniteDo normal! A;
<
Limitations: If the candidates are lines in a file, UniteDo
assumes that either:
- {command} doesn't change the number of lines; or
- candidates are sorted in ascending order by line.
UniteDo might have unexpected behaviour if none of the
two conditions above are met.
The commands of source *:unite-sources-commands*
:UniteBookmarkAdd [{file}] *:UniteBookmarkAdd*
Adds a file to the bookmark list. By default this will also
store the position of the current file.
------------------------------------------------------------------------------
VARIABLES *unite-variables*
*g:unite_force_overwrite_statusline*
g:unite_force_overwrite_statusline
If this variable is 1, unite will overwrite 'statusline'
automatically.
Note: If you want to change 'statusline' in unite buffer, you
must set it to 0.
The default value is 1.
g:unite_ignore_source_files *g:unite_ignore_source_files*
Ignore source filenames (not full path). You can optimize
source initialization.
Note: You cannot use the sources in ignored source files.
>
let g:unite_ignore_source_files = ['function.vim', 'command.vim']
<
The default value is [].
g:unite_quick_match_table *g:unite_quick_match_table*
The table of completion candidates of quick match list,
corresponding the narrowing text.
The default value is complex; so see plugin/unite.vim.
g:unite_data_directory *g:unite_data_directory*
Specify directories to store unite configurations. Used by
both unite itself and its sources. If the directory doesn't
exist, the directory is automatically created. For example
source of file_mru saves the information of the most recent
used files into this directory.
Default value is "$XDG_CACHE_HOME/unite" or
expand("~/.cache/unite"); the absolute path of it.
g:unite_no_default_keymappings *g:unite_no_default_keymappings*
If this variable is 1, unite doesn't set any default key
mappings. Not recommended. You shouldn't set this to 1
unless you have a specific reason.
This variable doesn't exist unless you define it explicitly.
g:unite_redraw_hold_candidates *g:unite_redraw_hold_candidates*
If the number of unite candidates is not greater than this
variable, all the candidates are holded for redrawing.
The default value is 10000.
g:unite_enable_auto_select *g:unite_enable_auto_select*
If it is 1, unite skip first candidate when cursor is on the
prompt line.
The default value is 1.
*g:unite_restore_alternate_file*
g:unite_restore_alternate_file
Option to restore alternate file after open action. The
unite buffer does not become the alternate file by default.
Default value is 1.
SOURCES VARIABLES *unite-sources-variables*
*g:unite_source_buffer_time_format*
g:unite_source_buffer_time_format
Specify the output format of the last access time of
|unite-source-buffer|. Uses |strftime()| formatting.
The default value is "(%Y/%m/%d %H:%M:%S) ".
*g:unite_source_file_async_command*
g:unite_source_file_async_command
Specify the filelist command and arguments in file/async
source.
The default value is "ls -a".
g:unite_source_bookmark_directory *g:unite_source_bookmark_directory*
Specify the directory where |unite-source-bookmark| writes
its bookmarks.
The default value is |g:unite_data_directory|; '/bookmark'.
*g:unite_source_rec_min_cache_files*
g:unite_source_rec_min_cache_files
Specify the minimum number of files that
|unite-source-file_rec| saves the caches. Any cache isn't
saved if the number of files is less than this value or this
value is 0.
The default value is 100.
*g:unite_source_rec_max_cache_files*
g:unite_source_rec_max_cache_files
Specify the maximum number of files that
|unite-source-file_rec| saves the caches.
The default value is 20000.
*g:unite_source_rec_unit*
g:unite_source_rec_unit
Specify the unit of gather files in |unite-source-file_rec|.
If you increase the value, |unite-source-file_rec| will be
faster but it will block Vim for a long time.
Note: This option does not work in
|unite-source-file_rec/async| source.
The default value is 1000(windows environment), 2000(other).
*g:unite_source_rec_async_command*
g:unite_source_rec_async_command
Specify the filelist command and arguments in file_rec/async
source. It is arguments List.
>
" Using ack-grep as recursive command.
let g:unite_source_rec_async_command =
\ ['ack', '-f', '--nofilter']
" Using ag as recursive command.
let g:unite_source_rec_async_command =
\ ['ag', '--follow', '--nocolor', '--nogroup',
\ '--hidden', '-g', '']
<
The default value is ["find", "-L"] which follows symbolic
links to have the same behaviour as file_rec, and the
args(|g:unite_source_rec_find_args|).
Because, "find" command is fastest.
Note: In windows environment, you must install file list
command and specify the variable.
Note: "cmd.exe" is not supported.
*g:unite_source_rec_find_args*
g:unite_source_rec_find_args
Specify the find arguments in file_rec/async source.
The default value is ['-path', '*/.git/*', '-prune', '-o',
'-type', 'l', '-print'].
*g:unite_source_rec_git_command*
g:unite_source_rec_git_command
Specify the git command in file_rec/git source.
g:unite_source_grep_command *g:unite_source_grep_command*
Set grep command.
The default value is "grep".
*g:unite_source_grep_recursive_opt*
g:unite_source_grep_recursive_opt
Set grep recursive option.
The default value is "-r".
*g:unite_source_grep_default_opts*
g:unite_source_grep_default_opts
Set the default options for grep.
Note: grep output must match the pattern below.
filename:number:pattern
>
let g:unite_source_grep_default_opts = '-iRHn'
<
The default value is "-inH".
*g:unite_source_grep_search_word_highlight*
g:unite_source_grep_search_word_highlight
Specify the search word highlight.
The default value is "Search".
g:unite_source_grep_encoding *g:unite_source_grep_encoding*
Set output encoding of grep command.
The default value is "char".
g:unite_source_grep_separator *g:unite_source_grep_separator*
The grep argument separator.
The default value is "--" or ""(for jvgrep).
*g:unite_source_vimgrep_search_word_highlight*
g:unite_source_vimgrep_search_word_highlight
Specify the search word highlight.
The default value is "Search".
g:unite_source_find_command *g:unite_source_find_command*
Set find command.
The default value is "find".
*g:unite_source_find_default_opts*
g:unite_source_find_default_opts
Set the default options for find.
" Follow symlinks
let g:unite_source_find_default_opts = "-L"
The default value is "".
*g:unite_source_find_default_expr*
g:unite_source_find_default_expr
Set the default expression for find.
The default value is "-name ".
*g:unite_source_line_enable_highlight*
g:unite_source_line_enable_highlight
Control whether highlighted in unite buffer.
Note: It is slow.
The default value is 0.
g:unite_source_alias_aliases *g:unite_source_alias_aliases*
Set |unite-source-alias| settings. This variable is a
dictionary. The key is an alias source name, and
the value is a dictionary with the following attributes.
Alias sources are copies of original sources.
If the value items are a string, they will be used as the base
source name.
source (String) (Required)
Base source name.
args (String) (Optional)
Set arguments automatically.
description (String) (Optional)
Description string.
Example:
>
let g:unite_source_alias_aliases = {
\ 'test' : {
\ 'source': 'file_rec',
\ 'args': '~/',
\ },
\ 'b' : 'buffer',
\ }
<
The default value is "{}".
g:unite_source_menu_menus *g:unite_source_menu_menus*
Set |unite-source-menu| settings. This variable is a
dictionary. The keys are menu names and the values are the
following attributes.
candidates (List or Dictionary) (Required)
Menu candidates. If candidates type is a dictionary, keys are
ignored, but you can refer to the map attribute described
below.
file_candidates
(List) (Optional)
Menu candidates for files.
The first item is used for word. The second item is file
path.
command_candidates
(List or Dictionary) (Optional)
Menu candidates for commands.
If this is a Dictionary, the key is used for word. The value
is command name.
If this is a List, the first item is used for word. The
second item is command name.
map (Function) (Optional)
If this attribute is given, candidates are results of
map(key, value).
description (String) (Optional)
Description string.
Example:
>
let g:unite_source_menu_menus = {}
let g:unite_source_menu_menus.test = {
\ 'description' : 'Test menu',
\ }
let g:unite_source_menu_menus.test.candidates = {
\ 'ghci' : 'VimShellInteractive ghci',
\ }
function g:unite_source_menu_menus.test.map(key, value)
return {
\ 'word' : a:key, 'kind' : 'command',
\ 'action__command' : a:value,
\ }
endfunction
let g:unite_source_menu_menus.test2 = {
\ 'description' : 'Test menu2',
\ }
let g:unite_source_menu_menus.test2.command_candidates = {
\ 'python' : 'VimShellInteractive python',
\ }
let g:unite_source_menu_menus.test3 = {
\ 'description' : 'Test menu3',
\ }
let g:unite_source_menu_menus.test3.command_candidates = [
\ ['ruby', 'VimShellInteractive ruby'],
\ ['python', 'VimShellInteractive python'],
\ ]
let g:unite_source_menu_menus.zsh = {
\ 'description' : 'zsh files',
\ }
let g:unite_source_menu_menus.zsh.file_candidates = [
\ ['zshenv' , '~/.zshenv'],
\ ['zshrc' , '~/.zshrc'],
\ ['zplug' , '~/.zplug'],
\ ]
nnoremap <silent> sm :<C-u>Unite menu:test<CR>
<
The default value is "{}".
*g:unite_source_process_enable_confirm*
g:unite_source_process_enable_confirm
When this variable is 1 and a signal is sent to a process via
|unite-source-process| such as KILL, Vim will ask you if you
really want to do that.
The default value is 1.
*g:unite_source_output_shellcmd_colors*
g:unite_source_output_shellcmd_colors
A list of colors correspond to coloring in escape sequence.
0-8 as normal colors, 9-15 as highlight colors.
KIND VARIABLES *unite-kind-variables*
*g:unite_kind_jump_list_after_jump_scroll*
g:unite_kind_jump_list_after_jump_scroll
Number of lines to adjust the cursor location after the
jump via |unite-kind-jump_list|. Valid range is 0 to 100,
where 0 is the top of the window and 100 is the bottom of
the window.
value meaning equivalent command
--------------------------------------
0 Window top normal! |z<CR>|
50 Window centre normal! |z.|
100 Window bottom normal! |z-|
The default value is 25.
*g:unite_kind_file_preview_max_filesize*
g:unite_kind_file_preview_max_filesize
It is max file size of preview action in file kind.
The default value is 1000000.
*g:unite_kind_openable_persist_open_blink_time*
g:unite_kind_openable_persist_open_blink_time
The amount of blink time after "persist_open" action from
|unite-kind-openable|.
The default value is "250m"
*g:unite_kind_cdable_cd_command*
g:unite_kind_cdable_cd_command
*g:unite_kind_openable_cd_command*
g:unite_kind_openable_cd_command
Specify the Vim command for cd action.
The default value is "cd".
*g:unite_kind_cdable_lcd_command*
g:unite_kind_cdable_lcd_command
*g:unite_kind_openable_lcd_command*
g:unite_kind_openable_lcd_command
Specify the Vim command for lcd action.
The default value is "lcd".
FILTER VARIABLES *unite-filter-variables*
*g:unite_converter_file_directory_width*
g:unite_converter_file_directory_width
Specify the filename width.
The default value is "45".
*g:unite_matcher_fuzzy_max_input_length*
g:unite_matcher_fuzzy_max_input_length
Specify the maximum input pattern length for
|unite-filter-matcher_fuzzy|, beyond which the matcher
falls back to |unite-filter-matcher_glob|.
The default value is 20.
DEPRECATED VARIABLES *unite-deprecated-variables*
g:unite_update_time *g:unite_update_time*
The time interval for updating the candidate list as the
filter text it typed in Msec.
If it is 0, this feature is disabled.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-update-time|
instead.
g:unite_enable_start_insert *g:unite_enable_start_insert*
If this variable is 1, unite buffer will be in Insert Mode
immediately.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-start-insert|
instead.
g:unite_split_rule *g:unite_split_rule*
Defines split position rule.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-direction|
instead.
*g:unite_enable_split_vertically*
g:unite_enable_split_vertically
If this variable is 1, unite window is split vertically.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-vertical| instead.
g:unite_winheight *g:unite_winheight*
The height of unite window when split horizontally. Ignored
when splitting vertically.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-winheight|
instead.
g:unite_winwidth *g:unite_winwidth*
The width of unite window when split vertically. Ignored
when splitting horizontally.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-winwidth| instead.
*g:unite_enable_short_source_names*
g:unite_enable_short_source_names
If this variable is 1, unite buffer will show short source
names when multiple sources.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and
|unite-options-short-source-names| instead.
g:unite_abbr_highlight *g:unite_abbr_highlight*
Specify abbreviated candidates highlight.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-abbr-highlight|
instead.
g:unite_cursor_line_time *g:unite_cursor_line_time*
Specify the cursor line highlight time.
If you scroll cursor quickly less than it, unite will skip
cursor line highlight.
If it is "0.0", this feature will be disabled.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-cursor-line-time|
instead.
*g:unite_kind_file_vertical_preview*
g:unite_kind_file_vertical_preview
If this variable is 1, Unite will open the preview window
vertically rather than horizontally.
Note: This variable is deprecated. Please use
|unite#custom#profile()| and |unite-options-vertical-preview|
instead.
------------------------------------------------------------------------------
KEY MAPPINGS *unite-key-mappings*
Normal mode mappings.
<Plug>(unite_exit) *<Plug>(unite_exit)*
Exits unite. The previous unite buffer menu will be restored.
Note: You cannot close unite buffer using the |:close|,
|:bdelete| or |:quit| command. This mapping restores windows.
<Plug>(unite_all_exit) *<Plug>(unite_all_exit)*
Exits unite with previous unite buffer menu.
Note: You cannot close unite buffer using the |:close|,
|:bdelete| or |:quit| command. This mapping restores windows.
<Plug>(unite_restart) *<Plug>(unite_restart)*
Restarts unite.
<Plug>(unite_do_default_action) *<Plug>(unite_do_default_action)*
Runs the default action of the default candidates. The kinds
of each candidates have their own defined actions. See also
|unite-kinds| about kinds. Refer to |unite-default-action|
about default actions.
<Plug>(unite_choose_action) *<Plug>(unite_choose_action)*
Runs the default action of the selected candidates. The kinds
of each candidates have their own defined actions. Refer
to |unite-kinds| about kinds.
<Plug>(unite_insert_enter) *<Plug>(unite_insert_enter)*
Starts inputting narrowing text from the cursor position. In
the case when the cursor is not on the prompt line, this moves
the cursor into the prompt line automatically.
<Plug>(unite_insert_head) *<Plug>(unite_insert_head)*
Starts inputting narrowing text from the head of the line. In
the case when the cursor is not on the prompt line, this moves
the cursor into the prompt line automatically.
<Plug>(unite_append_enter) *<Plug>(unite_append_enter)*
Starts inputting narrowing text from the right side of the
cursor position. In the case when the cursor is not on the
prompt line, this moves the cursor into the prompt line
automatically.
<Plug>(unite_append_end) *<Plug>(unite_append_end)*
Starts inputting narrowing text from the end of the line. In
the case when the cursor is not on the prompt line, this moves
the cursor into the prompt line automatically.
<Plug>(unite_toggle_mark_current_candidate)
*<Plug>(unite_toggle_mark_current_candidate)*
Toggles the mark of the candidates in the current line. You
may run an action on multiple candidates at the same time by
marking multiple candidates.
<Plug>(unite_toggle_mark_current_candidate_up)
*<Plug>(unite_toggle_mark_current_candidate_up)*
Toggles the mark of the candidates in the current line and
moves the cursor up.
<Plug>(unite_toggle_mark_all_candidates)
*<Plug>(unite_toggle_mark_all_candidates)*
Toggles the mark of the candidates in the all lines.
<Plug>(unite_redraw) *<Plug>(unite_redraw)*
Without waiting for the update time defined in
|g:unite_update_time|, Unite updates its view immediately.
This is also used internally for updating the cache.
<Plug>(unite_rotate_next_source) *<Plug>(unite_rotate_next_source)*
Changes the order of source in normal order.
<Plug>(unite_rotate_previous_source) *<Plug>(unite_rotate_previous_source)*
Changes the order of source in reverse order.
<Plug>(unite_print_candidate) *<Plug>(unite_print_candidate)*
Shows the target of the action of the selected candidate.
<Plug>(unite_print_message_log) *<Plug>(unite_print_message_log)*
Shows the message log in current unite buffer.
<Plug>(unite_cursor_top) *<Plug>(unite_cursor_top)*
Moves the cursor to the top of the Unite buffer.
<Plug>(unite_cursor_bottom) *<Plug>(unite_cursor_bottom)*
Moves the cursor to the bottom of the Unite buffer.
Note: This mapping redraws all candidates.
<Plug>(unite_loop_cursor_down) *<Plug>(unite_loop_cursor_down)*
Goes to the next line. Goes up to the top when you are on the
bottom.
<Plug>(unite_loop_cursor_up) *<Plug>(unite_loop_cursor_up)*
Goes to the previous line. Goes down to the bottom when you
are on the top.
<Plug>(unite_skip_cursor_down) *<Plug>(unite_skip_cursor_down)*
Goes to the next line, but skips unmatched candidates.
Goes up to top when you are on the bottom.
<Plug>(unite_skip_cursor_up) *<Plug>(unite_skip_cursor_up)*
Goes to the previous line, but skips unmatched candidates.
Goes down to the bottom when you are on the top.