Sunday, January 20, 2013

SCRIPT: Understand enter and edit text



Seven habits of effective text editing

Bram Moolenaar

November 2000

If you spend a lot of time typing plain text, writing programs or HTML, you can save much of that time by using a good editor and using it effectively. This paper will present guidelines and hints for doing your work more quickly and with fewer mistakes.The open source text editor Vim (Vi IMproved) will be used here to present the ideas about effective editing, but they apply to other editors just as well. Choosing the right editor is actually the first step towards effective editing. The discussion about which editor is the best for you would take too much room and is avoided. If you don't know which editor to use or are dissatisfied with what you are currently using, give Vim a try; you won't be disappointed.[Vim commands and options are printed in this font]

Part 1: edit a file

1. Move around quicklyMost time is spent reading, checking for errors and looking for the right place to work on, rather than inserting new text or changing it. Navigating through the text is done very often, thus you should learn how to do that quickly.Quite often you will want to search for some text you know is there. Or look at all lines where a certain word or phrase is used. You could simply use the search command /pattern to find the text, but there are smarter ways:If you see a specific word and want to search for other occurrences of the same word, use the * command. It will grab the word from under the cursor and search for the next one.If you set the 'incsearch' option, Vim will show the first match for the pattern, while you are still typing it. This quickly shows a typo in the pattern.If you set the 'hlsearch' option, Vim will highlight all matches for the pattern with a yellow background. This gives a quick overview of where the search command will take you. In program code it can show where a variable is used. You don't even have to move the cursor to see the matches.In structured text there are even more possibilities to move around quickly. Vim has specific commands for programs in C (and similar languages like C++ and Java):Use % to jump from an open brace to its matching closing brace. Or from a "#if" to the matching "

2 comments:

  1. 01-21 13:52:54.927 D/AudioHardwareMSM8660(170) value of device and enable is 2 1 ALSA dev id:2 01-21 13:52:54.897 V/AudioPolicyManagerBase(170) 01-21 13:52:55.157 W/PhoneWindow(1230) Previously focused view reported id 2131230740 during save, but can't be found during restore. 01-21 13:52:55.177 I/APACHE HTTP (thCr=71) - NafHttpAuthStrategyDefault(1230) (thUse=71) The GBA permission wasn't requested for this process.
    (thUse=71) It is impossible to support GBA now (many possible reasons: no Android Context, current client is GBA service, etc.), then it will be just usual HTTP.

    ReplyDelete
  2. We have should our very best to enjoy the transaction with the projected transporting opportunity
    on the web presence. Thatd be pretty nifty eh, having that sort of power in your
    hands, having the capability to whenever you liked. This may take some time and getting used to but it will be well worth the effort to set up and,
    given that it.

    Feel free to visit my web site; https://www.facebook.com/

    ReplyDelete