Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Tuesday October 24 2017, @07:28AM   Printer-friendly
from the what-about-emacs? dept.

It's an old article, but if you use vi/m it's always good to read a refresher. I've been using the editor for almost 30 years and always learn something new:

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.

[...] The point is that you need to get to know these commands. You might object that you can't possibly learn all these commands - there are hundreds of different movement commands, some simple, some very clever - and it would take weeks of training to learn them all. 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.

There are three basic steps:

        1. While you are editing, keep an eye out for actions you repeat and/or spend quite a bit of time on.
        2. 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.
        3. Train using the command. Do this until your fingers type it without thinking.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by darkfeline on Wednesday October 25 2017, @03:47AM (2 children)

    by darkfeline (1030) on Wednesday October 25 2017, @03:47AM (#587254) Homepage

    As a former Vim user, I am well aware of how efficient Vim is at shifting around characters, but text editing is menial labor. Standing at a higher level, it's cute how Vim users see themselves as superior to Notepad users. Look at how efficiently I can move these characters around!

    The Emacs revelation is that your editor should be easy to program so that you can let your editor do your grunt work for you. While a Vim user would be busy composing single letter commands, I run commands that manipulate large chunks of code. Sure, it takes a few extra keystrokes, but can a Vim user apply De Morgan's laws to a ten line boolean expression with three keystrokes? Nay, for he is too busy deleting and inserting individual words with his oh-so-efficient composable commands. Can a Vim user extract a closure into a class with five keystrokes? Nay, for he is too busy trying to get his substitute regular expression correct (he can't be blamed however, for Vim has four different kinds of regular expressions: magic, no-magic, very magic, and very no-magic. I kid you not.)

    --
    Join the SDF Public Access UNIX System today!
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by TheRaven on Wednesday October 25 2017, @01:38PM (1 child)

    by TheRaven (270) on Wednesday October 25 2017, @01:38PM (#587360) Journal
    You realise that vim has support for Python, Ruby, Lua, Tcl, and Perl as optional scripting language and Vim Script built in?
    --
    sudo mod me up
    • (Score: 2) by darkfeline on Thursday October 26 2017, @07:24AM

      by darkfeline (1030) on Thursday October 26 2017, @07:24AM (#587734) Homepage

      You realize that Vim support for Python et al would be hilarious if it wasn't so sad? Having to call eval() all the time to run VImL does not count as "support for Python". And are you really suggesting that VimL is an acceptable language? PHP would be better, and that's not a very high bar.

      And Vim is mostly written in C, not extensible unless you count recompiling Vim. You'd have to read through Vim's horrible code first; just ask the Neovim guys how much fun that is.

      --
      Join the SDF Public Access UNIX System today!