-
Notifications
You must be signed in to change notification settings - Fork 189
/
mini-extra.txt
809 lines (650 loc) · 31.2 KB
/
mini-extra.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
*mini.extra* Extra 'mini.nvim' functionality
*MiniExtra*
MIT License Copyright (c) 2023 Evgeni Chasnovski
==============================================================================
Extra useful functionality which is not essential enough for other 'mini.nvim'
modules to include directly.
Features:
- Various pickers for 'mini.pick':
- Built-in diagnostic (|MiniExtra.pickers.diagnostic()|).
- File explorer (|MiniExtra.pickers.explorer()|).
- Git branches/commits/files/hunks (|MiniExtra.pickers.git_hunks()|, etc.).
- Command/search/input history (|MiniExtra.pickers.history()|).
- LSP references/symbols/etc. (|MiniExtra.pickers.lsp()|).
- Tree-sitter nodes (|MiniExtra.pickers.treesitter()|).
- And much more.
See |MiniExtra.pickers| for more.
- Various textobject specifications for 'mini.ai'. See |MiniExtra.gen_ai_spec|.
- Various highlighters for 'mini.hipatterns'. See |MiniExtra.gen_highlighter|.
Notes:
- This module requires only those 'mini.nvim' modules which are needed for
a particular functionality: 'mini.pick' for pickers, etc.
# Setup ~
This module needs a setup with `require('mini.extra').setup({})` (replace
`{}` with your `config` table). It will create global Lua table `MiniExtra`
which you can use for scripting or manually (with `:lua MiniExtra.*`).
See |MiniExtra.config| for `config` structure and default values.
This module doesn't have runtime options, so using `vim.b.miniextra_config`
will have no effect here.
# Comparisons ~
- 'nvim-telescope/telescope.nvim':
- With |MiniExtra.pickers|, 'mini.pick' is reasonably on par when it comes
to built-in pickers.
- 'ibhagwan/fzf-lua':
- Same as 'nvim-telescope/telescope.nvim'.
------------------------------------------------------------------------------
*MiniExtra.setup()*
`MiniExtra.setup`({config})
Module setup
Parameters ~
{config} `(table|nil)` Module config table. See |MiniExtra.config|.
Usage ~
>lua
require('mini.extra').setup() -- use default config
-- OR
require('mini.extra').setup({}) -- replace {} with your config table
<
------------------------------------------------------------------------------
*MiniExtra.config*
`MiniExtra.config`
Module config
Default values:
>lua
MiniExtra.config = {}
<
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec*
`MiniExtra.gen_ai_spec`
'mini.ai' textobject specification generators
This is a table with function elements. Call to actually get specification.
Assumed to be used as part of |MiniAi.setup()|. Example: >lua
local gen_ai_spec = require('mini.extra').gen_ai_spec
require('mini.ai').setup({
custom_textobjects = {
B = gen_ai_spec.buffer(),
D = gen_ai_spec.diagnostic(),
I = gen_ai_spec.indent(),
L = gen_ai_spec.line(),
N = gen_ai_spec.number(),
},
})
<
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec.buffer()*
`MiniExtra.gen_ai_spec.buffer`()
Current buffer textobject
Notes:
- `a` textobject selects all lines in a buffer.
- `i` textobject selects all lines except blank lines at start and end.
Return ~
`(function)` Function implementing |MiniAi-textobject-specification|.
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec.diagnostic()*
`MiniExtra.gen_ai_spec.diagnostic`({severity})
Current buffer diagnostic textobject
Notes:
- Both `a` and `i` textobjects return |vim.diagnostic.get()| output for the
current buffer. It is modified to fit |MiniAi-textobject-specification|.
Parameters ~
{severity} `(any)` Which severity to use. Forwarded to |vim.diagnostic.get()|.
Default: `nil` to use all diagnostic entries.
Return ~
`(function)` Function implementing |MiniAi-textobject-specification|.
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec.indent()*
`MiniExtra.gen_ai_spec.indent`()
Current buffer indent scopes textobject
Indent scope is a set of consecutive lines with the following properties:
- Lines above first and below last are non-blank. They are called borders.
- There is at least one non-blank line in a set.
- All non-blank lines between borders have strictly greater indent
(perceived leading space respecting |tabstop|) than either of borders.
Notes:
- `a` textobject selects scope including borders.
- `i` textobject selects the scope charwise.
- Differences with |MiniIndentscope.textobject|:
- This textobject always treats blank lines on top and bottom of `i`
textobject as part of it, while 'mini.indentscope' can configure that.
- This textobject can select non-covering scopes, while 'mini.indentscope'
can not (by design).
- In this textobject scope computation is done only by "casting rays" from
top to bottom and not in both ways as in 'mini.indentscope'.
This works in most common scenarios and doesn't work only if indent of
of the bottom border is expected to be larger than the top.
Return ~
`(function)` Function implementing |MiniAi-textobject-specification|.
It returns array of regions representing all indent scopes in the buffer
ordered increasingly by the start line.
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec.line()*
`MiniExtra.gen_ai_spec.line`()
Current line textobject
Notes:
- `a` textobject selects whole line.
- `i` textobject selects line after initial indent.
Return ~
`(function)` Function implementing |MiniAi-textobject-specification|.
------------------------------------------------------------------------------
*MiniExtra.gen_ai_spec.number()*
`MiniExtra.gen_ai_spec.number`()
Number textobject
Notes:
- `a` textobject selects a whole number possibly preceded with "-" and
possibly followed by decimal part (dot and digits).
- `i` textobject selects consecutive digits.
Return ~
`(function)` Function implementing |MiniAi-textobject-specification|.
------------------------------------------------------------------------------
*MiniExtra.gen_highlighter*
`MiniExtra.gen_highlighter`
'mini.hipatterns' highlighter generators
This is a table with function elements. Call to actually get specification.
Assumed to be used as part of |MiniHipatterns.setup()|. Example: >lua
local hi_words = require('mini.extra').gen_highlighter.words
require('mini.hipatterns').setup({
highlighters = {
todo = hi_words({ 'TODO', 'Todo', 'todo' }, 'MiniHipatternsTodo'),
},
})
<
------------------------------------------------------------------------------
*MiniExtra.gen_highlighter.words()*
`MiniExtra.gen_highlighter.words`({words}, {group}, {extmark_opts})
Highlight words
Notes:
- Words should start and end with alphanumeric symbol (latin letter or digit).
- Words will be highlighted only in full and not if part bigger word, i.e.
there should not be alphanumeric symbol before and after it.
Parameters ~
{words} `(table)` Array of words to highlight. Will be matched as is, not
as Lua pattern.
{group} `(string|function)` Proper `group` field for `highlighter`.
See |MiniHipatterns.config|.
{extmark_opts} `(any)` Proper `extmark_opts` field for `highlighter`.
See |MiniHipatterns.config|.
------------------------------------------------------------------------------
*MiniExtra.pickers*
`MiniExtra.pickers`
'mini.pick' pickers
A table with |MiniPick| pickers (which is a hard dependency).
Notes:
- All have the same signature:
- <local_opts> - optional table with options local to picker.
- <opts> - optional table with options forwarded to |MiniPick.start()|.
- All of them are automatically registered in |MiniPick.registry|.
- All use default versions of |MiniPick-source.preview|, |MiniPick-source.choose|,
and |MiniPick-source.choose_marked| if not stated otherwise.
Shown text and |MiniPick-source.show| are targeted to the picked items.
Examples of usage:
- As Lua code: `MiniExtra.pickers.buf_lines()`.
- With |:Pick| command: `:Pick buf_lines scope='current'`
Note: this requires calling |MiniExtra.setup()|.
------------------------------------------------------------------------------
*MiniExtra.pickers.buf_lines()*
`MiniExtra.pickers.buf_lines`({local_opts}, {opts})
Buffer lines picker
Pick from buffer lines. Notes:
- Loads all target buffers which are currently unloaded.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - one of "all" (normal listed buffers) or "current".
Default: "all".
- <preserve_order> `(boolean)` - whether to preserve original order
during query. Default: `false`.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.commands()*
`MiniExtra.pickers.commands`({local_opts}, {opts})
Neovim commands picker
Pick from Neovim built-in (|ex-commands|) and |user-commands|.
Notes:
- Preview shows information about the command (if available).
- Choosing either executes command (if reliably known that it doesn't need
arguments) or populates Command line with the command.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Not used at the moment.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.diagnostic()*
`MiniExtra.pickers.diagnostic`({local_opts}, {opts})
Built-in diagnostic picker
Pick from |vim.diagnostic| using |vim.diagnostic.get()|.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <get_opts> `(table)` - options for |vim.diagnostic.get()|. Can be used
to limit severity or namespace. Default: `{}`.
- <scope> `(string)` - one of "all" (available) or "current" (buffer).
Default: "all".
- <sort_by> `(string)` - sort priority. One of "severity", "path", "none".
Default: "severity".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.explorer()*
`MiniExtra.pickers.explorer`({local_opts}, {opts})
File explorer picker
Explore file system and open file.
Notes:
- Choosing a directory navigates inside it, changing picker's items and
current working directory.
- Query and preview work as usual (not only `move_next`/`move_prev` can be used).
- Preview works for any item.
Examples ~
- `MiniExtra.pickers.explorer()`
- `:Pick explorer cwd='..'` - open explorer in parent directory.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <cwd> `(string)` - initial directory to explore. Should be a valid
directory path. Default: `nil` for |current-directory|.
- <filter> `(function)` - callable predicate to filter items to show.
Will be called for every item and should return `true` if it should be
shown. Each item is a table with the following fields:
- <fs_type> `(string)` - path type. One of "directory" or "file".
- <path> `(string)` - item path.
- <text> `(string)` - shown text (path's basename).
- <sort> `(function)` - callable item sorter. Will be called with array
of items (each element with structure as described above) and should
return sorted array of items.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.git_branches()*
`MiniExtra.pickers.git_branches`({local_opts}, {opts})
Git branches picker
Pick from Git branches using `git branch`.
Notes:
- Requires executable `git`.
- Requires target path to be part of git repository.
- Present for exploration and navigation purposes. Doing any Git operations
is suggested to be done in a dedicated Git client and is not planned.
- On choose opens scratch buffer with branch's history.
Examples ~
- `MiniExtra.pickers.git_branches({ scope = 'local' })` - local branches of
the |current-directory| parent Git repository.
- `:Pick git_branches path='%'` - all branches of the current file parent
Git repository.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <path> `(string|nil)` - target path for Git operation (if required). Also
used to find Git repository inside which to construct items.
Default: `nil` for root of Git repository containing |current-directory|.
- <scope> `(string)` - branch scope to show. One of "all", "local", "remotes".
Default: "all".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.git_commits()*
`MiniExtra.pickers.git_commits`({local_opts}, {opts})
Git commits picker
Pick from Git commits using `git log`.
Notes:
- Requires executable `git`.
- Requires target path to be part of git repository.
- Present for exploration and navigation purposes. Doing any Git operations
is suggested to be done in a dedicated Git client and is not planned.
- On choose opens scratch buffer with commit's diff.
Examples ~
- `MiniExtra.pickers.git_commits()` - all commits from parent Git
repository of |current-directory|.
- `MiniExtra.pickers.git_commits({ path = 'subdir' })` - commits affecting
files from 'subdir' subdirectory.
- `:Pick git_commits path='%'` commits affecting current file.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <path> `(string|nil)` - target path for Git operation (if required). Also
used to find Git repository inside which to construct items.
Default: `nil` for root of Git repository containing |current-directory|.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.git_files()*
`MiniExtra.pickers.git_files`({local_opts}, {opts})
Git files picker
Pick from Git files using `git ls-files`.
Notes:
- Requires executable `git`.
- Requires target path to be part of git repository.
- Present for exploration and navigation purposes. Doing any Git operations
is suggested to be done in a dedicated Git client and is not planned.
Examples ~
- `MiniExtra.pickers.git_files({ scope = 'ignored' })` - ignored files from
parent Git repository of |current-directory|.
- `:Pick git_files path='subdir' scope='modified'` - files from 'subdir'
subdirectory which are ignored by Git.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <path> `(string|nil)` - target path for Git operation (if required). Also
used to find Git repository inside which to construct items.
Default: `nil` for root of Git repository containing |current-directory|.
- <scope> `(string)` - files scope to show. One of
- "tracked" (`--cached` Git flag).
- "modified" (`--modified` Git flag).
- "untracked" (`--others` Git flag).
- "ignored" (`--ignored` Git flag).
- "deleted" (`--deleted` Git flag).
Default: "tracked".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.git_hunks()*
`MiniExtra.pickers.git_hunks`({local_opts}, {opts})
Git hunks picker
Pick from Git hunks using `git diff`.
Notes:
- Requires executable `git`.
- Requires target path to be part of git repository.
- Present for exploration and navigation purposes. Doing any Git operations
is suggested to be done in a dedicated Git client and is not planned.
- On choose navigates to hunk's first change.
Examples ~
- `MiniExtra.pickers.git_hunks({ scope = 'staged' })` - staged hunks from
parent Git repository of |current-directory|.
- `:Pick git_hunks path='%' n_context=0` - hunks from current file computed
with no context.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <n_context> `(number)` - number of context lines to show in hunk's preview.
Default: 3.
- <path> `(string|nil)` - target path for Git operation (if required). Also
used to find Git repository inside which to construct items.
Default: `nil` for root of Git repository containing |current-directory|.
- <scope> `(string)` - hunks scope to show. One of "unstaged" or "staged".
Default: "unstaged".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.hipatterns()*
`MiniExtra.pickers.hipatterns`({local_opts}, {opts})
Matches from 'mini.hipatterns' picker
Pick from |MiniHipatterns| matches using |MiniHipatterns.get_matches()|.
Notes:
- Requires 'mini.hipatterns'.
- Highlighter identifier is highlighted with its highlight group.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - one of "all" (buffers with enabled 'mini.hipatterns')
or "current" (buffer). Default: "all".
- <highlighters> `(table|nil)` - highlighters for which to find matches.
Forwarded to |MiniHipatterns.get_matches()|. Default: `nil`.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.history()*
`MiniExtra.pickers.history`({local_opts}, {opts})
Neovim history picker
Pick from output of |:history|.
Notes:
- Has no preview.
- Choosing action depends on scope:
- For "cmd" / ":" scopes, the command is executed.
- For "search" / "/" / "?" scopes, search is redone.
- For other scopes nothing is done (but chosen item is still returned).
Examples ~
- Command history: `MiniExtra.pickers.history({ scope = ':' })`
- Search history: `:Pick history scope='/'`
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - any allowed {name} flag of |:history| command.
Note: word abbreviations are not allowed. Default: "all".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.hl_groups()*
`MiniExtra.pickers.hl_groups`({local_opts}, {opts})
Highlight groups picker
Pick and preview highlight groups.
Notes:
- Item line is colored with same highlight group it represents.
- Preview shows highlight's definition (as in |:highlight| with {group-name}).
- Choosing places highlight definition in Command line to update and apply.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Not used at the moment.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.keymaps()*
`MiniExtra.pickers.keymaps`({local_opts}, {opts})
Neovim keymaps picker
Pick and preview data about Neovim keymaps.
Notes:
- Item line contains data about keymap mode, whether it is buffer local, its
left hand side, and inferred description.
- Preview shows keymap data or callback source (if present and reachable).
- Choosing emulates pressing the left hand side of the keymap.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <mode> `(string)` - modes to show. One of "all" or appropriate mode
for |nvim_set_keymap()|. Default: "all".
- <scope> `(string)` - scope to show. One of "all", "global", "buf".
Default: "all".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.list()*
`MiniExtra.pickers.list`({local_opts}, {opts})
Neovim lists picker
Pick and navigate to elements of the following Neovim lists:
- |quickfix| list.
- |location-list| of current window.
- |jumplist|.
- |changelist|.
Note: it requires explicit `scope`.
Examples ~
- `MiniExtra.pickers.list({ scope = 'quickfix' })` - quickfix list.
- `:Pick list scope='jump'` - jump list.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - type of list to show. One of "quickfix", "location",
"jump", "change". Default: `nil` which means explicit scope is needed.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.lsp()*
`MiniExtra.pickers.lsp`({local_opts}, {opts})
LSP picker
Pick and navigate with LSP methods.
Notes:
- Needs an explicit scope from a list of supported ones:
- "declaration".
- "definition".
- "document_symbol".
- "implementation".
- "references".
- "type_definition".
- "workspace_symbol".
- Directly relies on `vim.lsp.buf` methods which support |lsp-on-list-handler|.
In particular, it means that picker is started only if LSP server returns
list of locations and not a single location.
- Doesn't return anything due to async nature of `vim.lsp.buf` methods.
- Requires set up |mini.icons| to show extra icons and highlighting in
"document_symbol" and "workspace_symbol" scopes.
Examples ~
- `MiniExtra.pickers.lsp({ scope = 'references' })` - references of the symbol
under cursor.
- `:Pick lsp scope='document_symbol'` - symbols in current file.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - LSP method to use. One of the supported ones (see
list above). Default: `nil` which means explicit scope is needed.
- <symbol_query> `(string)` - query for |vim.lsp.buf.workspace_symbol()|.
Default: empty string for all symbols (according to LSP specification).
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(nil)` Nothing is returned.
------------------------------------------------------------------------------
*MiniExtra.pickers.marks()*
`MiniExtra.pickers.marks`({local_opts}, {opts})
Neovim marks picker
Pick and preview position of Neovim |mark|s.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - scope to show. One of "all", "global", "buf".
Default: "all".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.oldfiles()*
`MiniExtra.pickers.oldfiles`({local_opts}, {opts})
Old files picker
Pick from |v:oldfiles| entries representing readable files.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <current_dir> `(boolean)` - whether to return files only from current
working directory and its subdirectories. Default: `false`.
- <preserve_order> `(boolean)` - whether to preserve original order
during query. Default: `false`.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.options()*
`MiniExtra.pickers.options`({local_opts}, {opts})
Neovim options picker
Pick and preview data about Neovim options.
Notes:
- Item line is colored based on whether it was set (dimmed if wasn't).
- Preview shows option value in target window and its general information.
- Choosing places option name in Command line to update and apply.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <scope> `(string)` - options to show. One of "all", "global", "win", "buf".
Default: "all".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.registers()*
`MiniExtra.pickers.registers`({local_opts}, {opts})
Neovim registers picker
Pick from Neovim |registers|.
Notes:
- There is no preview (all information is in the item's text).
- Choosing pastes content of a register: with |i_CTRL-R| in Insert mode,
|c_CTRL-R| in Command-line mode, and |P| otherwise.
Expression register |quote=| is reevaluated (if present) and pasted.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Not used at the moment.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.spellsuggest()*
`MiniExtra.pickers.spellsuggest`({local_opts}, {opts})
Neovim spell suggestions picker
Pick and apply spell suggestions.
Notes:
- No preview is available.
- Choosing replaces current word (|<cword>|) with suggestion.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <n_suggestions> `(number)` - number of spell suggestions. Default: 25.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.treesitter()*
`MiniExtra.pickers.treesitter`({local_opts}, {opts})
Tree-sitter nodes picker
Pick and navigate to |treesitter| nodes of current buffer.
Notes:
- Requires active tree-sitter parser in the current buffer.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Not used at the moment.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.visit_paths()*
`MiniExtra.pickers.visit_paths`({local_opts}, {opts})
Visit paths from 'mini.visits' picker
Pick paths from |MiniVisits| using |MiniVisits.list_paths()|.
Notes:
- Requires 'mini.visits'.
Examples ~
- `MiniExtra.pickers.visit_paths()` - visits registered for |current-directory|
and ordered by "robust frecency".
- `:Pick visit_paths cwd='' recency_weight=1 filter='core'` - all visits with
"core" label ordered from most to least recent.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <cwd> `(string)` - forwarded to |MiniVisits.list_paths()|.
Default: `nil` to get paths registered for |current-directory|.
- <filter> `(function|string)` - forwarded to |MiniVisits.list_paths()|.
Default: `nil` to use all paths.
- <preserve_order> `(boolean)` - whether to preserve original order
during query. Default: `false`.
- <recency_weight> `(number)` - forwarded to |MiniVisits.gen_sort.default()|.
Default: 0.5 to use "robust frecency" sorting.
- <sort> `(function)` - forwarded to |MiniVisits.list_paths()|.
Default: `nil` to use "robust frecency".
Note: if supplied, has precedence over `recency_weight`.
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
`(any)` Output of the called picker.
------------------------------------------------------------------------------
*MiniExtra.pickers.visit_labels()*
`MiniExtra.pickers.visit_labels`({local_opts}, {opts})
Visit labels from 'mini.visits' picker
Pick labels from |MiniVisits| using |MiniVisits.list_labels()|
and |MiniVisits.list_paths()|.
Notes:
- Requires 'mini.visits'.
- Preview shows target visit paths filtered to those having previewed label.
- Choosing essentially starts |MiniExtra.pickers.visit_paths()| for paths
with the chosen label.
Examples ~
- `MiniExtra.pickers.visit_labels()` - labels from visits registered
for |current-directory|.
- `:Pick visit_labels cwd=''` - labels from all visits.
Parameters ~
{local_opts} `(table|nil)` Options defining behavior of this particular picker.
Possible fields:
- <cwd> `(string)` - forwarded to |MiniVisits.list_labels()|.
Default: `nil` to get labels from visits registered for |current-directory|.
- <filter> `(function|string)` - forwarded to |MiniVisits.list_labels()|.
Default: `nil` to use all visits.
- <path> `(string)` - forwarded to |MiniVisits.list_labels()|.
Default: `""` to get labels from all visits for target `cwd`.
- <sort> `(function)` - forwarded to |MiniVisits.list_paths()| for
preview and choose. Default: `nil` to use "robust frecency".
{opts} `(table|nil)` Options forwarded to |MiniPick.start()|.
Return ~
Chosen path.
vim:tw=78:ts=8:noet:ft=help:norl: