mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
feat: support opts.workspace (#68)
This commit is contained in:
parent
388016c512
commit
32f4b59ea1
18
README.md
18
README.md
@ -85,14 +85,28 @@ If no database is found when running Neovim with the plugin installed, a new one
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```vim
|
||||||
:Telescope frecency
|
:Telescope frecency
|
||||||
```
|
```
|
||||||
..or to map to a key:
|
|
||||||
|
or to map to a key:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
vim.api.nvim_set_keymap("n", "<leader><leader>", "<Cmd>lua require('telescope').extensions.frecency.frecency()<CR>", {noremap = true, silent = true})
|
vim.api.nvim_set_keymap("n", "<leader><leader>", "<Cmd>lua require('telescope').extensions.frecency.frecency()<CR>", {noremap = true, silent = true})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Use a specific workspace tag:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:Telescope frecency workspace=CWD
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```lua
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader><leader>", "<Cmd>lua require('telescope').extensions.frecency.frecency({ workspace = 'CWD' })<CR>", {noremap = true, silent = true})
|
||||||
|
```
|
||||||
|
|
||||||
Filter tags are applied by typing the `:tag:` name (adding surrounding colons) in the finder query.
|
Filter tags are applied by typing the `:tag:` name (adding surrounding colons) in the finder query.
|
||||||
Entering `:<Tab>` will trigger omnicompletion for available tags.
|
Entering `:<Tab>` will trigger omnicompletion for available tags.
|
||||||
|
|
||||||
|
|||||||
@ -194,7 +194,7 @@ local frecency = function(opts)
|
|||||||
if matched then
|
if matched then
|
||||||
query_text = query_text:sub(matched:len() + 1)
|
query_text = query_text:sub(matched:len() + 1)
|
||||||
end
|
end
|
||||||
new_filter = new_filter or state.default_workspace
|
new_filter = new_filter or opts.workspace or state.default_workspace
|
||||||
|
|
||||||
local new_finder
|
local new_finder
|
||||||
local results_updated = update_results(new_filter)
|
local results_updated = update_results(new_filter)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user