diff --git a/README.md b/README.md index 6ff0c9a7..f2afbf74 100644 --- a/README.md +++ b/README.md @@ -85,14 +85,28 @@ If no database is found when running Neovim with the plugin installed, a new one ## Usage -``` +```vim :Telescope frecency ``` -..or to map to a key: + +or to map to a key: ```lua vim.api.nvim_set_keymap("n", "", "lua require('telescope').extensions.frecency.frecency()", {noremap = true, silent = true}) ``` + +Use a specific workspace tag: + +```vim +:Telescope frecency workspace=CWD +``` + +or + +```lua +vim.api.nvim_set_keymap("n", "", "lua require('telescope').extensions.frecency.frecency({ workspace = 'CWD' })", {noremap = true, silent = true}) +``` + Filter tags are applied by typing the `:tag:` name (adding surrounding colons) in the finder query. Entering `:` will trigger omnicompletion for available tags. diff --git a/lua/telescope/_extensions/frecency.lua b/lua/telescope/_extensions/frecency.lua index b9ef5fa0..3ca3b6f0 100644 --- a/lua/telescope/_extensions/frecency.lua +++ b/lua/telescope/_extensions/frecency.lua @@ -194,7 +194,7 @@ local frecency = function(opts) if matched then query_text = query_text:sub(matched:len() + 1) end - new_filter = new_filter or state.default_workspace + new_filter = new_filter or opts.workspace or state.default_workspace local new_finder local results_updated = update_results(new_filter)