diff --git a/README.md b/README.md index d731ea6..6cbfc44 100644 --- a/README.md +++ b/README.md @@ -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", "", "lua require('telescope').extensions.frecency.frecency()", {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