From 42490fbef58a4427741c5966dbf835fb5f7c9faf Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 25 Sep 2024 19:22:07 +0200 Subject: common/nixvim: add leap plugin --- common/nixvim.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/nixvim.nix b/common/nixvim.nix index 7dccfab..b74e6d4 100644 --- a/common/nixvim.nix +++ b/common/nixvim.nix @@ -200,6 +200,47 @@ in }; } + # Leap + + { + key = ""; + mode = ["n" "x" "o"]; + action = "(leap-forward)"; + options.desc = "Leap forward to"; + } + + { + key = ""; + mode = ["n" "x" "o"]; + action = "(leap-backward)"; + options.desc = "Leap backward to"; + } + + { + key = "g"; + mode = ["n" "x" "o"]; + action = "(leap-from-window)"; + options.desc = "Leap from window"; + } + + { + key = "gnn"; + mode = ["n" "x" "o"]; + action.__raw = '' + function() + require('leap.treesitter').select() + end + ''; + options.desc = "Start incremental selection"; + } + + { + key = "gnN"; + mode = ["n" "x" "o"]; + action = "Vlua require('leap.treesitter').select()"; + options.desc = "Start linewise incremental selection"; + } + # Toggle options (toggle "c" "cursorline") (toggle "C" "cursorcolumn") @@ -332,6 +373,11 @@ in lastplace.enable = true; + leap = { + enable = true; + addDefaultMappings = false; + }; + lualine = { enable = true; iconsEnabled = false; @@ -505,10 +551,7 @@ in enable = true; nixvimInjections = true; - settings = { - incremental_selection.enable = true; - indent.enable = true; - }; + settings.indent.enable = true; }; treesitter-context = { -- cgit v1.2.3