This link has been bookmarked by 528 people . It was first bookmarked on 02 Mar 2006, by W.H Q.
-
26 Jan 18
Thomas JamesSeven habits of effective text editing https://t.co/5Lv8q73nmc // general principles, examples with Vim
-
09 Jan 18
-
08 Jan 18
-
31 Dec 17
-
18 Jun 17
kevinoempty
-
30 May 17
-
19 Apr 17
-
21 Feb 17
-
28 Dec 16
-
02 May 16
-
27 Mar 16
-
22 Oct 15
-
06 Oct 15
-
using a good editor and using it effectively
-
-
01 Jun 15
-
12 Mar 15
-
03 Mar 15
-
10 Nov 14
-
08 Nov 14
-
29 Jul 14
-
27 Jul 14
-
09 Jul 14
-
21 Apr 14
-
24 Mar 14
-
11 Mar 14
-
1. Move around quickly
-
reading, checking for errors and looking for the right place to work on
-
Navigating through the text is done very often,
-
*command. -
incsearch
-
hlsearch
-
Use
%to -
[{to jump back -
gdto jump from -
2. Don't type it twice
-
3. Fix it when it's wrong
-
4. A file seldom comes alone
-
to take advantage of your editor to make working with several files more efficient.
-
jumping between files.
-
creating a tags file is the first thing I do when browsing a program.
-
5. Let's work together
-
6. Text is structured
-
7. Make it a habit
-
You need to learn new commands and turn them into a habit.
-
-
14 Feb 14
-
06 Feb 14
-
18 Jan 14
-
1. Move around quickly
Most 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.
-
- While you are editing, keep an eye out for actions you repeat and/or spend quite a bit of time on.
- Find out if there is an editor command that will do this action quicker. Read the documentation, ask a friend, or look at how others do this.
- Train using the command. Do this until your fingers type it without thinking.
There are three basic steps:
-
- You find that when you are editing C program files, you often spend time looking for where a function is defined. You currently use the
*command to search for other places where the function name appears, but end up going through a lot of matches for where the function is used instead of defined. You get the idea that there must be a way to do this faster. - Looking through the quick reference you find a remark about jumping to tags. The documentation shows how this can be used to jump to a function definition, just what you were looking for!
- You experiment a bit with generating a tags file, using the ctags program that comes with Vim. You learn to use the
CTRL-]command, and find you save lots of time using it. To make it easier, you add a few lines to your Makefile to automatically generate the tags file.
Let's use an example to show how it works:
- You find that when you are editing C program files, you often spend time looking for where a function is defined. You currently use the
-
Some people use Notepad for everything, and then wonder why other people get their work done in half the time...
-
Don't overdo it. If you always try to find the perfect command for every little thing you do, your mind will have no time left to think about the work you were actually doing.
-
Part 2: edit more files
4. A file seldom comes alone
People don't work on just one file. Mostly there are many related files, and you edit several after each other, or even several at the same time. You should be able to take advantage of your editor to make working with several files more efficient.
-
5. Let's work together
An editor is for editing text. An e-mail program is for sending and receiving messages. An Operating System is for running programs. Each program has its own task and should be good at it. The power comes from having the programs work together.
-
A simple example: You need to write a summary of no more than 500 words. Select the current paragraph and write it to the "wc" program:
vip:w !wc -w. The external "wc -w" command is used to count the words. Easy, isn't it?
-
-
19 Dec 13
-
31 Oct 13
-
20 Sep 13
-
25 Aug 13
-
09 Jun 13
-
19 Apr 13
-
10 Apr 13
mtt ggllSeven habits of effective text editing http://t.co/xfogwWeRs2 // general principles, examples with Vim
– Unix tool tip (UnixToolTip) http://twitter.com/UnixToolTip/status/321996155112288256 -
07 Mar 13
-
09 Feb 13
-
17 Jan 13
-
05 Dec 12
seanyoIf 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. -
13 Oct 12
-
10 Oct 12
-
08 Oct 12
-
06 Oct 12
-
nikerymvia Instapaper: Unread http://www.instapaper.com/u
Vim: Seven habits of effective text editing (2000) https://t.co/YJghst9EhX (cmts https://t.co/EI8QXMXGQf)
— Hacker News YC (@newsycbot) January 7, 2018 -
24 Sep 12
-
25 Aug 12
-
04 Aug 12
-
27 Jul 12
-
18 Jul 12
-
1. Move around quickly
-
Navigating through the text is done very often, thus you should learn how to do that quickly.
-
If you see a specific word and want to search for other occurrences of the same word, use the
*command. -
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 -
Use
%to jump from an open brace to its matching closing brace. Or from a "#if" to the matching "#endif". Actually,%can jump to many different matching items. It is very useful to check if () and {} constructs are balanced properly. -
Use
[{to jump back to the "{" at the start of the current code block. -
Use
gdto jump from the use of a variable to its local declaration. -
Well, you don't need to; instead realize what your specific way of editing is, and learn only those commands that make your editing more effective.
-
- While you are editing, keep an eye out for actions you repeat and/or spend quite a bit of time on.
- Find out if there is an editor command that will do this action quicker. Read the documentation, ask a friend, or look at how others do this.
- Train using the command. Do this until your fingers type it without thinking.
There are three basic steps:
-
Looking through the quick reference
-
"I want to get the work done, I don't have time to look through the documentation to find some new command". If you think like this, you will get stuck in the stone age of computing. Some people use Notepad for everything, and then wonder why other people get their work done in half the time...
-
Don't overdo it. If you always try to find the perfect command for every little thing you do, your mind will have no time left to think about the work you were actually doing. Just pick out those actions that take more time than necessary, and train the commands until you don't need to think about it when using them. Then you can concentrate on the text.
-
2. Don't type it twice
-
Very often you will want to change one word into another. If this is to be done in the whole file, you can use the
:s(substitute) command. If only a few locations needs changing, a quick method is to use the*command to find the next occurrence of the word and usecwto change the word. Then typento find the next word and.(dot) to repeat thecwcommand. -
If you organise your editing around it, many changes will become a matter of hitting just that
.key -
The
.command repeats the last change -
Instead you might want to mark the location with the
mcommand -
Vim has a completion mechanism that makes this a whole lot easier
-
You can type "XpmCr", then hit
CTRL-Nand Vim will expand it to "XpmCreatePixmapFromData" for you -
You type
qato start recording into register 'a'. Then you type your commands as usual and finally hitqagain to stop recording. When you want to repeat the recorded commands you type@a -
3. Fix it when it's wrong
-
Very often you will make the same mistake again and again. Your fingers just don't do what you intended. This can be corrected with abbreviations. A few examples:
:abbr Lunix Linux :abbr accross across :abbr hte the
-
The same mechanism can be used to type a long word with just a few characters. Especially useful for words that you find hard to type, and it avoids that you type them wrong. Examples:
:abbr pn penguin :abbr MS Mandrake Software
-
With a syntax file you can highlight all words that are not in the lis
-
In Vim it is implemented with scripts and you can further tune it for your own use: for example, to only check the comments in a program for spelling errors.
-
Part 2: edit more files
-
4. A file seldom comes alone
-
The previously mentioned tag mechanism also works for jumping between files. The usual approach is to generate a tags file for the whole project you are working on
-
creating a tags file is the first thing I do when browsing a program.
-
Another powerful mechanism is to find all occurrences of a name in a group of files, using the
:grepcommand -
Vim knows about include files, and can search them for a word you are looking for
-
In Vim you can split the text area in several parts to edit different files. Then you can compare the contents of two or more files and copy/paste text between them. There are many commands to open and close windows, jump between them, temporarily hide files, etc. Again you will have to use the three basic steps to select the set of commands you want to learn to use.
-
The preview-tag mechanism is a very good example. This opens a special preview window, while keeping the cursor in the file you are working on
-
5. Let's work together
-
6. Text is structured
-
Part 3: sharpen the saw
-
7. Make it a habit
-
Most people only need to learn 10 to 20 percent of the commands for their work
-
If you do a task only once, and don't expect having to do it again, don't try to optimise it. But you probably realize you have been repeating something several times in the last hour.
-
-
14 Jul 12
-
20 Jun 12
-
22 May 12
-
02 Apr 12
-
14 Mar 12
-
23 Feb 12
-
15 Jan 12
-
15 Dec 11
-
10 Dec 11
-
04 Dec 11
-
30 Nov 11
-
28 Nov 11
-
22 Oct 11
-
28 Sep 11
-
27 Sep 11
-
24 Sep 11
-
20 Sep 11
-
19 Sep 11
-
12 Sep 11
Fictrix .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.
-
09 Sep 11
-
29 Aug 11
-
23 Jun 11
-
15 Jun 11
-
23 May 11
-
17 May 11
-
14 May 11
-
25 Apr 11
-
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]
-
-
23 Mar 11
-
11 Mar 11
-
05 Mar 11
-
Use
gdto jump from the use of a variable to its local declaration.
-
-
30 Dec 10
-
07 Dec 10
-
26 Nov 10
-
24 Nov 10
-
15 Nov 10
-
in and again. Your fi
-
-
06 Nov 10
-
25 Oct 10
-
12 Oct 10
-
21 Sep 10
-
03 Sep 10
-
23 Aug 10
-
14 Aug 10
-
31 Jul 10
-
17 Jul 10
-
23 Jun 10
-
20 Jun 10
Page Comments
Bram Moolenaar
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.
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.