mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-01 08:34:41 +02:00
telescope: move plugin into seperate folder
This commit is contained in:
parent
bb2a9a9496
commit
6f8eb6f381
2 changed files with 53 additions and 1 deletions
|
@ -26,7 +26,6 @@
|
|||
./utils/goyo.nix
|
||||
./utils/endwise.nix
|
||||
./utils/easyescape.nix
|
||||
./utils/telescope.nix
|
||||
./utils/nvim-autopairs.nix
|
||||
./utils/intellitab.nix
|
||||
./utils/specs.nix
|
||||
|
@ -40,5 +39,7 @@
|
|||
|
||||
./nvim-lsp
|
||||
./nvim-lsp/lspsaga.nix
|
||||
|
||||
./telescope
|
||||
];
|
||||
}
|
||||
|
|
51
plugins/telescope/default.nix
Normal file
51
plugins/telescope/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope;
|
||||
helpers = (import ../helpers.nix { inherit lib; });
|
||||
in
|
||||
{
|
||||
# TODO:add support for aditional filetypes. This requires autocommands!
|
||||
|
||||
options.programs.nixvim.plugins.telescope = {
|
||||
enable = mkEnableOption "Enable telescope.nvim";
|
||||
|
||||
highlightTheme = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The colorscheme to use for syntax highlighting";
|
||||
default = config.programs.nixvim.colorscheme;
|
||||
};
|
||||
|
||||
enabledExtensions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "A list of enabled extensions. Don't use this directly";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraPackages = [ pkgs.bat ];
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
plenary-nvim
|
||||
popup-nvim
|
||||
];
|
||||
|
||||
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
|
||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
'';
|
||||
|
||||
extraConfigLua = ''
|
||||
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
||||
|
||||
require('telescope').setup{}
|
||||
|
||||
for i, extension in ipairs(__telescopeExtensions) do
|
||||
require('telescope').load_extension(extension)
|
||||
end
|
||||
'' ;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue