{ pkgs, config, lib, ... }: with lib; with builtins; let cfg = config.vim.telescope; in { options.vim.telescope = { enable = mkEnableOption "enable telescope"; }; config = mkIf (cfg.enable) { vim.startPlugins = [ "telescope" ]; vim.nnoremap = { "ff" = " Telescope find_files"; "fg" = " Telescope live_grep"; "fb" = " Telescope buffers"; "fh" = " Telescope help_tags"; "ft" = " Telescope"; "fvcw" = " Telescope git_commits"; "fvcb" = " Telescope git_bcommits"; "fvb" = " Telescope git_branches"; "fvs" = " Telescope git_status"; "fvx" = " Telescope git_stash"; } // ( if config.vim.lsp.enable then { "flsb" = " Telescope lsp_document_symbols"; "flsw" = " Telescope lsp_workspace_symbols"; "flr" = " Telescope lsp_references"; "fli" = " Telescope lsp_implementations"; "flD" = " Telescope lsp_definitions"; "flt" = " Telescope lsp_type_definitions"; "fld" = " Telescope diagnostics"; } else {} ) // ( if config.vim.treesitter.enable then { "fs" = " Telescope treesitter"; } else {} ); vim.luaConfigRC.telescope = nvim.dag.entryAnywhere '' local telescope = require('telescope') telescope.setup { defaults = { vimgrep_arguments = { "${pkgs.ripgrep}/bin/rg", "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }, pickers = { find_command = { "${pkgs.fd}/bin/fd", }, }, } } ${ if config.vim.ui.noice.enable then "telescope.load_extension('noice')" else null } ${ if config.vim.notify.nvim-notify.enable then "telescope.load_extension('notify')" else null } ''; }; }