Adding Telescope Extensions
Since everyone has different needs in their workflow, we have opted not to pre-configure any telescope extensions. You can, however, quite easily add your own in only a couple lines of code.
Let's use the very popular telescope-fzf-native.nvim
extension as an
example. From your configuration, simple declare the extension source.
Registration with telescope
will be handled automatically.
{ pkgs, ... }: {
telescope.extensions.fzf-native = {
# you can optionally specify `module` to override the lua module which is #
# called during `telescope.load_extension(<module>)`. By default, the name of
# the attribute set is used (in this case `fzf-native`, but since we
# specified a module name `fzf` will be used instead)
module = "fzf";
src =
pkgs.vimPlugins.telescope-fzf-native-nvim
// {
owner = "nvim-telescope";
repo = "fzf-native.nvim";
};
};
}
You can, of course, use any source type for src
, so fetchers such as
pkgs.fetchFromGithub
will work as well.
{pkgs, ... }: {
telescope.extensions.terraform_doc = {
enable = true;
src = pkgs.fetchFromGitHub {
owner = "ANGkeith";
repo = "telescope-terraform-doc.nvim";
rev = "4b539fc9a9b647dddebe6b0ccc3eac2a23e3ddcf";
hash = "sha256-8ry5Og/JLk0n3Ayx1YWUsQSJnA+FBXjilb3f1tKaE/4=";
};
};
# these options are passed to `extensions` in `telescope.setup()`
opts = {
wrap = "wrap";
};
}
Options
telescope.enable
Whether to enable telescope.
Type: boolean
Default:
false
Example:
true
Declared by:
telescope.extensions
The set of telescope extensions to make available.
Type: attribute set of (submodule)
Default:
{ }
Declared by:
telescope.extensions.<name>.module
The name of the lua module to load for this extension. If not set, the attribute’s name is used.
Type: null or string
Default:
null
Declared by:
telescope.extensions.<name>.opts
Options to use for this extension. These are passed into telescope’s
extension
opts during setup.
Type: attribute set
Default:
{ }
Declared by:
telescope.extensions.<name>.src
Source to use for this plugin. This allows you to swap out the pinned version with a newer revision/fork or add patches by creating a wrapper derivation.
Type: package
Declared by:
telescope.keys
A list of keybindings to set up for telescope. follows standard lazy keymap spec.
Type: list of (attribute set)
Default:
[ ]
Declared by:
telescope.opts
Options to pass to telescope
.
Type: attribute set
Default:
{ }
Declared by:
telescope.src
Source to use for this plugin. This allows you to swap out the pinned version with a newer revision/fork or add patches by creating a wrapper derivation.
Type: package
Default:
<derivation source>
Declared by: