Before I begin, I want to immediately explain that in this article I do not propose to use Notepad ++ instead of any IDE. An IDE sharpened to fit your goals will always be better than a regular text editor, even though most of them are written in Java, more than 2 gigs of RAM are released, and generally insanely slow. However, the deep integration of IDE with version control systems, debuggers, “Go to definition” functions and other features make them indispensable.
In this article, I want to consider the case when you need to develop something serious in a system for which the IDE simply does not exist. In my case, this is the development of scripts for the game engine FOnline, which was already written more than once in Habré.
Some information about the FOnline engine:
- for its scripts it uses the AngelScript library, known in narrow circles
- has an advanced API
- There is a separate compiler for pre-checking scripts for syntax errors.
The process of writing scripts currently consists of the following steps:
- write a script
- check if it compiles at all
- connect script to server
- check the script in the game
Of course, in such conditions it is rather difficult to develop something, there is neither a ready-made framework for testing (no TDD), or a debugger.
But some conveniences with some limitations in Notepad ++ still manage to be realized:
- syntax highlighting
- autocompletion
- compilation with the ability to go to the place of an error by double-clicking
- “Go to definition” function
- mapping classes, variables, etc.
- document card
- fast transition to the previous cursor position
- more or less convenient implementation of double delimiters (single quotes, double quotes, etc.)
Of course, this is not enough for convenient development, but at least something.
Further in this article I want to tell you in detail how to implement all this in Notepad ++, but in order to avoid unnecessary questions, I will first tell you what functions I would like to see in npp, but which I did
NOT manage to implement:
- Integration with version control systems
It means not just items in the menu, like: show diff, commit, run, etc. I really miss the display of changed, added and deleted lines directly in the editor.
Such a plugin is, for example, for Sublime - github.com/jisaacks/GitGutter . Of course, only for git.
By the way, ideally, I would also like to be able to roll back these changes on a click, but I did not see this in the IDE.
But there is something similar for notepad ++: Location Navigate plugin. Which, besides its main function of logging the cursor position (for going back and forth), also displays the lines changed during the session, it has nothing to do with the version control system, but at least something. - Autocompletion for entities implemented in the script
There is an autocompet for reserved words and arguments of reserved functions, but there is no automatic script parsing for autocomplete purposes.
- Debagger
But this is not surprising, we have no debugger himself either ...
If in your case it is somehow available, you can see this plugin - DBGP . I did not understand, I can not say anything.
Now in order.
Syntax highlighting
The basic feature of notepad ++. It is configured including through the interface of the npp itself.

In general, the ability to flexibly customize a user-defined language in npp has been around for a long time, but not everyone knows that this feature has recently moved to a qualitatively new level called
UDL 2.0.Key features: the formation of a list of keywords, the definition of the syntax of the blocks, folding these blocks, the definition of numeric formats and, of course, customization of styles for all of this separately.
Note:Do not try to manually edit the UDL settings while running npp, it will erase all changes when you exit the program.
')
Autocompletion
The same basic npp feature, but not edited in the interface, this time you need to manually edit xml.
Key features: autocomplete reserved words and functions, creating descriptions for them, prompts for function parameters and information about returned values. In addition, overloaded functions are supported.
Details about setting here.Note:For autocomplete to work correctly, it is necessary that the lines in xml be correctly sorted in alphabetical order (details about sorting, taking into account special characters and numbers, were somewhere on the official wiki). It must be admitted that this moment is rather annoying, in the absence of the xml interface, you really have to edit it manually (writing your bike for generation is somehow lazy).
Clever compiler output processing
When I first started implementing the environment for developing FOnline scripts, I had to use the usual batch file call for syntax checking of scripts for a long time, passing it the way to the script. However, then one of the members of our community posted instructions on how to configure EditPlus to work with FOnline. It turned out that in this editor the possibility of parsing the output of compilers is there initially. At that time I was sure that such opportunities are only in the IDE and no one will bother with this functionality for a text editor. However, if there is such functionality in EditPlus, I still decided to go through the N ++ plugins again. To my surprise, a solution for notepad ++ was found: the
NppExec plugin.
The settings are quite flexible, I will not describe the process, everything is quite simple, just show the result:
NoteThe plugin does not allow you to add a button to launch the compiler on the toolbar, however, the Custom toolbar plugin does an excellent job with this task.
“Go to definition” function and display of entity list
In short, the
SourceCookifier plugin is suitable for this purpose.
Opportunities:
- on the basis of user-defined regular expressions, forms a list of various groups of entities: functions, classes, variables, and generally everything, whatever
- display of all this in the list
- go to the definition of the word by Ctrl + click
But if we talk in more detail, we can not say about the cons:
- Ctrl + click within one file
- entity groups are purely formal and generally defined by the user, so, at least for the UDL , you will not be able to see the tree structure of classes, variables, etc.
Note:- It is worth noting that I didn’t understand much about SourceCookifier and I can’t guarantee that the above is 100% correct. If someone notices mistakes, I will be glad to receive information.
- if you need the “go to definition” function for any more or less well-known language, you should look at the TagsJump plugin, there are already quick transitions between files
Document Map
Recently, this trendy functionality is available in n ++ right out of the box.
Works.
Fast transition to the previous cursor position
Plugin Location Navigate.
Works within the same file.
In addition, it highlights the saved and unsaved file changes that occurred since the launch of n ++.
Note:It is worth noting that the main function of this plugin is implemented in the SourceCookifier plugin described above.
Brackets, quotes ...
The placement of double quotes and closing brackets is done by the XBrackets Lite plugin. The solution is far from ideal, but at least some.
Note:In the n ++ naked settings, you can also enable automatic substitution of paired characters, but there this function is implemented completely clumsy and would be more annoying.
Afterword
At the moment, this is almost everything that I managed to squeeze out of the good old Notepad ++.
Of course, you can complain a lot that Notepad ++ exists only under Windows, that the sublime is much better than Notepad ++. It can be advised to switch to EditPlus or full-fledged IDEs (for which, of course, you have to implement most of the necessary functionality on your own). You can remember about Geany with its considerable possibilities to expand the functionality. But, based on personal experience, for the tasks described above notepad ++ is best suited. Perhaps I am mistaken, I can even assume that the above is already implemented in Sublime without too much cost. But, as in the case of notepad ++, all this functionality is most often scattered around a bunch of plugins and various documentation. And, if so, I would love to read more about them.
Thank you for your attention, be healthy.