Notepad++ Selected Line Operation Shortcut Key Skills

Notepad++ Selected Line Operation Shortcut Key Skills

Writing code with Notepad++, if there are some repetitive codes to copy, it is really not easy, and you have to use the mouse, which is extremely annoying. . . .
Is there a simple method, indeed there are, but it is not very easy to use.
Mainly use the Home key and End key on the keyboard.
The mouse cursor stays somewhere in a line, press the Home key, the cursor will jump to the beginning of the line, and press the End key, the cursor will jump to the end of the line.
The mouse cursor stays at the end of the line, press Shift + Home to select a line.
The mouse cursor stays at the beginning of the line, press Shift + End to select a line.
The mouse cursor stays somewhere in the class, press Shift + PageUp to select all the content in front of the cursor of the class.
The mouse cursor stays somewhere in the class, press Shift + PageDown to select all content behind the cursor of the class.
Select everything, Ctrl + A .

To select a row, you can first press the Home key, and then press Shift + End to select a row.

Notepad++ Shortcut Keys
Ctrl+C Copy
Ctrl+X Cut
Ctrl+V Paste
Ctrl+Z Undo Ctrl
+Y Redo
Ctrl+A Select All
Ctrl+F Find Dialog Start
Ctrl+H Find/Replace Dialog
Ctrl+D Copy and paste the line

Ctrl+L Delete the current line
Ctrl+T When the line moves
up a line F3 Find the next
Shift+F3 Find the previous Ctrl
+Shift+F combination Find in the file Ctrl+
F3 Find (volatile) Next page
Ctrl+Shift+F3 Find ( volatile) Previous page
Ctrl+Shift+I Combination incremental search
Ctrl+S Save file
Ctrl+Alt+S Save as
Ctrl+Shift+S Save all files
Ctrl+O Open file
Ctrl+N Create new file
Ctrl+F2 Switch bookmark
F2 Go to the next bookmark
Shift+F2 Go to the previous bookmark
CTRL+G Position newline, offset
Ctrl+W Close the current document
Alt+Shift+Arrow key move the arrow key or
ALT+left mouse button click the column to select
F5 Start running Dialog Box
Ctrl+Space input method switch
Alt+Space Program right-click
Tab Insert indentation
Shift+Tab Delete indentation
Alt-Shift-Arrow or
Ctrl+mouse wheel button Zoom in and out
Ctrl+Keypad/restore original size
F11 Full screen mode
Ctrl+Tab next document
Ctrl+Shift+Tab Previous document
Ctrl+Shift+Up Move current line up
Ctrl-Shift-Down Move current line down
Ctrl+Alt+F Collapse current level
Ctrl+Alt+Shift+F Expand current level
Alt+0 Collapse all
Alt+Shift+0 Expand all
Alt+(1~8) Collapse level (1~8)
Alt+Shift+(1~8) Expand level (1~8)
Ctrl+BackSpace Delete start word
Ctrl+Delete Delete end word
Ctrl+Shift +BackSpace Delete to line
Ctrl+Shift+Delete Delete to end of line
CTRL+U Convert to lowercase
Ctrl+Shift+U Convert to uppercase
Ctrl+B Go to matching parenthesis
Ctrl+Shift+R Start recording/stop recording macro
Ctrl+ Shift+P Play recorded macro
CTRL+Q Comment/Uncomment
Ctrl+Shift+Q Value stream Comment
Ctrl+Shift+T Copy current line to clipboard
Ctrl+P Print
Alt+F4 Exit
Ctrl+I Divide line
Ctrl+J Join Line
Ctrl+Alt+R Read from the right
Ctrl+Alt+L Read from the left
Ctrl+H Open the Find / Replace dialog box
Ctrl+D Copy the current line
Ctrl+L Delete the current line
Ctrl+T Swap up and down lines
F3 Find the next
Shift+F3 Find the previous
Ctrl+Shift-F Find in the file
Ctrl+F2 Trigger Bookmark
F2 Go to the previous bookmark
Shift+F2 Go to the next bookmark
F5 Open the run dialog box
Ctrl+Space Open the CallTip list box
Tab (selection of several lines) Add Space
Shift+Tab (selection of several lines) Remove Space
F11 Full screen
Alt+ 0 Collapse all
Alt+Shift+0 Expand all
Ctrl+U Lowercase
Ctrl+Shift+U Uppercase
Ctrl+Q Block comment/decomment

F1 about help

Cursor-operated keys that are mainly added or adjusted:

Forward (Ctrl+F), Backward (Ctrl+B), Previous Line (Ctrl+P), Next Line (Ctrl+N)

Front of line (Ctrl+A), Last of line (Ctrl+E)

method

Menu <Settings>-<Manage Shortcut Keys>

Modify in "Main menu" and "Scintilla commands".

Modify the old shortcut keys to avoid conflicts:

New -> Ctrl+Alt+N

Locate matching brackets -> Ctrl+Alt+B

Find -> Ctrl+Alt+F

Select all -> Ctrl+Alt+A

Alt+H   hide row

Ctrl+Tab   to switch between multiple open windows

Ctrl+Shift+Q block comment

Ctrl+K line comment (cancel Ctrl+Shift+K )

File
New file Ctrl+N
Open file Ctrl+O
Save file Ctrl+S
Save as Ctrl+Alt+S
Save all Ctrl+Shift+S
Close current file Ctrl+W
Print file Ctrl+P
Exit Alt+F4

Edit
Undo Ctrl+Z
Restore Ctrl+Y
Cut Ctrl+X
Copy Ctrl+C
Delete Del
Select All Ctrl+A
Column Edit Alt+C

Indent Tab
delete indent Shift+Tab
to uppercase  Ctrl+Shift+U 
to lowercase  Ctrl+U

Copy the current row  Ctrl+D
Delete the current row  Ctrl+L
Split the row Ctrl+I
Merge the row Ctrl+J
Move the current row up  Ctrl+Shift+Up 
Move the current row down  Ctrl+Shift+Down

Add/Delete Single Line Comment Ctrl+Q
Set Line Comment Ctrl+K
Cancel Line Comment Ctrl+Shift+K
Block Comment  Ctrl+Shift+Q

Function autocomplete Ctrl+Space

Search
Find Ctrl+F
Search in files  Ctrl+Shift+F 
Find Next  F3 
Find Previous  Shift+F3 
Select and Find Next  Ctrl+F3
Line Locate  Ctrl+G 
Locate Matching Brackets  Ctrl+B 
Set/Cancel Bookmark  Ctrl+ F2
next bookmark  F2 
previous bookmark  Shift+F2

View
Full Screen F11
Sticky Notes Mode F12
Collapse All Levels  Alt+0 
Expand All Levels  Alt+Shift+0
Collapse Current Level  Ctrl+Alt+F
Expand Current Level  Ctrl+Alt+Shift+F
Hide Lines  Alt+H
Activate From View  F8

Text comparison tool
Open file compare Alt+D
Close file compare Ctrl+Alt+D
Compare with last saved file Alt+S
Compare with SVN file Alt+B
Previous difference Ctrl+Page UP
Next difference Ctrl+ Page Down
the first difference Ctrl+Shift+Page Up
the last difference Ctrl+Shift+Page Down

Function List is one of the many cool features of Notepad++. But the latest version requires extra steps to set up the Function List correctly. The author will introduce how to install Function List and how to set Function List.

First of all, the Function List plug-in is not in the plug-in list that comes with Notepad++, nor in the Available List of Plugin Manager = =|||. So to install Function List, you have to go to Plugin_Central to download it. The latest version I downloaded is 2.1.0.1.

After decompressing the downloaded compressed package, there are many files, first copy FunctionList.dll to <notepad++ install dir>/plugins directory, then copy FunctionListRules.xml, Gmod Lua.bmp and C++.flb to <notepad++ install dir> /plugins/config, the installation part is completed here.

Next, you need to open Notepad++ to set the Function List. Plugins->Function List->Language Parsing Rules. Then, select C/C++ in the language list, and check the "Bitmap List" checkbox. Browse to the plugins/config directory, select C++.flb, and you're good to go.

Notepad++ hooks Python and gcc

Python mount:
Run -> Run... Fill in the path of the python executable file and the predefined source file address of notepad++: D:\Python26\pythonw.exe "$(FULL_CURRENT_PATH)" and then it is recommended to click the save additional shortcut key gcc to
hang Then
Run -> Run... Fill in ***, mine is D:\mingw\bin\gcc.exe "(FULLCURRENTPATH)"−o"(FULLCURRENTPATH)"−o"(NAME_PART).exe"
because the compilation needs to generate files , through Plug-Ins -> NppExec -> Follow $(CURRENT_DIRECTORY), you can make the generated exe in the source file directory.

I have been using Notepad++ recently, and found that it is indeed a very good tool. For the specific features, you will know after reading the introduction below.

 

【Introduction to notepad++】

Notepad++ is designed to replace the default Windows notepad, which is much more powerful than notepad.

(1) Notepad++ version: ANSI and Unicode

There are two versions of Notepad++, one is ANSI version and the other is UNICODE version.

For most people who use Notepad++ as an enhanced version of notepad and need ordinary applications, there is actually no difference between the ANSI version and the UNICODE version.

(2) Notepad++ supports rich plug-ins

Notepad++ supports plug-ins, adding corresponding plug-ins to support different functions. In addition to some common plug-ins, there are also some fun plug-ins, such as the speech plug-in that reads the text.

(3) Overview of Notepad++ Features

Notepad++ is a lightweight text editing software. Compared with some other professional text editing tools, such as UltraEdit, it starts faster and takes up less resources, but in terms of function usage, it is no less than those professional tools. Although the default notepad of windows is more "lightweight", it has too few functions. Therefore, notepad++ or another tool notepad2 is generally used instead of notapad, and it also replaces the too complicated and huge UltraEdit.

 

[notepad, notepad2, notepad++, ultraEdit comparison]

According to my personal feelings about using some text editing tools, notepad2 starts faster and takes up less resources than notepad++, but relatively speaking, it has fewer functions, so many commonly used and convenient functions are still unavailable. Although ultraEdit has many functions, it consumes too much resources and is too troublesome to use. The key is to charge, while notepad++ is free. The general summary is as follows:

notepad : Windows comes with it, takes up the least resources and starts up the fastest, but the function is too weak to meet the needs. is free.

notepad2 : It takes up a little more resources and starts up very quickly, but in terms of functions, it is not as much as notepad++, and it is not as much as ultraEdit. is free.

notepad++: It takes up a lot of resources, and it takes a while to start, but it has powerful functions, especially the plug-in mode, which makes the scalability very good, supports many other advanced functions, and is very convenient to use. is free.

ultraEdit : powerful, but the installation file is large, takes up a lot of resources, starts slowly, and is charged.

 

Therefore, according to the comprehensive evaluation of startup speed, resource usage, function support, etc., for notepad, notepad2, notepad++, and ultraEdit, notepad++ is undoubtedly the best choice .

 

[Notepad++ add-in method]

Method 1: You can manually go to the official website of the notepad++ plugin to download:

http://sourceforge.net/projects/npp-plugins/files/

Method 2. Let notepad's plug-in manager automatically download and install

Click: Plugins -> Plugin Manager -> Show Plugin Manager -> Avaliable column displays the list of currently available plugins, select the plugin you want, and then click Install below to automatically download and install the corresponding plugin, which is very convenient

Let me talk about my personal use experience and experience:

【Check the current version of notepad++】

To check your current version of Notepad++, click on the toolbar  ? -> About Notepad++, the pop-up dialog box will display the words "Notepad++ v5.8.6 (ANSI)", where (ANSI) means the current ANSI version.

 

Personally, I think some useful features worth mentioning are:

1. Support syntax highlighting and color customization

The key is that it supports many languages, besides the common c/c++, java, php, it also supports python and xml.

And for xml, it also supports clicking keywords to expand or contract, which is very convenient. Later I learned that this feature is called code folding, embarrassing. . .

 

It also supports makefiles, which is very convenient for viewing makefiles.

And even the syntax highlighting of Tex/LaTex, which is not commonly used by ordinary people, is supported, which is very powerful.

 

For the color displayed during syntax highlighting, you can also customize it, click:

Settings -> Style Configurator

You can configure different colors according to your needs.

 

 

[Customize files with suffixes other than the default suffix as a certain type of file to achieve syntax highlighting]

And for the suffixes of different types of files, in addition to the default file suffixes, set custom file suffixes, such as what I encountered, for ordinary makefiles, the default suffix is ​​.mak, and my own here .mk is also a makefile, so it can be set like this:

Settings -> Style Configurator -> Pull down in Language to find Makefile, select makefile, and it will appear in the lower left corner:

Default ext. and user ext., the default extension (default extension) is the suffix name. Corresponding to .mak, fill in .mk in the box corresponding to user ext.

 

Then click Save&Close on the right, and notepad++ can automatically recognize the .mk file as a makefile, and then quote the corresponding syntax highlighting.

Of course, if you don’t set it, open the .mk type file separately. Although notepad++ will not automatically recognize it, there is no syntax highlighting, but you can also choose it manually:

language -> M -> Makefile, you can achieve the same function, but you have to trouble yourself to manually set it every time.

 

2. Add hex editor plug-in to support hexadecimal editing

Notepad++ supports adding HEX-Editor plug-in to support hexadecimal viewing and editing, which is very convenient.

[How to add the Hex Editor plug-in]

First, you can know whether your own notepad++ is ANSI or UNICODE through the method of [check the current version of notepad++] above .

Then go to the official website of the Notepad++ plugin  according to the above  [notepad++ plugin addition method]  , find and download the corresponding version of Hex Editor, put the plugin file HexEditor.dll into the npp.5.8.6.bin\ansi\plugins file under the NotePad++ path Just clip it inside.

At present, you can also use the plug-in manager introduced above to automatically download and install it directly through the software.

Then restart notepad++, you can see the corresponding Hex-Editor plug-in in Plugins.

It is worth mentioning that the current latest version (5.8.7) also supports adding a plug-in, and correspondingly adds a shortcut icon on the toolbar. For HexEditor, it is a capital H icon, click on the icon , you can realize hexadecimal viewing, click again, and return to the normal mode, which is very convenient.

3. Support column mode editing

After pressing and holding Alt , you are in the column mode, and then for example, you select a column, then right-click, select delete, you can delete those columns, release ALT and leave ALT to resume normal mode. It is very easy to use, and I feel more and more that notepad++ is awesome, and supports all functions. . .

In the column operation mode, if you insert some content in the entire column, you can do this:

Edit -> Column Editor (Alt C)

Then write the content to be inserted in the box corresponding to Text to insert or Number to insert, and notepad++ will automatically insert the corresponding content of the entire column for you

4. After selecting a word or keyword, notepad++ will automatically highlight the corresponding selected keyword , which is very convenient for file viewing.

5. When multiple files are opened, the corresponding Tab will be displayed above. By default, double-clicking Tab cannot close the file like some other tools, but it can be set:

In Settings-> Preference ->General -> Tab Bar, select:

Double Click to close document, and then double-click the tab corresponding to the file to close the file .

Similarly, there is another option: show close button on each tab. After selecting, a close button will appear on each tab, which is also very convenient to use.

6. Display the line number of the file : Settings-> Preference->General-> Editing-> Select Display Line Number to display the line number

7. Whether to print the line number : Settings-> Preference->General-> Printing-> Whether to select Printing Line Number, the default is not selected, if necessary, you can select it, so that you can also print the line number when printing, it is still very It is convenient for users to set up according to their own needs.

8. Whether to backup after editing a file : Similar to Ultra Editor, after editing a file, a .bak file will be generated by default. Notepad++ also supports this function, but it is disabled by default. If necessary, you can go here to set: Settings-> Preference -> General -> Backup/Auto-completion -> The default is None, and there are other Simple and verbose backups, which can be set according to your needs.

9. Auto-completion function: Settings-> Preference->General-> Backup/Auto-completion, auto-completion: Auto-Completion, which can be set according to your needs, and the default is off.

10. Select a text, and then call google search :

run -> google search

In addition to the function of google search, there is a similar thing here, after selecting the text, call other programs or functions, such as directly calling the wiki to query the word/text :

run -> wikipedia search

Or directly open the folder where the current file is located from notepad++ :

run -> open containing folder

Open the cmd of windows from notepad++ , and it is already in the current folder :

run -> open current dir cmd

Directly put the file as an attachment, and then open Windows Outlook to send the email

run -> send via Outlook

Wait, they are all very useful functions.

11. Temporarily hide certain rows

If you temporarily feel that you need to hide some lines while viewing the file, and then display them normally when needed, you can select those lines first, and then:

View -> Hide Lines

That's it. Then the label column on the left will display the corresponding mark, click to unhide.

12. Support mouse wheel to control zoom

Notepad++ not only supports the shortcut key Ctrl + Num+/Num- to control the zoom, but also supports Ctrl + mouse wheel to control the zoom of the currently displayed content, which is very convenient.

13. Full screen display

Sometimes when displaying a document, you want to display more content, and you want to use full-screen display. You can achieve full-screen display through view -> Toogle Full Screen Mode F11 or Post it F12, which is also very convenient.

14. Integrated lightweight resource manager

After installing the plug-in (the default seems to be installed) LightExplorer:

Plugins -> Light Explorer -> Light Explorer, you can open a lightweight explorer on the left, which is very convenient to open the file you want to open.

15. Export to other types of files -> realize pasting of color codes

After adding the corresponding NppExport plug-in, it can be exported to different formats, such as HTML and RTF:

plugins -> NppExport -> Export to RTF或Export to HTML

Among them, HTML is ordinary HTML, and RTF can be understood as a concise version of word, so both html and rtf support color codes/characters, so this function can achieve what we need, and it will be highlighted , displayed in color, the code after coloring is exported to word or other documents. Such a function is very practical. At least I personally think it is very easy to use. For example, after opening some C codes, export them to html, then open the html to copy the content and paste it into word, it will be a colored code. Of course, you can also export it as rtf, and then it is compatible with word. Under windows, it is opened with word by default, which saves the step of copying and pasting from html.

Even, NppExport also provides more convenient functions:

plugins -> NppExport -> Copy HTML to clipboard 或Copy RTF to clipboard

That is, after directly selecting the content, copy the content to the clipboard, and then you can directly paste it in other word files, that is, the color code support is realized so simply, how cool it is.

16. Code folding

Including C/C++ and other codes, the code can be folded and unfolded with a single function as a whole, and other types, such as XML, can be folded and unfolded as a whole according to the content contained in keywords, etc.

17. In the resource manager, right-click the file, you can directly open the file with notepad++

This function is similar to UltraEdit. It adds right-click support in the resource manager. After right-clicking on a file, "Edit With Notepad++" will appear, and you can directly open the file with notepad++. Personally, I think this function is still very practical.

18. Ctrl+Tab to switch between multiple open windows

 

19. Support setting whether to display column boundaries (right line)

Settings->Preferences->Edit->Column Border, you can set whether to display the column border, and also supports customizing the size of the "Border Width", the default is 100.

(Note: Generally, 80 is commonly used under Linux.)

And for the column boundary display mode, it also supports two types:

One is a vertical line from top to bottom:

 

The other is to add a certain background color to the content beyond the column boundary:

 

20. You can add or uncomment the code in batches

Select a piece of code, then: Edit -> Comment/Uncomment -> Add/Delete single-line comments, you can batch select each line, add or delete comments.

This function is still very practical for those who often write code.

 

 

There are more other functions of notepad++, those who are interested can explore by themselves.

In short, I personally think that Notepad++ is a very useful, lightweight, but feature-rich, text/code editing tool. Here, I am very grateful to those developers for bringing us this useful tool. tool.

 

1

2

3

1. Can eliminate blank lines in the file

    select all text,

    TextFX--->Edit--->Delete Blank lines

1

2

3

4

5

2. Organize the xml text format

    This function is super good. I often encounter xml texts of about hundreds of KB in one line, which can be used

It quickly organizes a line of text into a canonical xml file.

    select all text

    TextFX--->HTML Tidy--->Tidy: Reindent XML

1

2

3

3. Automatically add line numbers directly before your text lines:

   select all text

   TextFX--->Tools--->Insert Line Numbers

4. Can be used to view the hexadecimal format

5. There is an ftp plug-in, which is not bad

6. It seems that there is an Explorer plug-in, which has not been used much

7. Its function list is also quite good, commonly used, at least when looking at java source programs

8. You can customize external commands. Sometimes I use it to compile java source programs and press F6, and there will be a customized window.

Here is my javac command: jc5.bat $(FULL_CURRENT_PATH)

Below is my command to run java

rj5.bat $(NAME_PART)

I just need to set jc5.bat and rj5.bat in a certain directory on the outside PATH path, and then I can use it.

For example, I add d:/shell to the PATH environment variable here, and I can put many batch scripts I like in it.

The content of jc5.bat is roughly as follows:

jc5. bat

echo off
setlocal
set JAGUAR_JDK15=d:sharedjdk1.5.0_01

set JAVA_HOME=%JAGUAR_JDK15%
set PATH=%JAVA_HOME%bin;%JAVA_HOME%jrebin;%PATH%
set OLD_CLASSPATH=%CLASSPATH%
set CLASSPATH=.;%JAVA_HOME%libdt.jar;
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%libtools.jar;
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%jrelibrt.jar
set CLASSPATH=%CLASSPATH%;%OLD_CLASSPATH%

“%JAVA_HOME%injavac”  -g %*
endlocal

Guess you like

Origin blog.csdn.net/zs319428/article/details/107791436