Notepad

Transcription

notepad #notepad

Table of ContentsAbout1Chapter 1: Getting started with notepad 2Remarks2Versions2Examples9Installation or SetupChapter 2: Advanced Editing featuresExamples91010Multi-Editing10Column Editing11Chapter 3: Auto-completion and suggestionExamples1313Basic settings of Auto-completion and suggestions13Customization of language suggestion (function parameter hint)14Chapter 4: RegexExamplesReferencing Capture Groups161616Backreferences16Substitutions16More Than 9 Groups16Capture GroupsChapter 5: Useful plugins for developers1618Examples18NppExec18TextFX19JSON Viewer19SourceCookifier21Credits25

AboutYou can share this PDF with anyone you feel could benefit from it, downloaded the latest versionfrom: notepadplusplusIt is an unofficial and free notepad ebook created for educational purposes. All the content isextracted from Stack Overflow Documentation, which is written by many hardworking individuals atStack Overflow. It is neither affiliated with Stack Overflow nor official notepad .The content is released under Creative Commons BY-SA, and the list of contributors to eachchapter are provided in the credits section at the end of this book. Images may be copyright oftheir respective owners unless otherwise specified. All trademarks and registered trademarks arethe property of their respective company owners.Use the content presented in this book at your own risk; it is not guaranteed to be correct noraccurate, please send your feedback and corrections to info@zzzprojects.comhttps://riptutorial.com/1

Chapter 1: Getting started with notepad RemarksNotepad is a free (as in "free speech" and also as in "free beer") source code editorand Notepad replacement that supports several languages. Running in the MSWindows environment, its use is governed by GPL License. (Taken from official pages)Notepad provides several advantages for developers. It's no huge Integrated DevelopmentEnvironment, it's just simply a light-weight text editor.It provides syntax highlighting for various programming languages strong Search/Replace feature using Regular expression and being able to process openfiles or given folders line numbers auto-completion and parameters suggestion multi-editing macro recording and playing different style themes multiple execute commands many plugins to enhance the possibilities even furtherAll these features convince various developers to use this editor.VersionsVersionRelease DateVersion 7.3.32017-03-08Version 7.3.22017-02-13Version 7.3.12017-01-17Version 7.32017-01-01Version 7.2.22016-11-27Version 7.2.12016-11-20Version 7.22016-11-02Version 7.12016-10-16Version 7.02016-09-22https://riptutorial.com/2

VersionRelease DateVersion 6.9.22016-05-18Version 6.9.12016-03-28Version 6.92016-02-22Version 6.8.82015-12-10Version 6.8.72015-11-27Version 6.8.62015-10-29Version 6.8.52015-10-19Version 6.8.42015-10-16Version 6.8.32015-09-04Version 6.8.22015-08-20Version 6.8.12015-08-04Version 6.82015-07-21Version 6.7.52015-03-10Version 6.7.42015-01-10Version 6.7.32015-01-01Version 6.7.22014-12-27Version 6.7.12014-12-21Version 6.72014-12-14Version 6.6.92014-09-07Version 6.6.82014-07-27Version 6.6.72014-06-24Version 6.6.62014-06-13Version 6.6.42014-06-04Version 6.6.32014-05-18Version 6.6.22014-05-08https://riptutorial.com/3

VersionRelease DateVersion 6.6.12014-05-04Version 6.62014-05-01Version 6.5.52014-03-07Version 6.5.42014-02-18Version 6.5.32013-12-31Version 6.5.22013-12-10Version 6.5.12013-11-03Version 6.52013-09-29Version 6.4.52013-08-09Version 6.4.42013-08-08Version 6.4.32013-07-28Version 6.4.22013-07-09Version 6.4.12013-06-30Version 6.42013-06-29Version 6.3.32013-05-05Version 6.3.22013-04-03Version 6.3.12013-03-17Version 6.32013-02-03Version 6.2.32012-12-16Version 6.2.22012-11-18Version 6.2.12012-11-11Version 6.22012-10-10Version 6.1.82012-09-17Version 6.1.72012-09-11Version 6.1.62012-08-16https://riptutorial.com/4

VersionRelease DateVersion 6.1.52012-07-07Version 6.1.42012-06-24Version 6.1.32012-05-28Version 6.1.22012-04-26Version 6.1.12012-04-18Version 6.12012-04-10Version 6.02012-03-26Version 5.9.82012-01-05Version 5.9.6.22011-11-13Version 5.9.6.12011-11-05Version 5.9.62011-10-31Version 5.9.52011-10-23Version 5.9.42011-10-11Version 5.9.32011-07-24Version 5.9.22011-06-05Version 5.9.02011-03-31Version 5.8.72011-02-01Version 5.8.62010-12-19Version 5.8.52010-11-24Version 5.8.42010-11-14Version 5.8.32010-11-02Version 5.8.22010-10-11Version 5.8.12010-09-28Version 5.82010-09-22Version 5.72010-07-05https://riptutorial.com/5

VersionRelease DateVersion 5.6.82010-03-04Version 5.6.72010-02-21Version 5.6.62010-01-26Version 5.6.52010-01-25Version 5.6.42009-12-28Version 5.6.32009-12-18Version 5.6.22009-12-11Version 5.6.12009-12-05Version 5.62009-11-30Version 5.5.12009-10-09Version 5.52009-09-21Version 5.4.52009-07-14Version 5.4.42009-07-05Version 5.4.32009-06-07Version 5.4.22009-06-01Version 5.4.12009-05-27Version 5.42009-05-25Version 5.3.12009-03-29Version 5.32009-03-08Version 5.22009-02-08Version 5.1.42009-01-12Version 5.1.32008-12-29Version 5.1.22008-12-14Version 5.1.12008-11-11Version 5.12008-10-25https://riptutorial.com/6

VersionRelease DateVersion 5.0.32008-08-03Version 5.0.22008-07-21Version 5.02008-07-06Version 4.9.22008-05-11Version 4.9.12008-05-04Version 4.92008-05-01Version 4.8.52008-04-11Version 4.8.22008-03-09Version 4.8.12008-03-02Version 4.7.52008-01-14Version 4.7.32008-01-07Version 4.7.22008-01-03Version 4.7.12008-01-02Version 4.62007-11-21Version 4.52007-10-25Version 4.42007-10-14Version 4.32007-09-23Version 4.2.22007-08-15Version 4.1.22007-05-20Version 4.1.12007-05-13Version 4.12007-05-01Version 4.0.22007-02-15Version 4.0.12007-02-04Version 4.02007-01-29Version 3.92006-10-04https://riptutorial.com/7

VersionRelease DateVersion 3.82006-07-23Version 3.72006-06-27Version 3.62006-05-13Version 3.52006-03-02Version 3.42006-01-02Version 3.32005-11-16Version 3.22005-09-03Version 3.12005-07-17Version 3.02005-06-13Version 2.92005-04-02Version 2.82005-03-04Version 2.72005-01-27Version 2.62004-11-29Version 2.42004-09-26Version 2.32004-08-08Version 2.22004-07-08Version 2.12004-05-09Version 2.02004-04-22Version 1.92004-04-08Version 1.82004-03-27Version 1.72004-03-27Version 1.62004-02-11Version 1.52004-01-18Version 1.42004-01-11Version 1.32004-01-04https://riptutorial.com/8

VersionRelease DateVersion 1.22003-12-27Version 1.12003-12-16Version 1.02003-11-25ExamplesInstallation or SetupNotepad can be installed: From the installer downloaded from the project's web site From Ninite, which would download and automatically install the latest version available:https://ninite.com/notepadplusplus/ Built from sources who are available in the GitHub Repo of this project.Read Getting started with notepad //riptutorial.com/9

Chapter 2: Advanced Editing featuresExamplesMulti-EditingMulti-Editing allows the user to edit text at several locations simultaneously.Multi-Editing is disabled by default: it can be enabled (resp. disabled) in Preferenceschecking (resp. unchecking) the related checkbox.https://riptutorial.com/ Editingby10

To use Multi-Editing, the user can Ctrl Click on the different locations and start to type.During usage of Multi-Editing, text can be paste (e.g. by using Ctrl V).The user can also add some incremental numbers as follows:1. Go to Edit Column Mode (Alt C)2. Select Number to insert3. Choose the starting number (e.g. 1), the increment (e.g. 1) and optionally a repeat number(e.g. 2 to have the following sequence 1 1 2 2 3 3 .)Column EditingColumn Editing enables the user to edit text on several lines as a vertical square zone.This feature is enabled by default.There are 3 ways to select a zone to edit: Maintain Alt Shift and use Up/Down/Left/Right to select the zone to edit with direction keys Maintain Alt Shift and click on the document to define the other corner of the zone (the firstcorner being the position of the editing cursor) Alt select the zone to edit with the mouse while maintaining Clickhttps://riptutorial.com/11

To edit the text you can Type the new text Paste Using Edit ColumnMode.For example, to add some incremental numbers1. Define a zone with the numbers to replace2. Edit Column Mode Number to insert and select the parametersRead Advanced Editing features al.com/12

Chapter 3: Auto-completion and suggestionExamplesBasic settings of Auto-completion and suggestionsNotepad provides 2 types of features for auto-completion and suggestions: Auto-completion that reads the open file and provide suggestion of words and/or functionswithin the file Suggestion with the arguments of functions (specific to the language)To enable it, you need to change a setting.1. Go to Settings Preferences. Auto-completion2. Check Enable Auto-completion on each input3. Select the type of completion you desire: words only name of functions only both of them4. Optionally, check Function parameter hint on input to display parameters while typing afunction name (c.f. picture below)To use it, start to type a word or a function and after the number of characters you have specified,the suggestions will appear:https://riptutorial.com/13

Some documentation about auto-completion is available here: http://docs.notepad-plusplus.org/index.php/Auto CompletionCustomization of language suggestion (function parameter hint)Parameters hints can be customized by the user as indicated in this link: http://docs.notepad-plusplus.org/index.php/Auto Completion#How to create keyword auto-completion definition filesHow to create keyword auto-completion definition filesSince version 5.0 Notepad has support for so called Calltips, and has introduced anew way of storing autocomplete data. Now everything is stored in the XML format,which allows for easy extension of functionality. By doing so, autocomplete and calltipdata are combined in a single file. Older .api plain text files are no longer used byNotepad , and can be safely deleted if present.You can choose what srt of auto-completion you wish to have, from Settings - Preferences - Auto Completion - Enable Auto-completion on each input: words fromthe current document, functions from the current language, or both.The AutoComplete files are located in the "plugins\APIs" folder, to be found in theNotepad Install Folder, most often C:\Program Files\Notepad .The syntax of AutoComplete files is simple, but does have a few rules, mostimportantly correct syntax and proper sorting. If the syntax is incorrect, the XML file willfail to load and AutoComplete will be disabled. A more formal description can be foundat Editing Auto-Completion files.Improper sorting (see below) can cause the AutoComplete function to behave erratic,causing it to fail on certain words.The basic character set used to recognise keywords is made of letters (i.e. a-z, A-Z, 0-9digits and the underscore). [.] ?xml version "1.0" encoding "Windows-1252" ? NotepadPlus AutoComplete language "C " Environment ignoreCase "no" startFunc "(" stopFunc ")" paramSeparator "," terminal ";"additionalWordChar "."/ KeyWord name "abs" func "yes" Overload retVal "int" descr "Returns absolute value of given integer" Param name "int number" / /Overload https://riptutorial.com/14

/KeyWord /AutoComplete /NotepadPlus A small example of how the XML file is built is given above. NotepadPlus,AutoComplete and Environment are singleton elements, there should be only one ofeach, and all of them should be present for correctness, although it is allowed toremove the Environment element. Doing so will default all values to the ones given inthe above example.For keywords that are not functions, the Keyword tag is autoclosing and only has thename attribute. To indicate a keyword can be displayed in a calltip, add the attribute funcwith the value yes. In this case, the Keyword tag is a node and contains other tags.Then, for each overload of the function, an Overload element should be added ,whichspecifies the behavior and the parameters of the function. A function must have at leastone Overload or it will not be displayed as a calltip. The retVal attribute must bepresent and specifies the type of the return value, but the descr attribute is optional anddescribes the functions behavior, like a comment.You can add newlines in the description if you wish to do so. For each parameter thefunction takes, a Param element can be added. The name attribute must be present andspecifies the type of the parameters and/or any name of the parameter.In the AutoComplete element you can add the language attribute but it is not used byNotepad , you can add it for completeness if you wish and can take any string youwant.Read Auto-completion and suggestion utorial.com/15

Chapter 4: RegexExamplesReferencing Capture GroupsBackreferences"Backreferences" are references in a search regex to capture groups in the same search regex.The "search regex" is the regex used in the "Find" field of the Find/Replace dialog box. Here is themost common backreference syntax:Absolute:(group one).\1Relative:(group one)(group two).\-1Named:(? name group).\k name Substitutions"Substitutions" are references in a replacement regex to capture groups in the associated searchregex. The "replacement regex" is the regex used in the "Replace" field of the Find/Replace dialogbox. Here is the most common substitution syntax:Absolute: 1Named: {name}More Than 9 GroupsThe formats \1, \-1, and n are limited single-digit numbers. In order to positionally reference acapture group greater than nine, use the following syntax instead:Backreference:(group one).(group ten).\g{10}Substitution: {10}

Notepad is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License. (Taken from official pages) Notepad provides several advantages for developers. It's no huge Integrated Development