From c38340b04625f94300653c2a1142044a0f649f3b Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 20 May 2024 10:44:23 +0300 Subject: [PATCH] profiles: add recommended keymaps for luasnip --- modules/profiles/recommended.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/profiles/recommended.nix b/modules/profiles/recommended.nix index 39f1791..ec52d62 100644 --- a/modules/profiles/recommended.nix +++ b/modules/profiles/recommended.nix @@ -124,7 +124,24 @@ in { mode = "n"; lhs = leader "fg"; - rhs = lambda0 (call0 "telescope.extensions.live_grep_args.live_grep_args"); + rhs = lambda0 (pipe [ + config.plugin.telescope-nvim.var + "extensions" + "live_grep_args" + (call0 "live_grep_args") + ]); + } + ] + ) ++ lib.optionals config.plugins.snippet.luasnip.enable ( + let ls = pipe1 config.plugin.luasnip.var; in [ + { mode = "i"; lhs = ctrl "K"; rhs = lambda0 (ls (call0 "expand")); silent = true; } + { mode = [ "i" "s" ]; lhs = ctrl "L"; rhs = lambda0 (ls (call "jump" 1)); silent = true; } + { mode = [ "i" "s" ]; lhs = ctrl "H"; rhs = lambda0 (ls (call "jump" (- 1))); silent = true; } + { + mode = [ "i" "s" ]; + lhs = ctrl "E"; + rhs = lambda0 (if' (ls (call0 "choice_active")) (ls (call "change_choice" 1))); + silent = true; } ] );