Skip to content

Commit

Permalink
[docgen] Update doc/telescope.txt
Browse files Browse the repository at this point in the history
skip-checks: true
  • Loading branch information
Github Actions committed Mar 10, 2021
1 parent 705940a commit 10c8171
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,48 +43,63 @@ telescope.setup({opts}) *telescope.setup()*

Valid keys for {opts.defaults}

*telescope.defaults.dynamic_preview_title*
dynamic_preview_title: ~
Will change the title of the preview window dynamically, where it
is supported. Means the preview window will for example show the
full filename.

Default: false


*telescope.defaults.entry_prefix*
entry_prefix: ~
Prefix in front of each result entry. Current selection not included.

Default: ' '
Default: ' '


*telescope.defaults.prompt_prefix*
prompt_prefix: ~
Will be shown in front of the prompt.

Default: '> '
Default: '> '


*telescope.defaults.scroll_strategy*
scroll_strategy: ~
Determines what happens you try to scroll past view of the picker.

Available options are:
- "cycle" (default)
- "limit"
Available options are:
- "cycle" (default)
- "limit"


*telescope.defaults.selection_caret*
selection_caret: ~
Will be shown in front of the selection.

Default: '> '
Default: '> '


*telescope.defaults.selection_strategy*
selection_strategy: ~
Determines how the cursor acts after each sort iteration.

Available options are:
- "reset" (default)
- "follow"
- "row"
Available options are:
- "reset" (default)
- "follow"
- "row"


*telescope.defaults.sorting_strategy*
sorting_strategy: ~
Determines the direction "better" results are sorted towards.

Available options are:
- "descending" (default)
- "ascending"
Available options are:
- "descending" (default)
- "ascending"


Parameters: ~
{opts} (table) Configuration opts. Keys: defaults, extensions
Expand Down Expand Up @@ -250,6 +265,10 @@ previewers.Previewer() *previewers.Previewer()*
- `teardown` function(self): Will be called on cleanup.
- `preview_fn` function(self, entry, status): Will be called each time a
new entry was selected.
- `title` function(self): Will return the static title of the previewer.
- `dynamic_title` function(self, entry): Will return the dynamic title of
the previewer. Will only be called when config value
dynamic_preview_title is true.
- `send_input` function(self, input): This is meant for
`termopen_previewer` and it can be used to send input to the terminal
application, like less.
Expand Down Expand Up @@ -336,6 +355,9 @@ previewers.new_buffer_previewer() *previewers.new_buffer_previewer()*
one file but multiple entries. This happens for grep and lsp builtins.
So to make the cache work only load content if `self.state.bufname ~=
entry.your_unique_key`
- `title` a static title for example "File Preview"
- `dyn_title(self, entry)` a dynamic title function which gets called
when config value `dynamic_preview_title = true`

`self.state` table:
- `self.state.bufnr` Is the current buffer number, in which you have to
Expand Down Expand Up @@ -391,8 +413,15 @@ previewers.new_termopen_previewer() *previewers.new_termopen_previewer()*

It requires you to specify one table entry `get_command(entry, status)`.
This `get_command` function has to return the terminal command that will be
executed for each entry. Example: get_command = function(entry, status)
return { 'bat', entry.path } end
executed for each entry. Example:
get_command = function(entry, status)
return { 'bat', entry.path }
end

Additionally you can define:
- `title` a static title for example "File Preview"
- `dyn_title(self, entry)` a dynamic title function which gets called when
config value `dynamic_preview_title = true`

It's an easy way to get your first previewer going and it integrates well
with `bat` and `less`. Providing out of the box scrolling if the command
Expand Down

0 comments on commit 10c8171

Please sign in to comment.