feat: Add more easily customizable mappings.

Closes: #131
This commit is contained in:
TJ DeVries
2020-10-08 21:39:43 -04:00
parent fa17b37dad
commit c2c4626c3d
4 changed files with 125 additions and 50 deletions

View File

@@ -151,6 +151,50 @@ j k next | previous (in normal mode)
<Esc> close telescope (in normal mode)
```
To see the full list of mappings, check out `lua/telescope/mappings.lua` and the `default_mappings` table.
To change the default mappings globally, you can use the `mappings` key in the `setup` table.
```
To disable a keymap, put [map] = false
So, to not map "<C-n>", just put
...,
["<C-n>"] = false,
...,
Into your config.
Otherwise, just set the mapping to the function that you want it to be.
...,
["<C-i>"] = actions.goto_file_selection_split
...,
```
A full example:
```lua
local actions = require('telescope.actions')
require('telescope').setup {
defaults = {
mappings = {
i = {
-- Disable the default <c-x> mapping
["<c-x>"] = false,
-- Create a new <c-s> mapping
["<c-s>"] = actions.goto_file_selection_split,
},
},
}
}
```
Attaching your own mappings is possible and additional information will come soon.
Additionally, the prompt's filetype will be `TelescopePrompt`. You can customize the filetype as you would normally.