notes/os/editors/vim/plugins/vim-unite.txt
Ihar Hancharenka 5dff80e88e first
2023-03-27 16:52:17 +03:00

248 строки
5.5 KiB
Plaintext

Articles:
http://habrahabr.ru/post/201564/
https://github.com/joedicastro/dotfiles/blob/master/vim/vimrc
:h
unite-key-mappings
unite-options
unite-sources
Keys:
Tab
C-i
Different Unite action (see |unite-action| to read on about different actions).
TODO:
Modes:
fuzzy
Sources:
:h unites-sources
file
file_rec
buffer
yank
:h unite-kinds
???
:h unide-default-actions
???
Options:
unite-options
-default-action=
-start-insert
-no-start-insert
g:unite_enable_start_insert
-verbose
-log - enable log mode (tail -f like)
Candidate list masks:
*hisa
This example matches hisa, ujihisa, or ujihisahisa.
**/foo
This example would matche bar/foo or buzz/bar/foo.
Two consecutive wild cards recursively match directories.
Note: The unite action |file_rec| (read: file recursive) does a recursive
file search by default without the need to set wildcards.
foo bar
foo|bar
This example matches "foobar" and "foobazbar", but not "foobaz"
Multiple keywords can be be use to narrow down the candidates. They are separated by either a space " " or a pipe "|", and act like a logical AND.
foo !bar
This example matches candidates that contain "foo" but not "bar".
Specify negative conditions with a bang "!".
" Jump to line 3.
foo :3
" Search to "bar".
foo :/bar
" Executes :diffthis command.
foo :diffthis
Specify command execution after the action with a ":".
See |unite_default_key_mappings| for other actions.
:h
unite-key-mappings
Normal mode mappings.
{lhs} {rhs}
-------- -----------------------------
i |<Plug>(unite_insert_enter)|
I |<Plug>(unite_insert_head)|
a In case when you selected a candidate,
|<Plug>(unite_choose_action)|
else |<Plug>(unite_append_enter)|
A |<Plug>(unite_append_end)|
q |<Plug>(unite_exit)|
Q |<Plug>(unite_all_exit)|
g<C-g> |<Plug>(unite_exit)|
<C-h> |<Plug>(unite_delete_backward_path)|
<C-n> |<Plug>(unite_rotate_next_source)|
<C-p> |<Plug>(unite_rotate_previous_source)|
<C-a> |<Plug>(unite_print_message_log)|
<C-k> |<Plug>(unite_print_candidate)|
<C-r> |<Plug>(unite_restart)|
gg |<Plug>(unite_cursor_top)|
G |<Plug>(unite_cursor_bottom)|
j |<Plug>(unite_loop_cursor_down)|
<Down> |<Plug>(unite_loop_cursor_down)|
k |<Plug>(unite_loop_cursor_up)|
<Up> |<Plug>(unite_loop_cursor_up)|
J |<Plug>(unite_skip_cursor_down)|
K |<Plug>(unite_skip_cursor_up)|
M |<Plug>(unite_disable_max_candidates)|
N |<Plug>(unite_new_candidate)|
<CR> In case when you selected a candidate, runs default action
b In case when you selected a candidate, runs bookmark action
d In case when you selected a candidate, runs delete action
e In case when you selected a candidate, runs narrow action
t In case when you selected a candidate, runs tabopen action
yy In case when you selected a candidate, runs yank action
o In case when you selected a candidate, runs open action
p runs preview action
x In case when you selected a candidate, runs
|<Plug>(unite_quick_match_default_action)|
<Plug>(unite_input_directory)
Narrows with inputting directory name.
<Plug>(unite_narrowing_path)
Narrowing candidates by candidate path (or word).
. <Plug>(unite_narrowing_dot)
Insert mode mappings.
{lhs} {rhs}
-------- -----------------------------
<ESC> |i_<Plug>(unite_insert_leave)|
<C-n> |i_<Plug>(unite_select_next_line)|
<Down> |i_<Plug>(unite_select_next_line)|
<C-p> |i_<Plug>(unite_select_previous_line)|
<Up> |i_<Plug>(unite_select_previous_line)|
<C-f> |i_<Plug>(unite_select_next_page)|
<C-b> |i_<Plug>(unite_select_previous_page)|
<CR> |i_<Plug>(unite_do_default_action)|
<C-h> |i_<Plug>(unite_delete_backward_char)|
<BS> |i_<Plug>(unite_delete_backward_char)|
<C-u> |i_<Plug>(unite_delete_backward_line)|
<C-w> |i_<Plug>(unite_delete_backward_word)|
<C-a> |i_<Plug>(unite_move_head)|
<Home> |i_<Plug>(unite_move_head)|
<C-d> runs delete action
<C-e> runs edit action
<C-t> runs tabopen action
<C-y> runs yank action
<C-o> runs open action
Both (Insert and Normal) mode mappings.
{lhs} {rhs}
-------- -----------------------------
<Tab> |<Plug>(unite_choose_action)|
<C-g> |<Plug>(unite_exit)|
<C-l> |<Plug>(unite_redraw)|
!!! clears unite cache also !!!
??? Narrow action (n)
souurces (unite-sources)
file
file_rec
file_rec/async
directory
buffer
tab
register
bookmark
source - source names themselves
window
output - executed vim cmd as
command - ... vim ex cmd
function
mapping - vim mapping
grep,vimgrep,find
line
jump - res of :ju[mps] list
change - res of :changes
jump_point,file_point - ???
launcher - executable files from $PATH
history/yank
menu
process
script - generated by scripts (not vim, but perl and so on)
??? unite-kinds
??? unite-filters
options:
g:unite_source_file_rec_max_cache_files
unite-actions:
Default actions
kind action
{kind} {action}
---------- ----------
file open
buffer open
tab open
directory narrow
word insert
jump_list open
source start
??
g:unite_update_time
...
unite-source-attributes
max_candidates (0 - max is infinity)
is_volatile (0 - candidates are cached)
matchers
sorters
converters
unite-kind-attributes
:h unite-faq
A: It is a feature. cf: |g:unite_source_rec_max_cache_files|.
And the default max candidates are limited. You can customize it by
|unite#custom#source()|. >
let g:unite_source_rec_max_cache_files = 0
call unite#custom#source('file_rec,file_rec/async',
\ 'max_candidates', 0)
Note: |unite-options-sync| may be useful. It blocks Vim until the cache is
completed.
:h vimproc-functions