mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
docs: add more notes & fix type annotations (#191)
Use `T[]` instead of `table<integer, T>` for consistency.
This commit is contained in:
parent
08a28ec511
commit
94a532cb9c
34
README.md
34
README.md
@ -32,6 +32,8 @@ timestamps and the total amount of times that the file has been loaded:
|
|||||||
|
|
||||||
### Recency values (per timestamp)
|
### Recency values (per timestamp)
|
||||||
|
|
||||||
|
These values are customizable in `setup()`.
|
||||||
|
|
||||||
| Timestamp age | Value |
|
| Timestamp age | Value |
|
||||||
| -------- | ---------- |
|
| -------- | ---------- |
|
||||||
| 4 hours | 100 |
|
| 4 hours | 100 |
|
||||||
@ -172,20 +174,6 @@ least, it matches against exact the same as you input.
|
|||||||
|
|
||||||
See [default configuration](https://github.com/nvim-telescope/telescope.nvim#telescope-defaults) for full details on configuring Telescope.
|
See [default configuration](https://github.com/nvim-telescope/telescope.nvim#telescope-defaults) for full details on configuring Telescope.
|
||||||
|
|
||||||
- `recency_values` (default: see follow)
|
|
||||||
|
|
||||||
```lua
|
|
||||||
-- recency_values default:
|
|
||||||
recency_values = {
|
|
||||||
{ age = 240, value = 100 }, -- past 4 hours
|
|
||||||
{ age = 1440, value = 80 }, -- past day
|
|
||||||
{ age = 4320, value = 60 }, -- past 3 days
|
|
||||||
{ age = 10080, value = 40 }, -- past week
|
|
||||||
{ age = 43200, value = 20 }, -- past month
|
|
||||||
{ age = 129600, value = 10 }, -- past 90 days
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- `auto_validate` (default: `true`)
|
- `auto_validate` (default: `true`)
|
||||||
|
|
||||||
If `true`, it removes stale entries count over than `db_validate_threshold`. See
|
If `true`, it removes stale entries count over than `db_validate_threshold`. See
|
||||||
@ -239,6 +227,24 @@ See [default configuration](https://github.com/nvim-telescope/telescope.nvim#tel
|
|||||||
timestamps when you open the file. It is reasonable to set this value more
|
timestamps when you open the file. It is reasonable to set this value more
|
||||||
than or equal to the default value: `10`.
|
than or equal to the default value: `10`.
|
||||||
|
|
||||||
|
- `recency_values` (default: see below)
|
||||||
|
|
||||||
|
Set weighting factors for calculating “frecency”. This option does not affect
|
||||||
|
values already recorded in DB. So you can change these values without spoiling
|
||||||
|
data.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- default values
|
||||||
|
recency_values = {
|
||||||
|
{ age = 240, value = 100 }, -- past 4 hours
|
||||||
|
{ age = 1440, value = 80 }, -- past day
|
||||||
|
{ age = 4320, value = 60 }, -- past 3 days
|
||||||
|
{ age = 10080, value = 40 }, -- past week
|
||||||
|
{ age = 43200, value = 20 }, -- past month
|
||||||
|
{ age = 129600, value = 10 }, -- past 90 days
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- `show_filter_column` (default: `true`)
|
- `show_filter_column` (default: `true`)
|
||||||
|
|
||||||
Show the path of the active filter before file paths. In default, it uses the
|
Show the path of the active filter before file paths. In default, it uses the
|
||||||
|
|||||||
@ -5,7 +5,7 @@ local os_util = require "frecency.os_util"
|
|||||||
local Config = {}
|
local Config = {}
|
||||||
|
|
||||||
---@class FrecencyRawConfig
|
---@class FrecencyRawConfig
|
||||||
---@field recency_values table<integer, { age: integer, value: integer }> default: {}
|
---@field recency_values { age: integer, value: integer }[] default: see lua/frecency/config.lua
|
||||||
---@field auto_validate boolean default: true
|
---@field auto_validate boolean default: true
|
||||||
---@field db_root string default: vim.fn.stdpath "data"
|
---@field db_root string default: vim.fn.stdpath "data"
|
||||||
---@field db_safe_mode boolean default: true
|
---@field db_safe_mode boolean default: true
|
||||||
@ -25,14 +25,6 @@ local Config = {}
|
|||||||
---@return FrecencyConfig
|
---@return FrecencyConfig
|
||||||
Config.new = function()
|
Config.new = function()
|
||||||
local default_values = {
|
local default_values = {
|
||||||
recency_values = {
|
|
||||||
{ age = 240, value = 100 }, -- past 4 hours
|
|
||||||
{ age = 1440, value = 80 }, -- past day
|
|
||||||
{ age = 4320, value = 60 }, -- past 3 days
|
|
||||||
{ age = 10080, value = 40 }, -- past week
|
|
||||||
{ age = 43200, value = 20 }, -- past month
|
|
||||||
{ age = 129600, value = 10 }, -- past 90 days
|
|
||||||
},
|
|
||||||
auto_validate = true,
|
auto_validate = true,
|
||||||
db_root = vim.fn.stdpath "data",
|
db_root = vim.fn.stdpath "data",
|
||||||
db_safe_mode = true,
|
db_safe_mode = true,
|
||||||
@ -44,6 +36,14 @@ Config.new = function()
|
|||||||
ignore_patterns = os_util.is_windows and { [[*.git\*]], [[*\tmp\*]], "term://*" }
|
ignore_patterns = os_util.is_windows and { [[*.git\*]], [[*\tmp\*]], "term://*" }
|
||||||
or { "*.git/*", "*/tmp/*", "term://*" },
|
or { "*.git/*", "*/tmp/*", "term://*" },
|
||||||
max_timestamps = 10,
|
max_timestamps = 10,
|
||||||
|
recency_values = {
|
||||||
|
{ age = 240, value = 100 }, -- past 4 hours
|
||||||
|
{ age = 1440, value = 80 }, -- past day
|
||||||
|
{ age = 4320, value = 60 }, -- past 3 days
|
||||||
|
{ age = 10080, value = 40 }, -- past week
|
||||||
|
{ age = 43200, value = 20 }, -- past month
|
||||||
|
{ age = 129600, value = 10 }, -- past 90 days
|
||||||
|
},
|
||||||
show_filter_column = true,
|
show_filter_column = true,
|
||||||
show_scores = false,
|
show_scores = false,
|
||||||
show_unindexed = true,
|
show_unindexed = true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user