Skip to content

MKMalik/debug_printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debug Printer - A Simple & Smart Debugging Plugin for Neovim 🚀

Debug Printer is a lightweight Neovim plugin that automatically generates print/debug statements for selected text, helping you debug faster across multiple programming languages.

✨ Features

  • 🖱️ Works in Normal & Visual Mode – Select words, expressions, or blocks effortlessly.
  • 🔄 Auto-Detects File Type – Inserts the correct print statement for Java, Python, JavaScript, C++, and more.
  • Seamless Key Mapping – Default: <leader>pp (configurable).
  • 🔧 Customizable – Override print formats and key bindings easily.

📌 Supported Languages

  • JavaSystem.out.println("var: " + var);
  • JavaScript/TypeScriptconsole.log("var:", var);
  • Pythonprint("var:", var)
  • C++std::cout << "var: " << var << std::endl;
  • Cprintf("var: %d\n", var);

🛠️ Installation

Using Lazy.nvim

require("lazy").setup({
  {     "MKMalik/debug_printer",   }
})

Using packpath

git clone https://github.com/MKMalik/debug_printer ~/.config/nvim/pack/plugins/start/debug_printer

🚀 Usage

  • Normal Mode: Place cursor on a variable → Press <leader>pp
  • Visual Mode: Select text → Press <leader>pp
  • Print statement is inserted in the next line automatically!

⚙️ Customization

Override key mappings and formats in init.lua:

require("debug_printer").setup({
  keymap_normal = "<leader>d",
  keymap_visual = "<leader>d",
  print_statements = {
    python = 'print("DEBUG:", %s)',
    javascript = 'console.warn("DEBUG:", %s);',
  }
})

💡 Why Use Debug Printer?

  • Faster debugging without manually typing print statements.
  • Works with any codebase, whether small scripts or large projects.
  • No dependencies, pure Lua for maximum performance.

📜 License

MIT License. Contributions are welcome! 🎉

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published