[docgen] Update doc/telescope.txt
skip-checks: true
This commit is contained in:
@@ -4,25 +4,19 @@
|
|||||||
Telescope.nvim is a plugin for fuzzy finding and neovim. It helps you search,
|
Telescope.nvim is a plugin for fuzzy finding and neovim. It helps you search,
|
||||||
filter, find and pick things in Lua.
|
filter, find and pick things in Lua.
|
||||||
|
|
||||||
To find out more:
|
To find out more: https://github.com/nvim-telescope/telescope.nvim
|
||||||
https://github.com/nvim-telescope/telescope.nvim
|
|
||||||
|
|
||||||
:h telescope.setup
|
:h telescope.setup :h telescope.builtin :h telescope.layout :h
|
||||||
:h telescope.builtin
|
telescope.actions
|
||||||
:h telescope.layout
|
|
||||||
:h telescope.actions
|
|
||||||
|
|
||||||
telescope.extensions() *telescope.extensions()*
|
telescope.extensions() *telescope.extensions()*
|
||||||
|
|
||||||
Use telescope.extensions to reference any extensions within your
|
Use telescope.extensions to reference any extensions within your
|
||||||
configuration.
|
configuration. While the docs currently generate this as a function, it's
|
||||||
While the docs currently generate this as a function, it's actually a table.
|
actually a table. Sorry.
|
||||||
Sorry.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
telescope.load_extension({name}) *telescope.load_extension()*
|
telescope.load_extension({name}) *telescope.load_extension()*
|
||||||
|
|
||||||
Load an extension.
|
Load an extension.
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +25,6 @@ telescope.load_extension({name}) *telescope.load_extension()*
|
|||||||
|
|
||||||
|
|
||||||
telescope.register_extension({mod}) *telescope.register_extension()*
|
telescope.register_extension({mod}) *telescope.register_extension()*
|
||||||
|
|
||||||
Register an extension. To be used by plugin authors.
|
Register an extension. To be used by plugin authors.
|
||||||
|
|
||||||
|
|
||||||
@@ -40,56 +33,52 @@ telescope.register_extension({mod}) *telescope.register_extension()*
|
|||||||
|
|
||||||
|
|
||||||
telescope.setup({opts}) *telescope.setup()*
|
telescope.setup({opts}) *telescope.setup()*
|
||||||
|
Setup function to be run by user. Configures the defaults, extensions and
|
||||||
Setup function to be run by user. Configures the defaults, extensions
|
other aspects of telescope.
|
||||||
and other aspects of telescope.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Valid keys for {opts.defaults}
|
Valid keys for {opts.defaults}
|
||||||
|
|
||||||
*telescope.defaults.entry_prefix*
|
*telescope.defaults.entry_prefix* entry_prefix: ~ Prefix in front of each
|
||||||
entry_prefix: ~
|
result entry. Current selection not included.
|
||||||
Prefix in front of each result entry. Current selection not included.
|
|
||||||
|
|
||||||
Default: ' '
|
Default: ' '
|
||||||
|
|
||||||
*telescope.defaults.prompt_prefix*
|
*telescope.defaults.prompt_prefix* prompt_prefix: ~ Will be shown in front
|
||||||
prompt_prefix: ~
|
of the prompt.
|
||||||
Will be shown in front of the prompt.
|
|
||||||
|
|
||||||
Default: '> '
|
Default: '> '
|
||||||
|
|
||||||
*telescope.defaults.scroll_strategy*
|
*telescope.defaults.scroll_strategy* scroll_strategy: ~ Determines what
|
||||||
scroll_strategy: ~
|
happens you try to scroll past view of the picker.
|
||||||
Determines what happens you try to scroll past view of the picker.
|
|
||||||
|
|
||||||
Available options are:
|
Available options
|
||||||
- "cycle" (default)
|
are:
|
||||||
- "limit"
|
- "cycle" (default)
|
||||||
|
- "limit"
|
||||||
|
|
||||||
*telescope.defaults.selection_caret*
|
*telescope.defaults.selection_caret* selection_caret: ~ Will be shown in
|
||||||
selection_caret: ~
|
front of the selection.
|
||||||
Will be shown in front of the selection.
|
|
||||||
|
|
||||||
Default: '> '
|
Default: '> '
|
||||||
|
|
||||||
*telescope.defaults.selection_strategy*
|
*telescope.defaults.selection_strategy* selection_strategy: ~ Determines
|
||||||
selection_strategy: ~
|
how the cursor acts after each sort iteration.
|
||||||
Determines how the cursor acts after each sort iteration.
|
|
||||||
|
|
||||||
Available options are:
|
Available options are:
|
||||||
- "reset" (default)
|
-
|
||||||
- "follow"
|
"reset" (default)
|
||||||
- "row"
|
- "follow"
|
||||||
|
- "row"
|
||||||
|
|
||||||
*telescope.defaults.sorting_strategy*
|
*telescope.defaults.sorting_strategy* sorting_strategy: ~ Determines the
|
||||||
sorting_strategy: ~
|
direction "better" results are sorted towards.
|
||||||
Determines the direction "better" results are sorted towards.
|
|
||||||
|
|
||||||
Available options are:
|
Available options are:
|
||||||
- "descending" (default)
|
-
|
||||||
- "ascending"
|
"descending" (default)
|
||||||
|
- "ascending"
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opts} (table) Configuration opts. Keys: defaults, extensions
|
{opts} (table) Configuration opts. Keys: defaults, extensions
|
||||||
@@ -107,11 +96,10 @@ Any of these functions can just be called directly by doing:
|
|||||||
|
|
||||||
:lua require('telescope.builtin').$NAME()
|
:lua require('telescope.builtin').$NAME()
|
||||||
|
|
||||||
This will use the default configuration options.
|
This will use the default configuration options. Other configuration options
|
||||||
Other configuration options are still in flux at the moment
|
are still in flux at the moment
|
||||||
|
|
||||||
builtin.live_grep() *builtin.live_grep()*
|
builtin.live_grep() *builtin.live_grep()*
|
||||||
|
|
||||||
Live grep means grep as you type.
|
Live grep means grep as you type.
|
||||||
|
|
||||||
|
|
||||||
@@ -123,7 +111,6 @@ builtin.live_grep() *builtin.live_grep()*
|
|||||||
Actions functions that are useful for people creating their own mappings.
|
Actions functions that are useful for people creating their own mappings.
|
||||||
|
|
||||||
actions.add_selection({prompt_bufnr}) *actions.add_selection()*
|
actions.add_selection({prompt_bufnr}) *actions.add_selection()*
|
||||||
|
|
||||||
Add current entry to multi select
|
Add current entry to multi select
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +119,6 @@ actions.add_selection({prompt_bufnr}) *actions.add_selection()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_selection_better({prompt_bufnr})*actions.move_selection_better()*
|
actions.move_selection_better({prompt_bufnr})*actions.move_selection_better()*
|
||||||
|
|
||||||
Move the selection to the entry that has a better score
|
Move the selection to the entry that has a better score
|
||||||
|
|
||||||
|
|
||||||
@@ -141,7 +127,6 @@ actions.move_selection_better({prompt_bufnr})*actions.move_selection_better()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_selection_next({prompt_bufnr}) *actions.move_selection_next()*
|
actions.move_selection_next({prompt_bufnr}) *actions.move_selection_next()*
|
||||||
|
|
||||||
Move the selection to the next entry
|
Move the selection to the next entry
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +135,6 @@ actions.move_selection_next({prompt_bufnr}) *actions.move_selection_next()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_selection_previous({prompt_bufnr})*actions.move_selection_previous()*
|
actions.move_selection_previous({prompt_bufnr})*actions.move_selection_previous()*
|
||||||
|
|
||||||
Move the selection to the previous entry
|
Move the selection to the previous entry
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +143,6 @@ actions.move_selection_previous({prompt_bufnr})*actions.move_selection_previous(
|
|||||||
|
|
||||||
|
|
||||||
actions.move_selection_worse({prompt_bufnr}) *actions.move_selection_worse()*
|
actions.move_selection_worse({prompt_bufnr}) *actions.move_selection_worse()*
|
||||||
|
|
||||||
Move the selection to the entry that has a worse score
|
Move the selection to the entry that has a worse score
|
||||||
|
|
||||||
|
|
||||||
@@ -168,7 +151,6 @@ actions.move_selection_worse({prompt_bufnr}) *actions.move_selection_worse()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_to_bottom({prompt_bufnr}) *actions.move_to_bottom()*
|
actions.move_to_bottom({prompt_bufnr}) *actions.move_to_bottom()*
|
||||||
|
|
||||||
Move to the bottom of the picker
|
Move to the bottom of the picker
|
||||||
|
|
||||||
|
|
||||||
@@ -177,7 +159,6 @@ actions.move_to_bottom({prompt_bufnr}) *actions.move_to_bottom()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_to_middle({prompt_bufnr}) *actions.move_to_middle()*
|
actions.move_to_middle({prompt_bufnr}) *actions.move_to_middle()*
|
||||||
|
|
||||||
Move to the middle of the picker
|
Move to the middle of the picker
|
||||||
|
|
||||||
|
|
||||||
@@ -186,7 +167,6 @@ actions.move_to_middle({prompt_bufnr}) *actions.move_to_middle()*
|
|||||||
|
|
||||||
|
|
||||||
actions.move_to_top({prompt_bufnr}) *actions.move_to_top()*
|
actions.move_to_top({prompt_bufnr}) *actions.move_to_top()*
|
||||||
|
|
||||||
Move to the top of the picker
|
Move to the top of the picker
|
||||||
|
|
||||||
|
|
||||||
@@ -195,7 +175,6 @@ actions.move_to_top({prompt_bufnr}) *actions.move_to_top()*
|
|||||||
|
|
||||||
|
|
||||||
actions.remove_selection({prompt_bufnr}) *actions.remove_selection()*
|
actions.remove_selection({prompt_bufnr}) *actions.remove_selection()*
|
||||||
|
|
||||||
Remove current entry from multi select
|
Remove current entry from multi select
|
||||||
|
|
||||||
|
|
||||||
@@ -204,7 +183,6 @@ actions.remove_selection({prompt_bufnr}) *actions.remove_selection()*
|
|||||||
|
|
||||||
|
|
||||||
actions.toggle_selection({prompt_bufnr}) *actions.toggle_selection()*
|
actions.toggle_selection({prompt_bufnr}) *actions.toggle_selection()*
|
||||||
|
|
||||||
Toggle current entry status for multi select
|
Toggle current entry status for multi select
|
||||||
|
|
||||||
|
|
||||||
@@ -216,117 +194,82 @@ actions.toggle_selection({prompt_bufnr}) *actions.toggle_selection()*
|
|||||||
================================================================================
|
================================================================================
|
||||||
*telescope.layout*
|
*telescope.layout*
|
||||||
|
|
||||||
|
|
||||||
Layout strategies are different functions to position telescope.
|
Layout strategies are different functions to position telescope.
|
||||||
|
|
||||||
All layout strategies are functions with the following signature: >
|
All layout strategies are functions with the following signature: >
|
||||||
|
|
||||||
function(picker, columns, lines)
|
function(picker, columns, lines)
|
||||||
-- Do some calculations here...
|
-- Do some calculations here... return { preview = preview_configuration
|
||||||
return {
|
results = results_configuration, prompt = prompt_configuration, } end
|
||||||
preview = preview_configuration
|
<
|
||||||
results = results_configuration,
|
|
||||||
prompt = prompt_configuration,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
- picker : A Picker object. (docs coming soon)
|
- picker : A Picker object. (docs coming soon)
|
||||||
- columns : number Columns in the vim window
|
- columns : number Columns in the vim window
|
||||||
- lines : number Lines in the vim window
|
- lines : number Lines in the vim window
|
||||||
|
|
||||||
TODO: I would like to make these link to `telescope.layout_strategies.*`,
|
TODO: I would like to make these link to `telescope.layout_strategies.*`, but
|
||||||
but it's not yet possible.
|
it's not yet possible.
|
||||||
|
|
||||||
Available layout strategies include:
|
Available layout strategies include: horizontal:
|
||||||
horizontal:
|
|
||||||
- See |layout_strategies.horizontal|
|
- See |layout_strategies.horizontal|
|
||||||
|
|
||||||
vertical:
|
vertical:
|
||||||
- See |layout_strategies.vertical|
|
- See |layout_strategies.vertical|
|
||||||
|
|
||||||
flex:
|
flex:
|
||||||
- See |layout_strategies.flex|
|
- See |layout_strategies.flex|
|
||||||
|
|
||||||
Available tweaks to the settings in layout defaults include
|
Available tweaks to the settings in layout defaults include (can be applied to
|
||||||
(can be applied to horizontal and vertical layouts):
|
horizontal and vertical layouts): mirror (default is `false`):
|
||||||
mirror (default is `false`):
|
|
||||||
- Flip the view of the current layout:
|
- Flip the view of the current layout:
|
||||||
- If using horizontal: if `true`, swaps the location of the
|
- If using horizontal: if `true`, swaps the location of the results/prompt
|
||||||
results/prompt window and preview window
|
window and preview window
|
||||||
- If using vertical: if `true`, swaps the location of the results and
|
- If using vertical: if `true`, swaps the location of the results and
|
||||||
prompt windows
|
prompt windows
|
||||||
|
|
||||||
width_padding:
|
width_padding:
|
||||||
- How many cells to pad the width of Telescope's layout window
|
- How many cells to pad the width of Telescope's layout window
|
||||||
|
|
||||||
height_padding:
|
height_padding:
|
||||||
- How many cells to pad the height of Telescope's layout window
|
- How many cells to pad the height of Telescope's layout window
|
||||||
|
|
||||||
preview_width:
|
preview_width:
|
||||||
- Change the width of Telescope's preview window
|
- Change the width of Telescope's preview window
|
||||||
|
|
||||||
|
|
||||||
layout_strategies.center() *layout_strategies.center()*
|
layout_strategies.center() *layout_strategies.center()*
|
||||||
|
|
||||||
Centered layout wih smaller default sizes (I think)
|
Centered layout wih smaller default sizes (I think)
|
||||||
|
|
||||||
+--------------+
|
+--------------+ | Preview | +--------------+ | Prompt | +--------------+ |
|
||||||
| Preview |
|
Result | | Result | | Result | +--------------+
|
||||||
+--------------+
|
|
||||||
| Prompt |
|
|
||||||
+--------------+
|
|
||||||
| Result |
|
|
||||||
| Result |
|
|
||||||
| Result |
|
|
||||||
+--------------+
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout_strategies.flex() *layout_strategies.flex()*
|
layout_strategies.flex() *layout_strategies.flex()*
|
||||||
|
|
||||||
Swap between `horizontal` and `vertical` strategies based on the window
|
Swap between `horizontal` and `vertical` strategies based on the window
|
||||||
width
|
width
|
||||||
- Supports `vertical` or `horizontal` features
|
- Supports `vertical` or `horizontal` features
|
||||||
|
|
||||||
Uses:
|
Uses: flip_columns flip_lines
|
||||||
flip_columns
|
|
||||||
flip_lines
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout_strategies.horizontal() *layout_strategies.horizontal()*
|
layout_strategies.horizontal() *layout_strategies.horizontal()*
|
||||||
|
|
||||||
Horizontal previewer
|
Horizontal previewer
|
||||||
|
|
||||||
+-------------+--------------+
|
+-------------+--------------+ | | | | Results | | | | Preview | | | |
|
||||||
| | |
|
+-------------| | | Prompt | | +-------------+--------------+
|
||||||
| Results | |
|
|
||||||
| | Preview |
|
|
||||||
| | |
|
|
||||||
+-------------| |
|
|
||||||
| Prompt | |
|
|
||||||
+-------------+--------------+
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout_strategies.vertical() *layout_strategies.vertical()*
|
layout_strategies.vertical() *layout_strategies.vertical()*
|
||||||
|
|
||||||
Vertical perviewer stacks the items on top of each other.
|
Vertical perviewer stacks the items on top of each other.
|
||||||
|
|
||||||
+-----------------+
|
+-----------------+ | Previewer | | Previewer | | Previewer |
|
||||||
| Previewer |
|
+-----------------+ | Result | | Result | | Result | +-----------------+ |
|
||||||
| Previewer |
|
Prompt | +-----------------+
|
||||||
| Previewer |
|
|
||||||
+-----------------+
|
|
||||||
| Result |
|
|
||||||
| Result |
|
|
||||||
| Result |
|
|
||||||
+-----------------+
|
|
||||||
| Prompt |
|
|
||||||
+-----------------+
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user