Skip to content

Commit

Permalink
docs: Add Lua-only key mappings examples (#2174)
Browse files Browse the repository at this point in the history
(cherry picked from commit 63e2790)
  • Loading branch information
sestrella authored and Conni2461 committed Jan 6, 2023
1 parent b263bcb commit 803dd70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ to get an understanding of how to use Telescope and how to configure it.
Try the command `:Telescope find_files<cr>`
to see if `telescope.nvim` is installed correctly.

Using VimL:

```viml
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
Expand All @@ -130,6 +132,16 @@ nnoremap <leader>fb <cmd>lua require('telescope.builtin').buffers()<cr>
nnoremap <leader>fh <cmd>lua require('telescope.builtin').help_tags()<cr>
```

Using Lua:

```lua
local builtin = require('telescope.builtin')
vim.keymap.set('n', 'ff', builtin.find_files, {})
vim.keymap.set('n', 'fg', builtin.live_grep, {})
vim.keymap.set('n', 'fb', builtin.buffers, {})
vim.keymap.set('n', 'fh', builtin.help_tags, {})
```

See [builtin pickers](#pickers) for a list of all builtin functions.

## Customization
Expand Down

0 comments on commit 803dd70

Please sign in to comment.