update readme

This commit is contained in:
Senghan Bright 2021-01-17 19:47:44 +01:00
parent aa93b2f8e6
commit 1db3bb17aa

View File

@ -44,30 +44,64 @@ This plugin uses `sql.nvim` to perform the database transactions.
## Installation
TODO: add installation instructions for other package managers
### [Packer.nvim](https://github.com/wbthomason/packer.nvim)
```
```lua
use {
"sunjon/telescope-frecency",
config = function()
require"telescope".load_extension("frecency")
end
}
```
_TODO: add installation instructions for other package managers_
If no database is found when running Neovim with the plugin installed, a new one is created and entries from `shada` `v:oldfiles` are automatically imported.
## Configuration
Function for keymaps
```lua
lua require("telescope").extensions.frecency.frecency(opts)
```
## Commands and Function
```
:Telescope frecency
```
..or to map to a key:
```lua
vim.api.nvim_set_keymap("n", "<leader><leader>", "<Cmd>lua require('telescope').extensions.frecency.frecency()<CR>", {noremap = true, silent = true})
```
## Configuration
See [default configuration](https://github.com/nvim-telescope/telescope.nvim#telescope-defaults) for full details on configuring Telescope.
- `ignore_patterns`
This setting controls which files are indexed (and subsequently which you'll see in the finder results).
- `show_scores`
To see the scores generated by the algorithm in the results, set this to `true`.
If you've not configured the extension, the following values are used:
```
telescope.setup {
extensions = {
frecency = {
show_scores = false,
ignore_patterns = {"*.git/*", "*/tmp/*"},
}
},
}
```
### Highlight Groups
```vim
TelescopePathSeparator
TelescopeBufferLoaded
```
## References