Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Learn vi/vim in 50 lines and 15 minutes

by diotalevi (Canon)
on Mar 04, 2004 at 00:55 UTC ( #333744=note: print w/replies, xml ) Need Help??

in reply to Learn vi/vim in 50 lines and 15 minutes

So what am I doing to get into merlyn's beep mode? I'd end up there all the time when I tried using vim and if I hit escape enough times ( which was always more than I thought I had to - I think six or seven times was about right ) I'd get back to "nav" mode. Heck, nano is nicer than that!

I also never figured out how to backspace a newline off and had to resort to typing everything from the next line onto the end of the previous line again because newlines at the end can't be deleted.

Also, also, really long lines just truncate (visually only, mind you) so I'd have to cursor over to see the entire thing and only the bit that fit into the 80 character window.

So why is this so popular anyway?

A late addition... I had another thought - is this like Umberto Eco's intention with the first two hundred pages of The Name of the Rose? I recall it was something along the lines of keeping all the readers who weren't willing to slog through two hundred pages of book just to get to the good bits out. Is that vim's mode?

  • Comment on Re: Learn vi/vim in 50 lines and 15 minutes

Replies are listed 'Best First'.
Re: Re: Learn vi/vim in 50 lines and 15 minutes
by thelenm (Vicar) on Mar 04, 2004 at 01:15 UTC

    So why is this so popular anyway?

    Because it's extremely fast and powerful once you know what you're doing. I can edit at least 3-5 times as quickly using Vim as anything else I've tried. Maybe more, I haven't benchmarked it. :-)

    And with Vim just about everything is customizable so if you don't like the way something works by default, you can configure it how you want it. For example, your truncated lines example: use :set wrap and presto, line-wrapping. And the help documentation (:help) in Vim is very good. It's how I've learned almost everything I know about Vim.

    Oh, and for getting rid of newlines between lines, I think you were missing the 'J' command (join two lines). Or maybe :set backspace=eol, which allows you to backspace over newlines in Insert mode.

    -- Mike

    XML::Simpler does not require XML::Parser or a SAX parser. It does require File::Slurp.
    -- grantm, perldoc XML::Simpler

Re: Re: Learn vi/vim in 50 lines and 15 minutes
by tachyon (Chancellor) on Mar 04, 2004 at 01:40 UTC

    I also never figured out how to backspace a newline off

    Ah INSERT MODE backspace key works for me and will backspace you to the begining of the file if you hold it down long enough.... Here is your post after I did G A Backspace + Hold it down and wait.....

    ~ ~ ~ ~ -- INSERT --


    J will join lines ie remove newlines too. J will remove the newline at the end of the cursor line effectively joining the next line to it.....

    As noted in NAV mode DEL deletes stuff. BACKSPACE just works like left arrow or h and navigates you. GOK!



      Ah INSERT MODE backspace key works for me and will backspace you to the begining of the file if you hold it down long enough

      It'll backspace over line breaks if you "set backspace=eol".

      I have backspace set to "indent, eol, start" in my .vimrc. indent allows me to backspace over autoindented lines, eol allows backspacing over line breaks, and start allows backspacing past the starting insertion point.

      <sarcasm>A list of all available options can be found with the obvious and intuitive command ":he Q_op"</sarcasm>, in case a vi/vim beginner is looking.

Re^2: Learn vi/vim in 50 lines and 15 minutes (beep mode)
by tye (Sage) on Mar 04, 2004 at 19:09 UTC

    I thought it was funny and a bit sad that "ESC ESC ESC" was mentioned in the vi tutorial. The only advantage of "ESC ESC ESC" over "ESC" is that it beeps at you after exiting insert mode.

    You enter "beep mode" by typing ESC (an odd number of times) when you aren't in insert mode (but this doesn't happen to me since I use a Real® OS where function keys don't send ESC sequences).

    If you type ESC, then there is a pause while vi waits to see if it is the start of an escape sequence or is just a plain ESC. If you type something else during this period, vi looks if the sequence is an ESC sequence for a function key (or other special key), probably finds that it isn't, and so then processes the ESC as a single keystroke (which produces a beep since there is no function for ESC when in 'nav mode').

    So beep mode is caused by people hitting ESC *one* too many times and then cycling through hitting ESC more times to try to figure out what mode they are in. If you simply wait several seconds, the beep mode passes.

    Note also that any vi produced in the last decade can show you when you are in insert mode so you don't have to hit ESC trying to figure out whether you are in insert mode or not.

    - tye        

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333744]
[Discipulus]: I read an article about how much the female condition has got worst in the eastern europe after the fall of social policies
LanX has a friend in Berlin who switched to go(lang) and just got a kid ...
[marto]: good morning all
[Corion]: Hi marto ;)
[Discipulus]: Corion ah! you opened a new search path! thanks
[choroba]: LanX No, but they grow and want more!
LanX was conditioned by a female
Discipulus my 'kids' always complain with our car..
[LanX]: true, cars are bad in growing
[marto]: WaitWindow()

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2017-01-17 09:45 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (154 votes). Check out past polls.