Workers must first sharpen their tools

Source: Internet
Author: User



University began to use notepad++ as a code editor, like it's concise and clear, like its personality, but also like its various kinds of nasty plug-ins.



Today is nothing to do, write an article to record the usual use of various, including but not limited to personalized use of some macros, shortcut keys, related commands and a number of personal use of more plug-ins.



I usually most of the code is also python-web related aspects of code writing, so here focus (or mainly) about how to build notepad++ for Python development.





norepad++Introduction, look at its homepage to understand





Post an introduction to the encyclopedia above (via):


notepad++ is a pure text editor (license:GPL) with a very unique set of free software , with a complete Chinese interface and the ability to support multiple languages (UTF8 technology). It is more powerful than Notepad(Notepad) in Windows, and can be used as an editor for writing computer programs, in addition to making generic text-only documentation. notepad++ not only has the syntax high brightness display, also has the grammatical folding function, and supports the macro as well as expands the basic function the plug-in module.

notepad++ is a very unique editor, open source software, free to use, with Chinese. Supported languages: C, C + +,Java, Pascal, C #,XML, Sql,ada,HTML,PHP, ASP, AutoIt, compilation,DOSBatch processing, CAML,COBOL,Cmake,CSS,D,Diff,ActionScript,Fortran, GUI4CLI,HTML,Haskell, Inno,JSP, KIXtart,LISP,Lua, MakeProcessing (Makefile),Matlab,INIFiles, MS-DOS Style,NSIS, Normal text,objective-c,Pascal,Python,Javascript,VerilogHaskellInnosetupCMake,

Vhdladacaml, Autoitkixtart,Matlab





About the comparison of various editors, here I do not say anything, no in-depth use, inconvenient to comment on what.



Suppose dear you have installed the software yourself, we will then do some related settings.





NPP (notepad++, hereinafter, if not described, refers to the notepad++) setting


The default settings are which, what changes I can not remember now, directly put some of their own settings on the OK, need to compare to look up



Settings > Preferences > Common:









Settings > Preferences > Edit:



The boundary width 80, which is also for historical reasons (the screen is not wide enough, limited to 80 words will not be line lines display), so that the code to read.






Settings > Preferences > Tab settings:



Select Python, use the default value to remove the tick, and then set the tab width to 4 (for tab widths, refer to Python's PEP-8).



Python has strict requirements for indentation, and using 4 spaces instead of tab is basically the standard (I believe it anyway).



Similarly, you can easily set the tab width in the [Default] item.






Settings > Preferences > Auto-complete:



Automatic completion of a few parentheses is really a lot of things, words and functions Auto-completion is also good (starting from the 3rd character, so as not to enter a word to start the hint, so the hint is too frequent ...)






notepad++ support to save the current work to the file, the next time you click on the file can be restored to the previous work status (of course, the next turn off will revert to the last working state). Register a good-to-use suffix for your session files.








NPP shortcut key setting


The editor for the code farm will have a variety of shortcut key settings, and NPP is no exception. The key settings for NPP are broadly divided into the following categories



1 common shortcut keys, like ctrl+c/v/a/x and so on a series of Earth people know the shortcut keys.






2 shortcut keys for the various macros defined and registered for



Here I need to recommend is Alt+shift+s, and Ctrl+s (save) is different is that the shortcut to do a save before saving all the extra space before the command. is one of my favorite shortcut keys, basically replaced the ctrl+s. The figure also has the author's own registration of several codes commonly used in the macro, one is to jump to the end of the line, one is the code declaration, one is to jump to the next line, so that only need to move the finger instead of moving the wrist can achieve the same effect (a word, lazy).






TIPS: Macro recording and setting, here we take the second macro in the recording and shortcut set as an example



Click Start Recording, then click the End key on the keyboard, then click. then click on the window to set the preferred shortcut and then OK to finish, So easy~~



3 Shortcut keys for registration



NPP comes with a variety of shortcuts in the browser to open the current file, search for a shortcut key, perhaps here dear you notice, the 10th Run in Python, here is actually a call to a command. It will be explained in detail later.






4 installation introduces related shortcut keys, and other related shortcut keys



There is not much to describe here.



Shortcut key, only need to select the shortcut you want to modify, double-click Will pop the window for you to modify, it is important to note that do not change to the same key, so there may be a conflict caused by the button when it is not normal response to your fingertip operation Yo (you can also go to the existing one shortcut key removed-designated as none, or change it into something else, and come back to this one).








A few magical commands.


Run the current script file in Python:



Run > Run, the input box to paste the following command and then save, specify a shortcut (also can not, here I designated as F5, remember to take the previous F5 to kill, forget in which column, in the above said several inside, of course, can also be designated as the other will not conflict)



cmd/k python "$ (full_current_path)" & ECHO. & PAUSE & EXIT



Give it a try , after saving the file , F5 Click to call out the command line window to run the current file , isn't it convenient? ?





The theme color of NPP


NPP provides users with a variety of theme colors, as well as support for custom color configuration, the author uses the theme color configuration, one.



My theme Style



Vim dark blue Style









Hello Kitty Pink Style






Here's a quick introduction to customizing your favorite colors. Take my own example



The color configuration I used was modified on the basis of my own deep black.



Settings > Language formatting > Styles






Then modify a variety of various. This is left to the curiosity of your own slowly explore the style of what the difference represents ~



Here by the way to provide you have modified the section, the display of style see above my theme style below the map, if you want to find out what this configuration specifically done, you can look at the following.



Directly open the theme file under the installation path of notepad++ X:/someptah/norepad++/themes/deep Black.xml






Ctrl+f search python, probably near line No. 318. Of course, you can also fold the code to the 3rd level, so it is more convenient to see.






Unfold this piece of Python, where you can see the color of the code theme style for the Python section, the font configuration, and then we can do something that we love to do.



Here is a brief explanation, each <wordsstyle name= "DEFAULT" styleid= "0" fgcolor= "FFFFFF" bgcolor= "000000" fontname= "" fontstyle= "0" Fontsize= ""/> Represents a configuration item that configures the display of different types of code: default, Annotations, numbers, strings, keywords, classes and so on, here we mainly change is Fgcolor,bgcolor, FontSize and so on. Your changes to the file will be directly reflected in the theme color, font size changes.






Backstage will give my own theme style, too troublesome can also download directly and then overwrite deep black.xml file (note backup first)


Various plug-ins for NPP




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.