docs: Add available API
This commit is contained in:
120
README.md
120
README.md
@@ -2,11 +2,26 @@
|
|||||||
|
|
||||||
Gaze deeply into unknown regions using the power of the moon.
|
Gaze deeply into unknown regions using the power of the moon.
|
||||||
|
|
||||||
|
## What is Telescope?
|
||||||
|
|
||||||
|
Telescope is a highly extendable fuzzy finder over lists. Items are shown in a popup with a prompt to search over.
|
||||||
|
|
||||||
|
Support for:
|
||||||
|
|
||||||
|
* LSP (references, document symbols, workspace symbols)
|
||||||
|
* Treesitter
|
||||||
|
* Grep
|
||||||
|
* Files (git, fd)
|
||||||
|
* Vim (command history, quickfix, loclist)
|
||||||
|
|
||||||
|
[What is telescope](https://www.twitch.tv/teej_dv/clip/RichDistinctPlumberPastaThat)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
[Example video](https://www.youtube.com/watch?v=65AVwHZflsU)
|
[Example video](https://www.youtube.com/watch?v=65AVwHZflsU)
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
@@ -67,57 +82,102 @@ wrappers over common tasks).
|
|||||||
### `builtin`
|
### `builtin`
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.git_files{
|
require'telescope.builtin'.builtin{
|
||||||
-- See Picker for additional options
|
-- Optional
|
||||||
show_preview = true, -- Show preview
|
-- hide_filename = true
|
||||||
prompt = "Git File",
|
-- ignore_filename = true
|
||||||
selection_strategy = "reset" -- follow, reset, line
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```lua
|
Handy documentation, showcase of all tools available in Telescope.
|
||||||
require'telescope.builtin'.live_grep{
|
|
||||||
-- See Picker for additional options
|
#### Files
|
||||||
prompt = "Live Grep",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.lsp_references{
|
require'telescope.builtin'.git_files{}
|
||||||
-- See Picker for additional options
|
|
||||||
prompt = 'LSP References'
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```lua
|
Search your files in a git repo. Ignores files in your .gitignore.
|
||||||
require'telescope.builtin'.quickfix{
|
|
||||||
-- See Picker for additional options
|
|
||||||
prompt = 'Quickfix'
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.loclist{
|
require'telescope.builtin'.fd{
|
||||||
-- See Picker for additional options
|
-- Optional
|
||||||
prompt = 'Loclist'
|
-- cwd = "/home/tj/"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Searches files in your working directory.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.grep_string{
|
require'telescope.builtin'.grep_string{
|
||||||
-- See Picker for additional options
|
|
||||||
prompt = 'Find Word',
|
|
||||||
search = false -- Search term or <cword>
|
search = false -- Search term or <cword>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.oldfiles{
|
require'telescope.builtin'.live_grep{}
|
||||||
-- See Picker for additional options
|
```
|
||||||
prompt = 'Oldfiles',
|
|
||||||
|
#### Vim
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.oldfiles{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Searches the vim oldfiles. See `:help v:oldfiles`
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.quickfix{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search on the quickfix. See `:help quickfix`
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.loclist{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search on the current window's location list.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.command_history{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search the vim command history.
|
||||||
|
|
||||||
|
#### LSP
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.lsp_references{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search on LSP references.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.lsp_document_symbols{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search on LSP Document Symbols in the current document.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.lsp_workspace_symbols{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Search on all workspace symbols.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.treesitter{
|
||||||
|
-- Optional
|
||||||
|
bufnr = -- Buffer handle
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Search on function names, variables, from Treesitter!
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require'telescope.builtin'.planets{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the telescope.
|
||||||
|
|
||||||
## Goals
|
## Goals
|
||||||
|
|
||||||
### Pipeline Different Objects
|
### Pipeline Different Objects
|
||||||
|
|||||||
Reference in New Issue
Block a user