Skip to content

Commit 6aa5042

Browse files
committed
update
1 parent 8426a4b commit 6aa5042

File tree

3 files changed

+211
-123
lines changed

3 files changed

+211
-123
lines changed

README.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,51 @@ status is kept synchronized.
2424

2525
## Usage
2626

27-
**Require neovim nightly**
27+
Install with any plugin manager or builtin `:help packages`.
2828

2929
```lua
3030
require('phoenix').setup()
3131
```
3232

33+
Phoenix can work with any completion plugin which support lsp source or neovim
34+
nightly `vim.lsp.completion` module.
35+
36+
## Config
37+
3338
default config and custom in `vim.g.phoenix` option table.
3439

3540
```
41+
---Default configuration values for Phoenix
3642
{
43+
-- Enable for all filetypes by default
3744
filetypes = { '*' },
38-
-- Dictionary related settings
45+
46+
-- Dictionary settings control word storage and scoring
3947
dict = {
40-
-- Maximum number of words to store in the dictionary
41-
-- Higher values consume more memory but provide better completions
42-
max_words = 50000,
43-
44-
-- Minimum word length to be considered for completion
45-
-- Shorter words may create noise in completions
46-
min_word_length = 2,
47-
-- Time factor weight for sorting completions (0-1)
48-
-- Higher values favor recently used items more strongly
49-
recency_weight = 0.3,
50-
51-
-- Base weight for frequency in sorting (0-1)
52-
-- Complements recency_weight, should sum to 1
53-
frequency_weight = 0.7,
48+
capacity = 50000, -- Store up to 50k words
49+
min_word_length = 2, -- Ignore single-letter words
50+
weights = {
51+
recency = 0.3, -- 30% weight to recent usage
52+
frequency = 0.7, -- 70% weight to frequency
53+
},
54+
},
55+
56+
-- Cleanup settings control dictionary maintenance
57+
cleanup = {
58+
cleanup_batch_size = 1000, -- Process 1000 words per batch
59+
frequency_threshold = 0.1, -- Keep words used >10% of max frequency
60+
collection_batch_size = 100, -- Collect 100 words before yielding
61+
rebuild_batch_size = 100, -- Rebuild 100 words before yielding
62+
idle_timeout_ms = 1000, -- Wait 1s before cleanup
63+
cleanup_ratio = 0.9, -- Cleanup at 90% capacity
5464
},
5565
56-
-- Performance related settings
57-
scan = {
58-
cache_ttl = 5000,
59-
-- Number of items to process in each batch
60-
-- Higher values improve speed but may cause stuttering
61-
batch_size = 1000,
62-
-- Ignored the file or dictionary which matched the pattern
63-
ignore_patterns = {},
64-
65-
-- Throttle delay for dictionary updates in milliseconds
66-
-- Prevents excessive CPU usage during rapid file changes
67-
throttle_ms = 100,
66+
-- Scanner settings control filesystem interaction
67+
scanner = {
68+
scan_batch_size = 1000, -- Scan 1000 items per batch
69+
cache_duration_ms = 5000, -- Cache results for 5s
70+
throttle_delay_ms = 100, -- Wait 100ms between updates
71+
ignore_patterns = {}, -- No ignore patterns by default
6872
},
6973
}
7074
```

0 commit comments

Comments
 (0)