Home>Article>Development Tools> Set up your own notepad++ (graphics and text)

Set up your own notepad++ (graphics and text)

不言
不言 forward
2018-09-28 16:08:11 9626browse

The content of this article is about setting up your own notepad. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

For coders , notepad is a very good text editor. I usually use it to look at codes and xml files, which is much more comfortable than the notepad that comes with the system. However, for people like me who use Notepad to write code every day, an original Notepad is far from enough. Let's make some adjustments to notepad.

1. Change the theme and color

The theme and color of npp are set under the setting/style configurator.

First, choose a theme. Theme generally contains code highlighting solutions for various languages, and of course also includes global settings. The global settings also fail to recognize the language when the program is opened (such as when opening a txt text). Notepad provides instant preview when changing themes. So when you change the theme, the current text does not change the highlight, check whether the current file is recognized correctly. For example, the current text is recognized as Java language, but you change the highlighting of C, which will not be reflected in the current text.

The following takes C language as an example to modify the code highlighting

After selecting C language in language, you can see that C language can be automatically Definable items (it seems that different themes and different languages have different definable items). Each customizable item is listed below:

PREPROCESSOR Preprocessing

DEFAULT Default (that is, code other than other definable items)

INSTRUCTION WORD Structure keyword if else for while switch and the like

TYPE WORD Type keywords, int float struct and the like

NUMBER Numbers, that is, constants

STRING Strings, usually between "" The characters are considered as string

CHARACTER characters, and the single characters between '' are considered as characters

OPERATOR Operands, such as - * / =

COMMENT Comment, usually after //

COMMENT LINE Comment line, starting with /* and ending with */

COMMENT DOC Document comment, ending with /**starting with*/

I don’t know what some of them are, sorry.

Knowing these types, we select the type we want to adjust. On the right, select the color, font, size, whether to bold, italic, and whether to underline, and then OK.

Some parts can add custom data. Such as TYPE WORD and INSTRUCTION WORD, do you want to add a custom keyword type

Note: The search results are at the bottom of language, and after selecting the text Highlighting is in global style.

2. Add the plug-ins you need.

Plugins can be managed in plugins/plugin manager.

My commonly used plug-ins:

light explorer is a lightweight resource manager with a favorites function. The stander menu can be opened by right-clicking the system. It is easier to use than the explorer plug-in

nppFTP FTP plug-in, mainly because the server is not around and you often need to upload and download

sourcecookefier It is mainly a function list and definition jump, which is better than the function list that comes with npp Easy to use. The function list can be refreshed and arranged automatically.

The following introduces the jump of sourcecookefier, which is the go go define function.

First change the mode of source cookefier to cookie session mode (these three modes are introduced under right-click/help)

Then change the project Drag the directory into sorucecookifier, it will automatically list all file types, select the detected file type (C language is generally .c and .h files)

Waiting for the cache to be generated file, then hold down thectrl key and left-clickin the code, and it will automatically jump to the declaration processing of the function or macro definition. This function is mainly implemented using CTAGS, and functions with the same name cannot be distinguished (there will be a choice). Also, remember to save cache files. You have to open it again next time you open npp. Every time you modify a file, remember to save it.

3. Modify the right-click menu

nppThe entrance to modify the right-click menu is in the setting/edit popup contextMenu, and then open a file for us to edit. In fact, we can also find the contextMenu.xml file and modify it ourselves. There are more detailed comments in this file.

npp's right-click menu is divided into three types, one is a menu distinguished by name, one is a plug-in menu, and the other is a menu distinguished by ID.

1、以名字来区分的菜单就是你把Npp的语言改为英文,在npp菜单里的功能都可以添加到右键。如

     

ItemMenuEntryName="Edit"MenuItemName="Cut"则表示其功能就是编辑里的剪切功能。当然,你也可以添加一个ItemMenuEntryName="Search"MenuItemName="Find In Files...",即搜索下的在文件中查找。

2、插件菜单就是你装的插件的功能。

 

把PluginEnteerName改成自己的插件名,PluginCommandItemName改成自己的功能就OK.这些都可以在菜单栏中plugin里找到。

3、最后一种则是以ID来区分的,

     

这里头疼的是这些ID表示什么。它在安装目录下的\localization\english.xml里。

    

其他的,如分隔线、文件夹(Folder)怎么添加,看注释就知道了。

四、更高级的自定义

本人写的语言是一种非主流的脚本LPC。没有IDE,没有语法高亮。幸好LPC与C十分类似,使用C的语法高亮就可以。一开始我考虑Npp的自定义语法高亮,但没有成功。好像不管我怎么设置,其的类型检测如宏定义、预处理、字符串这些不如它内置语言的精准,也有可能是我没设置好。下面记录一下相关文件:

主题文件在npp/themes里

13214c04e5957b7fa4f5a3e8d693cb2c

name="PREPROCESSOR" styleID="9"是内置类型,用于正则表达式判断是否关键字、预处理以及如何高亮,不能自定义,有FUCNTION类型,但我设置了没效果

89da451a7f5e714bc19015d943787574是修改搜索结果,

在类型里如TYPE WORD能添加自定义是因为有insert1字段或type1字段,这两个字段在npp/stylers.xml里定义

Notepad++的自动补全的列表文件在\plugins\APIs文件夹下,xml文件,需要在设置里把自动补全打开

The above is the detailed content of Set up your own notepad++ (graphics and text). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete