The charm of the text editor-dedicated to your favorite vim, Sublime

Source: Internet
Author: User



1 Preface



have been busy projects for a long time did not write a blog, immediately have a deep sense of guilt, today hurriedly mend a few calm mood ...






The importance of the text editor I remember the first time in the book "The Path of Programmer's cultivation," I saw that this is really too reasonable for me to save a lot of time for myself, so I constantly remind my friends to use it well. But each time I have to say from the beginning of the feeling is also quite time-consuming, so I intend to write down directly can be better to share to more people.



Here incidentally, the windows comes with the Notepad to ignore it, the function is too weak, and the file is a little larger than the direct card, read the text will know that the gap is too big.






2 Recommended Text editors



Good text editor has a lot, as long as choose one to two easy to use, in fact, I used to some, compared to, I recommend a few of their own more like (subjective relatively strong, for reference only).



1. Vim: Must row first, Big love its shortcut key, the hand is completely does not have to leave the main keyboard area, basically the common text editor has the function it all has, the only disadvantage is the learning curve is relatively high. Under Linux is really an irreplaceable tool, gvim under Windows can also be used, but it always feels strange to use ...



2. Sublime: The feeling is the most cool use of Windows, is written in Python, the interface is very beautiful, the plug-in is very rich, seemingly a lot of new languages like to do the IDE directly with this. Very like its kind of Python-style concise operation, the above plug-in is the same style, ctrl+shift+p can be called directly from the command line, all the shortcut keys have a configuration file can be arbitrarily modified, it feels cool!



3. notepad++: This feeling is relatively easy to use, the default is a large number of common functions, recommended non-programmer users! After the column you like most of it is copied, you can do a very smart column paste, sublime column paste must be two columns of the same number of rows.






3 The power of the text editor



In fact, I do not need to say, we should also be able to think of a lot of places, but I personally feel that the following is a person feel the most real function points, but also should be you have to have a few functions.






3.1 Column Editing



Usage scenarios:



1. When editing text in peacetime, often encounter a column to replace or insert what content, so that the operation is column editing, you can block the selection of a piece of content, and then to operate.



shortcut key: Vim (Ctrl + V) Sublime (middle mouse button or shift+ right mouse button) notepad++ (Alt + left mouse button)



2. Here is a slightly more complicated but also very common insertion, is to insert a arithmetic progression, for example, 1, 2, 3, 4 ... such a value.



shortcut key: Vim (none?) ) Sublime (ctrl+alt+n) [need to install Insert Nums plugin] notepad++ (alt+c)



3. There is also a special scene, which can be edited at the same time in any position, which is more flexible than the column.



Shortcut key:Vim (none?) ) Sublime (Ctrl + left mouse button) notepad++ (none?) )






3.2-line operation



This can be operated a lot, can improve efficiency, simple list of several bar (take sublime as an example):

Row Indent Ctrl +] (Edit > Line > Indent)

Cancel indent: ctrl+[(Edit > Line > Unindent)

Current row up: Ctrl+shift+up (Edit > Line > Swap lines up)

Move Down Now: Ctrl+shift+down (Edit > Line > Swap lines down)

Copy the current row: Ctrl+shift+d (Edit > Line > Duplicate lines)

Merge lines: ctrl+j (Edit > Line > Join Lines)

To delete a word backwards: Ctrl+del

Delete a word forward : ctrl+backspace

Delete entire row: Ctrl+shift+k (Edit > Line > Delete)

Delete from cursor to end of line:ctrl+k

Delete from cursor to start of line:ctrl+backspace





3.2 Text substitution



Usage Scenarios:



1. Replace all the same places in the file, which can be characters, line breaks, and so on.



2. Practical Regular Expressions are replaced, and basically all the strings you can think of can be flexibly matched with regular.



3. Back to the second, there is another way is based on the substitution of the extension, such as "\ n", some text editor can be directly in the same operation.



shortcut key:Vim (%s) Sublime (ctrl+h) notepad++ (ctrl+h)






3.3 Macro Commands





Usage Scenarios:



The rows and columns are easy to operate, but a slightly more complex scenario will not work. Here you need to use a macro, to record a certain operation, and then to play back the action just now, so that you can easily copy a large number of repeated operations.



recording shortcut key:Vim (QA) Sublime (ctrl+q) notepad++ ( menu selection )



Stop shortcut key:Vim (q) Sublime (ctrl+q) notepad++ ( menu selection )



Playback shortcut key: Vim (@a) Sublime (ctrl+shift+q) notepad++ (ctrl+shift+p)






Find in 3.4 files



Usage Scenarios:



1. Many times to find the text content of all the files in the directory, Windows Explorer can only find the file name, this time seems to be only a text editor can easily find.



shortcut key:Vim (None) Sublime (ctrl+shift+f) notepad++ (ctrl+shift+f)






3.5 Shaders



Usage Scenarios:



1. In order to easily view the text content, no shader really to the vast text is difficult to find what they want to see, especially as the IDE to write code, see JSON what can also look at the format problem.



shortcut key:Vim (: Sytanx on) Sublime (SUBLIMEREPL) notepad++ (menu selection)






3.6 Displaying whitespace characters





Usage Scenarios:



1. There are times when you need to see how many whitespace characters you have.



2. To distinguish between tabs and whitespace.



3. Make it easier to list.



shortcut key:Vim (none?) ) Sublime (mouse-dragging box) notepad++ (menu selection)






37,000 plug-in available



If the above common features are not what you want, go to the plugin library to find, generally you can think of have already. For example, the automatic format of JSON format, associative word auto-complement.



shortcut key:Vim (not how to install) Sublime (Ctrl+shift+p then enter the install package) notepad++ (menu selection)






4 written at the end



The real text editor is a very powerful and handy tool that frees you from the tedious and repetitive editing of text that you have in absolute value. There is no use of the handy little partner feel to pick a piece of your text editing tool it!



The charm of the text editor-dedicated to your favorite vim, Sublime


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.