Merge pull request #46 from rockerBOO/mappings-docs
Add Mappings to README
This commit is contained in:
46
README.md
46
README.md
@@ -71,6 +71,24 @@ nnoremap <Leader>p :lua require'telescope.builtin'.git_files{}<CR>
|
|||||||
nnoremap <silent> gr <cmd>lua require'telescope.builtin'.lsp_references{}<CR>
|
nnoremap <silent> gr <cmd>lua require'telescope.builtin'.lsp_references{}<CR>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Mappings
|
||||||
|
|
||||||
|
Mappings are fully customizable. Many familiar mapping patterns are setup as defaults.
|
||||||
|
|
||||||
|
```
|
||||||
|
<C-n>/<C-p> next/previous
|
||||||
|
<Down>/<Up> next/previous
|
||||||
|
<CR> go to file selection
|
||||||
|
|
||||||
|
<C-x> go to file selection as a split
|
||||||
|
<C-v> go to file selection as a vertical split
|
||||||
|
<C-t> go to a file in a new tab
|
||||||
|
|
||||||
|
j/k next/previous (in insert mode)
|
||||||
|
```
|
||||||
|
|
||||||
|
Attaching your own mappings is possible and additional information will come soon.
|
||||||
|
|
||||||
## Status (Unstable API)
|
## Status (Unstable API)
|
||||||
|
|
||||||
While the underlying API & Infrastructure (A.K.A. Spaghetti Code) is still very much WIP and
|
While the underlying API & Infrastructure (A.K.A. Spaghetti Code) is still very much WIP and
|
||||||
@@ -169,12 +187,15 @@ Search on all workspace symbols.
|
|||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.treesitter{
|
require'telescope.builtin'.treesitter{
|
||||||
-- Optional
|
-- Optional
|
||||||
-- bufnr = Buffer handle
|
-- bufnr = Buffer number
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
#### Treesitter
|
||||||
|
|
||||||
Search on function names, variables, from Treesitter!
|
Search on function names, variables, from Treesitter!
|
||||||
|
|
||||||
|
#### Telescope
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'telescope.builtin'.planets{}
|
require'telescope.builtin'.planets{}
|
||||||
```
|
```
|
||||||
@@ -225,25 +246,14 @@ Defaults:
|
|||||||
```lua
|
```lua
|
||||||
-- lua/telescope/pickers.lua
|
-- lua/telescope/pickers.lua
|
||||||
Picker:new{
|
Picker:new{
|
||||||
prompt = "Git Files", -- REQUIRED
|
prompt = "", -- REQUIRED
|
||||||
finder = FUNCTION, -- REQUIRED
|
finder = FUNCTION, -- see lua/telescope/finder.lua
|
||||||
sorter = FUNCTION, -- REQUIRED
|
sorter = FUNCTION, -- see lua/telescope/sorter.lua
|
||||||
previewer = FUNCTION, -- REQUIRED
|
previewer = FUNCTION, -- see lua/telescope/previewer.lua
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<C-n>"] = require'telescope.actions'.move_selection_next,
|
|
||||||
["<C-p>"] = require'telescope.actions'.move_selection_previous,
|
|
||||||
["<CR>"] = require'telescope.actions'.goto_file_selection,
|
|
||||||
},
|
|
||||||
|
|
||||||
n = {
|
|
||||||
["<esc>"] = require'telescope.actions'.close,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selection_strategy = "reset", -- follow, reset, line
|
selection_strategy = "reset", -- follow, reset, line
|
||||||
border = {},
|
border = {},
|
||||||
borderchars = { '─', '│', '─', '│', '┌', '┐', '┘', '└'},
|
borderchars = {"─", "│", "─", "│", "┌", "┐", "┘", "└"},
|
||||||
preview_cutoff = 120
|
preview_cutoff = 120,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user