diff --git a/modules/plugins/utility/gestures/gesture-nvim/config.nix b/modules/plugins/utility/gestures/gesture-nvim/config.nix index 2996f7d..9838c17 100644 --- a/modules/plugins/utility/gestures/gesture-nvim/config.nix +++ b/modules/plugins/utility/gestures/gesture-nvim/config.nix @@ -15,43 +15,47 @@ mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { config = mkIf cfg.enable { - vim.startPlugins = ["gesture-nvim"]; + vim = { + startPlugins = ["gesture-nvim"]; - vim.maps.normal = mkMerge [ - (mkSetLuaBinding mappings.draw "require('gesture').draw") - (mkSetLuaBinding mappings.finish "require('gesture').finish") - (mkIf (mappings.draw.value == "") { - "" = {action = "";}; - }) - ]; + maps.normal = mkMerge [ + (mkSetLuaBinding mappings.draw "require('gesture').draw") + (mkSetLuaBinding mappings.finish "require('gesture').finish") + (mkIf (mappings.draw.value == "") { + "" = {action = "";}; + }) + ]; - vim.pluginRC.gesture-nvim = entryAnywhere '' - vim.opt.mouse = "a" + options.mouse = "a"; + pluginRC.gesture-nvim = entryAnywhere '' + local gesture = require("gesture") + gesture.register({ + name = "scroll to bottom", + inputs = { gesture.up(), gesture.down() }, + action = "normal! G", + }) - local gesture = require("gesture") - gesture.register({ - name = "scroll to bottom", - inputs = { gesture.up(), gesture.down() }, - action = "normal! G", - }) - gesture.register({ - name = "next tab", - inputs = { gesture.right() }, - action = "tabnext", - }) - gesture.register({ - name = "previous tab", - inputs = { gesture.left() }, - action = function(ctx) -- also can use callable - vim.cmd.tabprevious() - end, - }) - gesture.register({ - name = "go back", - inputs = { gesture.right(), gesture.left() }, - -- map to `` keycode - action = [[lua vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true)]], - }) - ''; + gesture.register({ + name = "next tab", + inputs = { gesture.right() }, + action = "tabnext", + }) + + gesture.register({ + name = "previous tab", + inputs = { gesture.left() }, + action = function(ctx) -- also can use callable + vim.cmd.tabprevious() + end, + }) + + gesture.register({ + name = "go back", + inputs = { gesture.right(), gesture.left() }, + -- map to `` keycode + action = [[lua vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true)]], + }) + ''; + }; }; } diff --git a/modules/plugins/utility/gestures/gesture-nvim/default.nix b/modules/plugins/utility/gestures/gesture-nvim/default.nix index 27e7e09..4c7987e 100644 --- a/modules/plugins/utility/gestures/gesture-nvim/default.nix +++ b/modules/plugins/utility/gestures/gesture-nvim/default.nix @@ -1,4 +1,4 @@ -_: { +{ imports = [ ./gesture-nvim.nix ./config.nix