mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 17:59:48 +01:00
21fcace3ed
* flake: add lz.n and lzn-auto-require * lazy: init module * lzn-auto-require: add init lua code * wrapper: fix opt plugin format * lib.binds: add lz.n variant of bind functions * telescope: lazy load * nvim-tree: lazy load * dapui: lazy load * trouble: lazy load * toggleterm: lazy load * cheatsheet: lazy load * diffview: lazy load * icon-picker: lazy load * leap: lazy load * fidget: lazy load * docs: add section on lazy plugins * lazy: support lazy.enable=false * comment-nvim: lazy load * surround-nvim: lazy load * neo-tree: lazy load * fixup! lazy: init module * dap: appease the nix gods (fix statix lint) * flake.lock: fix merge mistake * doc: update release note * fixup! doc: update release note * neo-tree: fix duplicate neo-tree install * lazy: use attrsOf for lazy.plugins * treewide: update lazy.plugins syntax * docs: update lazy.plugins syntax * lazy: cleanup * Update docs/manual/hacking/additional-plugins.md Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com> * formatting nitpick Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com> * typo tee hee :3 Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com> * typo tee hee :4 Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com> * flake: update lz.n * lazy: update lz.n plugin spec * lazy: allow lines in place of str for lua code * copilot: lazy load * cmp: lazy load this moves cmp itself to lazy.plugins but other plugins that call cmp are not yet lazy so cmp is technically not yet lazy * luasnip: lazy load * flake: add rtp.nvim * cmp: actually lazy load source * fixup! cmp: actually lazy load source * format * docs: fix broken link * cmp-nvim-lsp: lazy load * lazy: allow key mode of str type * cmp: install sourcess via cmp.sourcePlugins * Update docs/manual/hacking/additional-plugins.md Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com> * lazy: refactor common var * nvim-dap-ui: add setupOpts * refactor: re-order plugin and lz.n configs lazy: make lzn-auto-require togglable * docs: update dag-entries * trouble: remove redundant import * lazy: remove unused module arg * toggleterm: make lazygit keybind optional * toggleterm: use toLuaObject for clarity * surround: rework keymap config * remove stale FIXME * lsp: use cmp_nvim_lsp capabilities * cmp: deduplicate attr key * theme: ensure themes load before lazy plugins * doc: update description of `theme` dag entry * lsp: avoid loading cmp on startup * doc: update configuration docs on custom plugins * cmp: skip trigger_load if lazy disabled * treesitter: remove redundant code * lsp: mark hack as HACK * comment: remove redundant plugin * Squash merge v0.7 into feature/lzn --------- Co-authored-by: raf <raf@notashelf.dev> Co-authored-by: diniamo <55629891+diniamo@users.noreply.github.com>
80 lines
3.2 KiB
Nix
80 lines
3.2 KiB
Nix
{
|
|
options,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings;
|
|
inherit (lib.strings) optionalString;
|
|
inherit (lib.lists) optionals;
|
|
inherit (lib.nvim.binds) pushDownDefault mkSetLznBinding;
|
|
|
|
cfg = config.vim.telescope;
|
|
mappingDefinitions = options.vim.telescope.mappings;
|
|
|
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim = {
|
|
startPlugins = ["plenary-nvim"];
|
|
|
|
lazy.plugins.telescope = {
|
|
package = "telescope";
|
|
setupModule = "telescope";
|
|
inherit (cfg) setupOpts;
|
|
after = ''
|
|
local telescope = require("telescope")
|
|
${optionalString config.vim.ui.noice.enable "telescope.load_extension('noice')"}
|
|
${optionalString config.vim.notify.nvim-notify.enable "telescope.load_extension('notify')"}
|
|
${optionalString config.vim.projects.project-nvim.enable "telescope.load_extension('projects')"}
|
|
'';
|
|
|
|
cmd = ["Telescope"];
|
|
|
|
keys =
|
|
[
|
|
(mkSetLznBinding mappings.findFiles "<cmd> Telescope find_files<CR>")
|
|
(mkSetLznBinding mappings.liveGrep "<cmd> Telescope live_grep<CR>")
|
|
(mkSetLznBinding mappings.buffers "<cmd> Telescope buffers<CR>")
|
|
(mkSetLznBinding mappings.helpTags "<cmd> Telescope help_tags<CR>")
|
|
(mkSetLznBinding mappings.open "<cmd> Telescope<CR>")
|
|
|
|
(mkSetLznBinding mappings.gitCommits "<cmd> Telescope git_commits<CR>")
|
|
(mkSetLznBinding mappings.gitBufferCommits "<cmd> Telescope git_bcommits<CR>")
|
|
(mkSetLznBinding mappings.gitBranches "<cmd> Telescope git_branches<CR>")
|
|
(mkSetLznBinding mappings.gitStatus "<cmd> Telescope git_status<CR>")
|
|
(mkSetLznBinding mappings.gitStash "<cmd> Telescope git_stash<CR>")
|
|
]
|
|
++ (optionals config.vim.lsp.enable [
|
|
(mkSetLznBinding mappings.lspDocumentSymbols "<cmd> Telescope lsp_document_symbols<CR>")
|
|
(mkSetLznBinding mappings.lspWorkspaceSymbols "<cmd> Telescope lsp_workspace_symbols<CR>")
|
|
|
|
(mkSetLznBinding mappings.lspReferences "<cmd> Telescope lsp_references<CR>")
|
|
(mkSetLznBinding mappings.lspImplementations "<cmd> Telescope lsp_implementations<CR>")
|
|
(mkSetLznBinding mappings.lspDefinitions "<cmd> Telescope lsp_definitions<CR>")
|
|
(mkSetLznBinding mappings.lspTypeDefinitions "<cmd> Telescope lsp_type_definitions<CR>")
|
|
(mkSetLznBinding mappings.diagnostics "<cmd> Telescope diagnostics<CR>")
|
|
])
|
|
++ (
|
|
optionals config.vim.treesitter.enable [
|
|
(mkSetLznBinding mappings.treesitter "<cmd> Telescope treesitter<CR>")
|
|
]
|
|
)
|
|
++ (
|
|
optionals config.vim.projects.project-nvim.enable [
|
|
(mkSetLznBinding mappings.findProjects "<cmd Telescope projects<CR>")
|
|
]
|
|
);
|
|
};
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
"<leader>f" = "+Telescope";
|
|
"<leader>fl" = "Telescope LSP";
|
|
"<leader>fm" = "Cellular Automaton";
|
|
"<leader>fv" = "Telescope Git";
|
|
"<leader>fvc" = "Commits";
|
|
};
|
|
};
|
|
};
|
|
}
|