Exploring AI-generated code (via DeepSeekAI) in Notepad++: Any suggestions?
-
Hey everyone,
I’ve recently started experimenting with AI-generated code using DeepSeekAI, and I often paste the resulting snippets into Notepad++ to review and tweak them. It’s surprisingly helpful—especially when you want boilerplate logic fast without the usual search-and-paste loop.
That said, AI code isn’t always pristine. Sometimes the indentation is a mess, or the variable names are downright confusing (tempDataLayer42, anyone? 😂).
Do you have any pro tips or plugin recommendations for cleaning up, analyzing, or refactoring AI-generated snippets in Notepad++? Maybe syntax highlighting tweaks, auto-format tools, regex replacements, or clever macros that make the process smoother?
Would love to hear how you tame your AI code craziness!
-
My answer is not “AI” specific.
Maybe syntax highlighting tweaks,
Notepad++ syntax highlighting is already pretty good; I’m not sure there is anything that needs to be “tweaked” in that regard when looking at code that you don’t create.
auto-format tools,
Notepad++ does not have built-in per-language code cleanup (“auto-format”, indentation fix, etc), because very few languages have One Right Way to format – and those that think they do actually have multiple factions who do things slightly differently, anyway. Notepad++ would never be able to get enough options to make everyone happy for all 90+ of the built-in programming languages that it has syntax highlighting for, let alone the uncountable number of possible UDLs that might exist.
That said, there are plenty of language-specific plugins for Notepad++: if you’re generating XML, then XML Tools will help you format it; if you’re working with JSON, then JsonTools or JSON Viewer would be helpful; etc. And generically, @Michael-Vincent shares an example script for the NppExec plugin that is able to run an external “pretty print” utility for multiple languages depending on file extension in this post: his script does it for C, HTML, Perl, and Python, but it shows the pattern, so if you were getting code for another language, you could definitely call any external “pretty print” for whatever language you are using.
Also, @Ekopalypse has the NppLspClient plugin, which will allow you to connect to an LSP Server for your language – and the tips page shows examples of how to configure it for various languages. Some LSP servers will respond to the Plugins > NppLspClient > Format Document or Format Selected Text commands by formatting according to the server’s settings – but not all do.
regex replacements, or clever macros that make the process smoother?
Every regex (or regex/editing macro) is specific to a very limited transformation; coming up with a generic one for something as indefinite as “fixes AI-generated code” is impossible. About the closest we come is our FAQ: Generic regex formulas, which lists a few different template regex, that you can use as a starting space for doing common tasks that we’ve seen requested year after year – though none of them are specific to “AI code craziness”.