
Seven habits of effective text editing (2000) - laktak
http://moolenaar.net/habits.html
======
jimmaswell
I've used vim quite a bit but it still never beat GUI editors for me. The lack
of a mouse cursor was always a pain point - for example simple copy/pastes
take notably longer. Moving a block of code below another block of code takes
1 second in notepad++ while in vim you have to go V 10d x 13down P or
something along those lines, figuring out exactly what numbers to use there
probably takes more than 1 second alone. It always feels claustrophobic
editing a file in vim, like I'm having tunnel vision, and jumping around files
to understand the structure of a program or write a feature that changes many
things is more time consuming, and pgup/pgdn and arrow keys just aren't as
good as a scroll bar.

Overall I'm glad vim exists so editing config files remotely is easier if I
don't have the server mounted locally - it's definitely my favorite shell text
editor so far but I'd take notepad++ or visual studio over it any day.

~~~
jonahx
> Moving a block of code below another block of code takes 1 second in
> notepad++ while in vim you have to go V 10d x 13down P or something along
> those lines, figuring out exactly what numbers to use there probably takes
> more than 1 second alone.
    
    
        dip}p
    

which would be pure muscle memory to an experienced vim user, and certainly
faster than doing it with a mouse.

Vim isn't for everyone, but I mean, it's not really fair to criticize
something because you don't know how to use it well yet (though complaining
about the learning curve would be reasonable)...

~~~
jimmaswell
I didn't mean just blocks of code that would be recognized as a paragraph or
are fully enclosed in brackets or anything like that. I mean moving some lines
around possibly within the same function, which may or may not have multiple
newlines between some of them, and have no lexically distinctive property
aside from being the lines you want.

~~~
jonahx
I'd make a few counterpoints there:

1\. Even in those situations, I believe a veteran vim user would still beat
someone using a mouse.

2\. That said, the situation you describe is relatively rare: when coding you
typically will be addressing blocks of text defined as functions; sharing an
indent level ("ii" selects these); or otherwise selectable by vim in 2-3
keystrokes.

3\. Even when that's not the case and the vim selection takes, say, 5 or 6
keystrokes, it has the advantage that your fingers never left the home row, so
there is no wasted time "resetting."

4\. Just as a tip: doing a "/" search for 2-3 characters after making your
visual selection is typically enough to define your block, and will often be
faster (and less of a cognitive distraction) than trying to eyeball or count
the number of lines and doing a "10j" motion or similar.

~~~
stabbles
> sharing an indent level ("ii" selects these)

That doesn't seem to work. Am I missing something?

~~~
jonahx
I'd forgotten that I get this feature from a plugin:

[https://github.com/michaeljsmith/vim-indent-
object](https://github.com/michaeljsmith/vim-indent-object)

------
samlittlewood
Used to work with two programmers:

First would type out a few lines of code incredibly fast with lots of mistakes
(and not bothering to backspace over wrongness) - then go back and clear up
damage using notepad level editing.

Second would stare fixedly at screen for several seconds, whilst remaining
still as a statue, then carefully emit the minimum string of editing commands
to achieve the change.

Their actual rate of progress was pretty much identical.

~~~
fogleman
Surely there's a middle ground...

~~~
whipoodle
The midpoint between x and x is x.

~~~
tedunangst
Except there are two different x values here. It is the y value that is the
same. What is the y value for an x between the two endpoints?

~~~
whipoodle
GGP stated "the rate of progress was pretty much identical", so are there two
x values?

~~~
brandonhsiao
x is text editing style, y is efficiency.

~~~
whipoodle
Well, I say x is efficiency.

------
tambourine_man
Google Talk with Bram Moolenaar from 2007

7 Habits For Effective Text Editing 2.0:
[https://www.youtube.com/watch?v=eX9m3g5J-XA](https://www.youtube.com/watch?v=eX9m3g5J-XA)

------
bunkerbewohner
Personally I'm extremely happy with the vim plugin in Jetbrains IDEs like
IDEA, Rider and so on. It gives me the best of both worlds. I can use vim
commands for effective navigation but also have the great static code
analysis, smart auto completion, project navigation (find symbol, class, file,
...) etc. of the IDE.

~~~
fokinsean
Same, I am a casual vim user and the IntelliJ plugin covers most of my needs.

------
madhadron
Stripped of the vim baggage (yes, I know vim; yes, I stopped using it as my
primary editor in the 1990's), it comes down to:

1\. Learn to use the code navigation features of your environment (or get a
better environment).

2\. Learn to use incremental search and replace in your environment (or get a
better environment).

4\. Make autocomplete work in your environment (or get a better environment).

3\. Make your often used actions one click or one command.

For (1) and (3), Visual Studio and IntelliJ are by far the best options
available. (2) seems to be fine in any modern editor. For (4), acme is the
best I've seen: you write your commands in a buffer, and click on the ones you
want when you want them. If the buffer is a small one at the top of the
window, it's the menu bar.

~~~
wodenokoto
What is ACME?

~~~
madhadron
Acme is an editor from Plan 9.
[https://en.wikipedia.org/wiki/Acme_(text_editor)](https://en.wikipedia.org/wiki/Acme_\(text_editor\))

------
pka
My dream is having an actually working/accurate to the character consumer-
grade eye tracker that people can glue onto their screen. Then to move around
in vim, look at where you want to go and just press a key.

I think this alone would allow for a jump in effectiveness almost as great as
the jump from notepad to vim.

~~~
jonahx
In the meantime, there is:

[https://github.com/easymotion/vim-
easymotion](https://github.com/easymotion/vim-easymotion)

~~~
pka
Yes, easymotion is very nice! Still, it's a cognitive overload I'd rather not
have.

------
jokoon
Selecting text with shift and arrows, moving across words with the control key
and arrow keys, using home and end keys, using CTRL F and CTRL G, all those
are already plenty enough for me.

I honestly don't understand why people use VIM or Emacs. I'm much more
productive just with notepad.

Most editors can fold code block, use syntax highlight to make code so much
more readable (if you take time to choose the right colors), highlight braces,
autocomplete (even sublime text can do a weak autocomplete which is already
quite handy).

To be honest, when you learn to type, using the shift, control, home and end
keys should be the second thing you learn. Forget about vim and emacs, those
were for times when people were coding over SSH. Use Nano if you're in a
terminal. Also most of what coders do is read code, not write it.

~~~
59nadir
> Forget about vim and emacs, those were for times when people were coding
> over SSH.

If you're struggling and have the suspicion that it might not be worth it for
you in the end, sure.

For everyone else, don't be afraid to learn how to be more effective by using
a more expressive feature set for editing.

I think your advice is potentially harmful. Just because you didn't end up
learning this doesn't mean it's useless to other people.

It's quite possible that you're just not learning effectively enough and
you're not grasping the tools correctly. There's no shame in that, but to then
advise people to not learn it only because you couldn't is completely
pointless.

~~~
jokoon
I'm just curious what kind of indispensable feature an editor like emacs or
vim has. I don't see the productivity gain.

Ultimately, it might just be pleasurable to learn to use something new and use
it. You "feel" like you do things differently, but to me it's just another
nerdy gadget thing.

------
j2kun
Folks here assume "text editing" is just structured code editing. I use vim
for more than just editing code trees in one language. I edit unstructured
text (lists, notes, articles), semi-structured markup (latex, markdown), and
machine-readable data that is not in the form of a tree (csvs, tsvs, scraper
output, training data that comes in arbitrary formats).

The mindset I've come to appreciate for vim is that the goal is to have a zen
garden for editing text. Editing text efficiently and seamlessly is the end
goal, and what that text is used for is incidental.

------
foxylad
+1 for using abbreviations to fix mistakes.

I use AutoKey (Linux, surely there are similar apps on OSX and Windows) to do
system-wide abbreviations, including correcting "teh" and "hte". Along with
abbreviating a few common phrases, this probably saves me hundreds of
keystrokes a day.

------
joshvm
Anyone who is wary of trying out an editor like Vim should play dwarffortress
for a bit. It's amazing how fast you pick up the keyboard commands for common
operations.

------
paultopia
mental process:

1\. "wow, the author seems to know a lot about vim!" 2\. _glance up at the
name in the url_ ... ooooooh.

~~~
sametmax
And if you look the urls up, you'll find people are regularly thinking the
same:
[https://news.ycombinator.com/from?site=moolenaar.net](https://news.ycombinator.com/from?site=moolenaar.net)

------
nnq
8\. Switch to an editor that doesn't treat your _code trees_ as dumb strings
of text...

~~~
TeMPOraL
Which, beyond Emacs with Paredit, whatever is called Paredit-as-ported-to-vim,
and some obscure Smalltalk stuff, generally _doesn 't exist_. So yeah. Stay
with Vim or switch to Emacs.

~~~
nuriaion
Still very early but a good try: [https://isomorf.io/](https://isomorf.io/)

~~~
aaron_kent
Some detail on isomorf.io editor:

[https://blog.isomorf.io/an-experiment-in-structured-code-
edi...](https://blog.isomorf.io/an-experiment-in-structured-code-
editing-68b917a9157c)

[https://blog.isomorf.io/the-economics-of-semantic-
coding-7e8...](https://blog.isomorf.io/the-economics-of-semantic-
coding-7e8fd1b421e6)

------
raverbashing
Looks like the site is already gone

~~~
aargh_aargh
Not for me, but in case it is:

[http://web.archive.org/web/20171023122758/http://moolenaar.n...](http://web.archive.org/web/20171023122758/http://moolenaar.net/habits.html)

[http://archive.is/x850b](http://archive.is/x850b)

------
z3t4
One problem with key commands is that there's a lot of keyboard layouts. The
same key can generate different letters depending on the keyboard. So when
building an editor, do you listen to keys or whatever comes out after the key
press(es) !?

------
abakus
Text editing efficiency is overrated, at least for coders.

thinking >>> editing.

If serious non-trivial editing effort is required, write a script to do it.

~~~
lucb1e
> thinking >>> editing.

I've heard that argument before but as a plus point for Vim. I just want to
fix that typo in the next paragraph (}), not have to pick up a mouse and
carefully place the cursor, or move down fifteen lines by hand or something.

~~~
brandonmenc
Who uses mice anymore?

Does anyone here seriously take more than sub-second time to get the cursor on
any given character using a trackpad?

------
ouid
is this really the bottleneck for writing good code though? How quickly you
can type?

------
altestova
Looks solid. Bookmarked

------
mmirate
(2000)

~~~
throwaway2016a
It's Vim... it could be (1992) and probably still be useful to many vim users.
Vim is regularly updated with new stuff but most of the stuff people use day
to day to be more productive is decades old.

I use vim every day and find these old articles are often helpful.

Heck, sometimes I find articles from the 1970s/80s about vi to be still
helpful in vim.

------
miguelrochefort
Why are we still editing text in 2017? Shouldn't someone have come up with
something radically better by now?

~~~
sevensor
Surely you could make that argument about text other than source code? Why
write scripts for television shows instead of using computers to make diagrams
of the plot? Why put words in instruction manuals instead of cartoon pictures
showing how to use the item? (Granted, that works for Ikea.) Why use textbooks
for instruction when you could videotape the lectures instead? For any
application where there's an alternative, even a popular one, text endures.

~~~
miguelrochefort
I make the case for all of them. I'm convinced that natural language is
humanity's bottleneck and should be replaced if we want progress.

I'm actively working on a new communication paradigm that I hope will make
natural languages obsolete.

~~~
sevensor
Your comment is entirely consistent with that position :) I appreciate the
irony of asking if you've written anything about your new communication
paradigm, but, well, have you?

~~~
miguelrochefort
You can probably find bits and pieces in my comment history, but I have not
yet organized my thoughts on paper.

What I have in mind is basically anticipatory computing.

~~~
cujic9
For anybody curious, I did a quick search and came up with these:

[https://news.ycombinator.com/item?id=14941564](https://news.ycombinator.com/item?id=14941564)

[https://news.ycombinator.com/item?id=10567261](https://news.ycombinator.com/item?id=10567261)

[https://news.ycombinator.com/item?id=10774715](https://news.ycombinator.com/item?id=10774715)

[https://news.ycombinator.com/item?id=12296347](https://news.ycombinator.com/item?id=12296347)

The posts are chronological, so you can kind of see the idea developing in Mr.
Rochefort's mind.

------
ndh2
Here's my list of habits for effective text editing:

1) Observe other people edit text, then judge for yourself what is effective
and what isn't, then decide for yourself what to learn and what not to.

------
mezuzi
I was in primary school when this was published. I had never touched a
computer by then and the closest I got to one was maybe 3 or 4 feet. The whole
school had one computer in the library, and the librarian's son played games
on it. That same child died in the Ukraine a couple years ago and I spent the
majority of my waking hours now with a computer.. Life is strange!!

