From 2122a01f99c6da466b8f0f55c965c11a9043d117 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 9 Nov 2024 12:35:44 +0100 Subject: refactor(modules/legacy/conf/nvim): Move to `by-name` --- .../by-name/nv/nvim/plgs/goto-preview/default.nix | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/by-name/nv/nvim/plgs/goto-preview/default.nix (limited to 'modules/by-name/nv/nvim/plgs/goto-preview/default.nix') diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix new file mode 100644 index 00000000..5c56fe8c --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix @@ -0,0 +1,50 @@ +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # TODO: package goto-preview though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/goto-preview.lua} + ''; + extraPlugins = [ + pkgs.vimPlugins.goto-preview + ]; + keymaps = [ + { + key = "gd"; + mode = "n"; + action.__raw = "require('goto-preview').goto_preview_definition"; + options.desc = "[G]oto [D]efinition"; + } + { + key = "gtd"; + mode = "n"; + action.__raw = "require('goto-preview').goto_preview_type_definition"; + options.desc = "[G]oto the [t]ype [D]efinition"; + } + { + key = "gi"; + mode = "n"; + action.__raw = "require('goto-preview').goto_preview_implementation"; + options.desc = "[G]oto [I]mplementations"; + } + { + key = "gr"; + mode = "n"; + action.__raw = "require('goto-preview').goto_preview_references"; + options.desc = "[G]o to all [R]eferences of the symbol"; + } + { + key = "\\"; + mode = "n"; + action.__raw = "require('goto-preview').close_all_win"; + options.desc = "close all preview windows"; + } + ]; + }; +} -- cgit 1.4.1