{ 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"; } ]; }; }