From d1fd7ce887055d1edfe68cac4ca5fa5688cea5da Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 29 Aug 2023 21:30:42 +0200 Subject: Feat(hm/conf/nvim/plgs/debugprint): Init --- .../conf/nvim/plugins/debugprint/default.nix | 77 ++++++++++++++++++++++ .../nvim/plugins/debugprint/lua/debugprint.lua | 4 ++ 2 files changed, 81 insertions(+) create mode 100644 hm/soispha/conf/nvim/plugins/debugprint/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/debugprint/lua/debugprint.lua (limited to 'hm/soispha/conf/nvim/plugins/debugprint') diff --git a/hm/soispha/conf/nvim/plugins/debugprint/default.nix b/hm/soispha/conf/nvim/plugins/debugprint/default.nix new file mode 100644 index 00000000..522965ac --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/debugprint/default.nix @@ -0,0 +1,77 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package debugprint though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/debugprint.lua} + ''; + extraPlugins = [ + pkgs.vimExtraPlugins.debugprint-nvim + ]; + + maps = let + visualNormal = { + "g?v" = { + action = '' + function() + return require('debugprint').debugprint({variable = true;}); + end + ''; + lua = true; + expr = true; + desc = '' + 'variable' debug line below the current line + ''; + }; + "g?V" = { + action = '' + function() + return require('debugprint').debugprint({above = true; variable = true;}) ; + end + ''; + lua = true; + expr = true; + desc = '' + 'variable' debug line above the current line + ''; + }; + }; + in { + normal = + { + "g?p" = { + action = '' + function() + return require('debugprint').debugprint(); + end + ''; + lua = true; + expr = true; + desc = '' + 'plain' debug line below the current line + ''; + }; + "g?P" = { + action = '' + function() + return require('debugprint').debugprint({above = true;}); + end + ''; + lua = true; + expr = true; + desc = '' + 'plain' debug line above the current line + ''; + }; + } + // visualNormal; + visual = + { + } + // visualNormal; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/debugprint/lua/debugprint.lua b/hm/soispha/conf/nvim/plugins/debugprint/lua/debugprint.lua new file mode 100644 index 00000000..2ea38df4 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/debugprint/lua/debugprint.lua @@ -0,0 +1,4 @@ +require("debugprint").setup({ + create_keymaps = false; +}) + -- cgit 1.4.1