mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2026-02-04 06:42:06 +00:00
feat: call init process before telescope loading (#234)
* feat: call init process before telescope loading Fix #231 This changes enable to load frecency without telescope's loading itself. This is needed when you want to load telescope lazily, but want to start registering process as soon as Neovim has started. ```lua { "nvim-telescope/telescope-frecency.nvim", main = "frecency", ---@type FrecencyOpts opts = { db_safe_mode = false, }, }, { "nvim-telescope/telescope.nvim", -- `cmd` opts makes lazy.nvim load telescope.nvim lazily. cmd = { "Telescope" }, config = function() local telescope = require "telescope" telescope.setup { extensions = { other_extension = { foo_bar = true, }, -- Here you need no configuration opts for frecency because -- you've already done. } } -- This is still needed. telescope.load_extension "frecency" end, }, ``` * docs: add note for loading telescope.nvim lazily
This commit is contained in:
committed by
GitHub
parent
cef01dee8b
commit
87ccbae5d2
@@ -134,6 +134,9 @@ If no database is found when running Neovim with the plugin installed, a new
|
||||
one is created and entries from |shada| and |v:oldfiles| are automatically
|
||||
imported.
|
||||
|
||||
NOTE: Even if you want to load |telescope.nvim| lazily, you should NOT load
|
||||
telescope-frecency.nvim lazily. See |telescope-frecency-function-setup|.
|
||||
|
||||
|
||||
==============================================================================
|
||||
USAGE *telescope-frecency-usage*
|
||||
@@ -315,6 +318,46 @@ Options: *telescope-frecency-function-query-options*
|
||||
exist below the directory specified this value. See also
|
||||
|telescope-frecency-usage|.
|
||||
|
||||
*telescope-frecency-function-setup*
|
||||
setup() ~
|
||||
|
||||
This will be called by |telescope.nvim| for its initialization. You can also
|
||||
call this to initialize this plugin separated from |telescope.nvim|'s
|
||||
initialization phase.
|
||||
|
||||
This is useful when you want to load |telescope.nvim| lazily, but want to
|
||||
register opened files as soon as Neovim has started. Example configuration for
|
||||
|lazy.nvim| is below.
|
||||
>lua
|
||||
{
|
||||
"nvim-telescope/telescope-frecency.nvim",
|
||||
main = "frecency",
|
||||
---@type FrecencyOpts
|
||||
opts = {
|
||||
db_safe_mode = false,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- `cmd` opts makes lazy.nvim load telescope.nvim lazily.
|
||||
cmd = { "Telescope" },
|
||||
config = function()
|
||||
local telescope = require "telescope"
|
||||
telescope.setup {
|
||||
extensions = {
|
||||
other_extension = {
|
||||
foo_bar = true,
|
||||
},
|
||||
-- Here you need no configuration opts for frecency because
|
||||
-- you've already done.
|
||||
}
|
||||
}
|
||||
-- This is still needed.
|
||||
telescope.load_extension "frecency"
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
==============================================================================
|
||||
CONFIGURATION *telescope-frecency-configuration*
|
||||
|
||||
Reference in New Issue
Block a user