mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
telescope-nvim: init
This commit is contained in:
parent
5474eba2fb
commit
080c8af710
3 changed files with 69 additions and 0 deletions
12
flake.nix
12
flake.nix
|
@ -39,7 +39,12 @@
|
|||
enable = true;
|
||||
};
|
||||
|
||||
extraPlugins = [
|
||||
pkgs.vimPlugins.vim-nix
|
||||
];
|
||||
|
||||
options.number = true;
|
||||
options.mouse = "a";
|
||||
|
||||
maps.normalVisualOp."ç" = ":";
|
||||
|
||||
|
@ -65,6 +70,13 @@
|
|||
servers.clangd.enable = true;
|
||||
};
|
||||
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
frecency.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
globals = {
|
||||
vimsyn_embed = "l";
|
||||
mapleader = " ";
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
./utils/startify.nix
|
||||
./utils/goyo.nix
|
||||
./utils/endwise.nix
|
||||
./utils/telescope.nix
|
||||
|
||||
./languages/treesitter.nix
|
||||
./languages/nix.nix
|
||||
|
|
56
plugins/utils/telescope.nix
Normal file
56
plugins/utils/telescope.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.telescope;
|
||||
in
|
||||
{
|
||||
# TODO Add support for aditional filetypes. This requires autocommands!
|
||||
|
||||
options.programs.nixvim.plugins.telescope = {
|
||||
enable = mkEnableOption "Enable telescope.nvim";
|
||||
|
||||
highlightTheme = mkOption {
|
||||
default = config.programs.nixvim.colorscheme;
|
||||
type = types.nullOr types.str;
|
||||
description = "The colorscheme to use for syntax highlighting";
|
||||
};
|
||||
|
||||
extensions = {
|
||||
frecency = {
|
||||
enable = mkEnableOption "Enable telescope-frecency";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
extensionPlugins = with cfg.extensions; with pkgs.vimPlugins;
|
||||
(optional frecency.enable telescope-frecency-nvim) ++
|
||||
(optional frecency.enable sql-nvim);
|
||||
|
||||
extensionPackages = with cfg.extensions; with pkgs;
|
||||
(optional frecency.enable sqlite);
|
||||
|
||||
extensions = with cfg.extensions;
|
||||
(optional frecency.enable "frecency");
|
||||
|
||||
loadExtensions = "require('telescope')" + (concatMapStrings (e: ".load_extension('${e}')") extensions);
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraPackages = with pkgs; [
|
||||
bat
|
||||
] ++ extensionPackages;
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
plenary-nvim
|
||||
popup-nvim
|
||||
] ++ extensionPlugins;
|
||||
|
||||
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
|
||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
'';
|
||||
|
||||
extraConfigLua = mkIf (extensions != []) loadExtensions;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue