diff options
author | Soispha <soispha@vhack.eu> | 2023-08-29 21:30:42 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-08-29 21:30:42 +0200 |
commit | d1fd7ce887055d1edfe68cac4ca5fa5688cea5da (patch) | |
tree | e9a9810713725fb3f3f2ffb3a9a9962403042eac /hm/soispha/conf | |
parent | Feat(hm/conf/nvim/autocmds): Add mkdir autocmd (diff) | |
download | nixos-config-d1fd7ce887055d1edfe68cac4ca5fa5688cea5da.zip |
Feat(hm/conf/nvim/plgs/debugprint): Init
Diffstat (limited to 'hm/soispha/conf')
-rw-r--r-- | hm/soispha/conf/nvim/plugins/debugprint/default.nix | 77 | ||||
-rw-r--r-- | hm/soispha/conf/nvim/plugins/debugprint/lua/debugprint.lua | 4 | ||||
-rw-r--r-- | hm/soispha/conf/nvim/plugins/default.nix | 1 |
3 files changed, 82 insertions, 0 deletions
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; +}) + diff --git a/hm/soispha/conf/nvim/plugins/default.nix b/hm/soispha/conf/nvim/plugins/default.nix index 7bb02355..60855ba3 100644 --- a/hm/soispha/conf/nvim/plugins/default.nix +++ b/hm/soispha/conf/nvim/plugins/default.nix @@ -2,6 +2,7 @@ imports = [ ./colorscheme ./comment-nvim + ./debugprint ./femaco ./goto-preview ./harpoon |