Searching \ for '[EE] Is vi worth learning?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=worth+learning
Search entire site for: 'Is vi worth learning?'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Is vi worth learning?'
2007\11\24@235502 by Vitaliy

flavicon
face
I've read a few things on the 'Net, but wanted to get a few first-person
accounts from the engineers/programmers on this list. :)

Is the learning curve really as steep as some say (weeks/months)? Is the
benefit of faster/easier editing worth it?

2007\11\25@000402 by Alex Harford

face picon face
On Nov 24, 2007 8:52 PM, Vitaliy <spam_OUTspamTakeThisOuTspammaksimov.org> wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?

Those lousy Emacs users will probably say no, but I say yes.  :)  It's
worth it for the regex capabilities alone.  The learning curve is
steep... I have been using it for approximately 10 years and I am
still learning new things.

Alex

:wq

2007\11\25@001327 by Neil Cherry

picon face
Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?

There is value in learning vi. It is not that complicated to
learn. Make sure you know h (left), j (down), k (up), l (left),
x (delete), i insert, esc (change mode), $ (end of the line),
0 (beginning of the line), : enter command mode, ZZ (write), in
command mode w (write), q (quit), q! (really quit), wq (write
and quite). This won't teach you how to use the editor for
programming but it's useful for editing on just about any
Unix system. The newer systems (Linux and BSD) vi has a lot
more options.

BTW, I'm an emacs user (a heritic ;-) but I know how to do
basic editing in vi.

--
Linux Home Automation         Neil Cherry       .....ncherryKILLspamspam@spam@linuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2007\11\25@001338 by Bob Blick

face picon face
Hi Vitaliy,

You'll never get as much out of vi as you put into it. Some people like
that, not me. There are plenty more interesting things I'd rather learn.

The only vi you should learn is enough to do basic editing so you can
edit files on a system with no other editor.

But if the only choice I had was vi or emacs, I would choose vi.

Cheerful regards,

Bob


Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?
>

2007\11\25@003530 by Charles Craft

picon face
You got plenty of responsed before anyone asked what you're going to use it for.

Well?

I've got 20 years using it so I couldn't tell you what keystrokes I
use in vi, they just flow subconsciously.

If you're going to be admin on a *nix system then it's a must.

If you're writing code or the next great novel then there are probably
more appropriate editors.


-----Original Message-----
{Quote hidden}

>-

2007\11\25@011734 by Vitaliy

flavicon
face
Charles Craft wrote:
> You got plenty of responsed before anyone asked what you're going to use
> it for.
>
> Well?

Occasionally I need to edit a file on our fileserver, but I prefer to use
nano (the other guy uses vi). But there's another reason (see below).

> I've got 20 years using it so I couldn't tell you what keystrokes I
> use in vi, they just flow subconsciously.
>
> If you're going to be admin on a *nix system then it's a must.

I hope not. :)

> If you're writing code or the next great novel then there are probably
> more appropriate editors.

This goes contrary to what I read (and what prompted me to start this
thread):

<http://www.viemu.com/a-why-vi-vim.html>

I was mostly interested in how much vi can help speed up code writing.
Frankly, you said what I wished to hear -- thank you. ;)

Vitaliy

2007\11\25@015325 by Xiaofan Chen

face picon face
On 11/25/07, Neil Cherry <EraseMEncherryspam_OUTspamTakeThisOuTcomcast.net> wrote:
> Vitaliy wrote:
> > I've read a few things on the 'Net, but wanted to get a few first-person
> > accounts from the engineers/programmers on this list. :)
> >
> > Is the learning curve really as steep as some say (weeks/months)? Is the
> > benefit of faster/easier editing worth it?
>
> There is value in learning vi. It is not that complicated to
> learn. Make sure you know h (left), j (down), k (up), l (left),
> x (delete), i insert, esc (change mode), $ (end of the line),
> 0 (beginning of the line), : enter command mode, ZZ (write), in
> command mode w (write), q (quit), q! (really quit), wq (write
> and quite). This won't teach you how to use the editor for
> programming but it's useful for editing on just about any
> Unix system. The newer systems (Linux and BSD) vi has a lot
> more options.

That is what I learned in 1991/1992 (PDP and VAX) and I still only
know so much in 2007. These basic commands sever me
well. Whenerve pico (or nano) is available, I will use pico or
nano intead. And actually I use gedit/kwrite the most often
under Linux.

> BTW, I'm an emacs user (a heritic ;-) but I know how to do
> basic editing in vi.
>

Never used emacs and never think I will need to use it.

Xiaofan

2007\11\25@021434 by William \Chops\ Westfield

face picon face

On Nov 24, 2007, at 10:53 PM, Xiaofan Chen wrote:

> Never used emacs and never think I will need to use it.

I've been an emacs user since the days when my excuse was
that it was the one editor that had versions for all the
operating systems I used: ITS, TOPS10, TOPS20, CP/M and the
up-and-coming unix.  And never learned vi.

But I have to admit that the command set has been extended
far beyond sanity (probably for both emacs and vi), and
version skew is annoying.  I increasingly find myself using
cursor keys and mouse instead of basic editor commands, and
things just haven't been the same since I can't drop into a
minibuffer and use TECO commands.  (At some point, even the
mlisp minibuffer disappeared and I haven't been motivated
enough to go find out what happened to it.)

BillW

2007\11\25@041829 by Peter Onion

flavicon
face
On Sat, 2007-11-24 at 21:52 -0700, Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?

vi is worth it because it's going to be available on (almost) every unix
based machine you may ever come across.

It's all very well saying "I always use (Insert your favourite GUI
editor here)", but what are you going to use to edit /etc/X11/xorg.conf
when your X-windows configuration is wrong for the new graphics card you
just put into your machine ;)

PeterO  (vi user since BSD 4.1 on a Vax 11/750)


2007\11\25@044859 by Morgan Olsson

flavicon
face
Den 2007-11-25 10:18:27 skrev Peter Onion <Peter.Onionspamspam_OUTbtinternet.com>:

> It's all very well saying "I always use (Insert your favourite GUI
> editor here)", but what are you going to use to edit /etc/X11/xorg.conf
> when your X-windows configuration is wrong for the new graphics card you
> just put into your machine ;)

Easy.  I booted the LiveCD  ;)

I really *tried* starting vim but as i had never used it before and had no documentaion and not even basic knowledge of command structure, i  even had trouble navigating the help...

Thanks gyus for the pointers in this thread :)

--
Morgan Olsson

2007\11\25@054707 by peter green

flavicon
face

> It's all very well saying "I always use (Insert your favourite GUI
> editor here)", but what are you going to use to edit /etc/X11/xorg.conf
> when your X-windows configuration is wrong for the new graphics card you
> just put into your machine ;)
>
>  
mcedit or if that isn't installed and I can't easilly install it nano.

2007\11\25@081518 by Byron Jeff

flavicon
face
On Sat, Nov 24, 2007 at 09:52:54PM -0700, Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)

I teach vi in my Intro to Unix class. Glad to oblige.

> Is the learning curve really as steep as some say (weeks/months)?

Not for the basics. And most modern versions (I use vim for example)
kills most of the initial modal quirkiness. Pretty much hit the 'i'
key, use the arrow keys and backspace and it functions like most simple
editors such as nano.

As for all the subtle nuances, I think in some ways you never learn them
all. Most folks get to a functional subset and use them exclusively.

> Is the benefit of faster/easier editing worth it?

Personally I think most of the faster/easier comes from the application of
regular expressions. Nowadays there are other ways to do it (perl/Python
for example) but with vi it's right there for you without having to go
write a separate program to process. One example I use in my class is:

-------------------------------------------------
A file contains records in the following format:

Lastname:FirstName:123-45-6789:Address

Convert the file to create accounts with passwords in the form:

FL6789:FL456789

Finally the file separates groups of records with blank lines which should
be deleted.
-------------------------------------------------

To delete the blank lines:

:%g/^$/d

To reformat:

:%s/\(.\)[^:]*:\(.\)[^:]*:...-\(..\)-\(....\).*/\2\1\4:\2\1\3\4/

The regex is somewhat complicated using backreferences to capture the parts
of the line that need to be reformatted. But when you can apply that across
a 6500 line file (which I've had to do before) and reformat everything, it's
certainly worth the effort.

I had a similar task when I was working on a consulting gig doing some
Motorola 56002 DSP work. There was a program file with 512 FFT constants that
needed to be reformatted. I was working on a Windows 95 box with
EDIT/Notepad at the time and realized it was going to be one time consuming
task to hand edit the formatting. I took the time to download a Windows
copy of vim from the net and fired it up. The regex substitution
reformatted the file in nothing flat.

vi/vim certainly isn't the only way to do it. As another poster pointed out
vi is pretty ubquitous in installation and other environments. But it isn't
a magic bullet where you'll suddenly start writing code 50 times faster.
And in todays Unix environments there are several dozen editors available,

But vi/vim is available everywhere and works in both text and graphics
environments. So it's good enough for me.

BAJ

2007\11\25@082124 by Stephen R Phillips

picon face

--- Vitaliy <@spam@spamKILLspamspammaksimov.org> wrote:

> I've read a few things on the 'Net, but wanted to get a few
> first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is
> the
> benefit of faster/easier editing worth it?
>
It took me a day or two.  I use it once a year these days.  VI though
can be quite frustrating if you forget how to add text etc.  Depends on
what you want to do and what you are used to.

Stephen

Stephen R. Phillips was here
Please be advised what was said may be absolutely wrong, and hereby this disclaimer follows.  I reserve the right to be wrong and admit it in front of the entire world.


     ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

2007\11\25@083120 by peter green

flavicon
face

> Not for the basics. And most modern versions (I use vim for example)
> kills most of the initial modal quirkiness. Pretty much hit the 'i'
> key, use the arrow keys and backspace and it functions like most simple
> editors such as nano.
>
>  
trouble is of course the time you are forced into using vi rather than
nano/pico/joe/mcedit is the time you are likely to be forced into using
a very old quirky vi variant.

2007\11\25@092655 by Rolf

face picon face
Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?
>
>  
I was about to respond strongly in the affirmative to this request....
that you absolutely had to learn vi.... but, then I realized my
significant bias.

I am a computer programmer working with 'big' financial systems. I've
done work on Mainframes through to desktops with many flavours of Unix
in between. Typically the systems I work on have seperate administrative
departments, in other words, I am a user of the system rather than an
administrator. In addition, in financial institutions it is very unusual
to have any 'extra' software installed on a machine. In environments
like banks, I would give a very bad impression if I got to a client and
indicated that "Sorry, I can't help because I can't find an editor I
know." Essentially, in places where UNIX is used in 'secure', or
'mission critical' ways, It is likely that there will be no other editor
than vi, or sometimes emacs available. But, emacs will only be installed
if one of the senior system administrators was an emacs 'fan'. Still,
even if emacs is installed, there will still be vi.

The bottom line, in my job, knowing vi is as critical as knowing "ls",
or "mkdir", or "tar". I simply would be ineffective without it....
(although, I have been to places where I have had to edit files with
'sed' because there was no interactive editor at all available on a
machine..... ;-)

If you were to ask this question a decade ago, I would have said
'absolutely' immediately. 'vi' is the basis for many paradigms in UNIX
environments. The whole concept of using modal interfaces, the concepts
of using hjkl as cursor keys, etc. Knowing vi makes playing
rogue/nethack posssible .... alternatively, playing 'nethack' will go a
long way toward  teaching you vi.

In the current world, I would say that learning vi is less critical,
perhaps not even necessary, but, it does make life a lot easier sometimes.

vim is vi improved. It is seldom available on the systems I use, but,
when it is I am in development heaven. There are some languages that are
better written in other editors. I believe that Java, and other langages
with custom IDEs are better programmed in those IDEs. But, vim is very
useful and very mature if you ever have to write documents in the
following: HTML, Perl, Python, C, C++, shell scripts (csh, sh, tcsh,
zsh, ksh, etc.), PHP, etc. vim provides formatting, colour syntax
highlighting, etc. Such comprehensive support for so many text document
formats is hard to find (impossible) in any other editor. Whn vim is not
available, you can use vi, and all the basics still work.

It is hard to be objective, but, if I were to make a recommendation to
for example a student just starting a computer-related degree, where
they would be using a UNIX system (linux, etc.), I would strongly advise
they learned vi. To a person who is already established in UNIX who does
not know vi, I would be less forceful.

I have been trying to think of a good analogy in 'the real world', and
the best I can come up with is that driving vi is like driving a
standard transmission car. Other editors are like driving an automatic.
Driving a standard car allows you to do so much more in the sense that
you can apply your instincts to so many more situations ...

Rolf

2007\11\25@094454 by Xiaofan Chen

face picon face
On 11/25/07, peter green <KILLspamplugwashKILLspamspamp10link.net> wrote:

> trouble is of course the time you are forced into using vi rather than
> nano/pico/joe/mcedit is the time you are likely to be forced into using
> a very old quirky vi variant.

Sometimes it is just that you have not installed those things yet
and you only have vi which comes with even a minimal install.
Actually I am now typing in a newly installed FreeBSD 6.0 Release.
I intend to upgrade it to 7.0 through CVSUP. So I just did a
small installation.

mcuee@localhost$ uname -a
FreeBSD localhost.localdomain 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu
Nov  3 09:36:13 UTC 2005
RemoveMErootTakeThisOuTspamx64.samsco.home:/usr/obj/usr/src/sys/GENERIC  i386
mcuee@localhost$ pico
-bash: pico: command not found

2007\11\25@094708 by Forrest W Christian

flavicon
face
Vitaliy wrote:
> Is the learning curve really as steep as some say (weeks/months)?

No it's not that bad, although it might take that long for your brain to
switch into vi mode.

> Is the benefit of faster/easier editing worth it?

Most programming-type tasks are much faster in vi, once you know how to
use it - partially because you never grab for the mouse, and partially
because of the interesting additional features in vi.   Like % which
takes you to the matching paren...   or odd syntax like "12yyP" which
makes a copy of the 12 lines following the cursor, or "D" - delete to
end of line.  or "j" - join the next line to this one....  or "cw" -
replace the word at the character position with what you are about to
type, etc.

If you can get your mind around the concept of you are issuing commands
to the editor to do things you normally would do by moving the cursor to
a specific location and then either backspacing or typing, then you are
in good shape.   Another example...  if you want to add something to the
spot before the cursor, you hit "i" (insert).  If you want it after the
cursor, you hit "a" (after).  If you want it at the start of the line
you are on, you hit a capital "I", and a capital "A" does the end of the
line.    Want to indent the next three lines? Hit 3>> .  Unindent the
next 3 lines?  3<<

Yes, learning these takes some time, but once you know the ones which
you personally use a lot, editing gets a lot easier.  Plus, the general
syntax is similar for all commands - so something which works with say
insert will also work with delete... such as capitalizing the letter
means "to the end of the line" and prefixing with a number means do it
to that many items.

That said, If you treat vi like a typical text editor (move the cursor
instead a lot instead of giving vi commands), I would say it is much
worse for normal tasks.

-forrest

2007\11\25@100147 by Xiaofan Chen

face picon face
On 12/25/07, Forrest W Christian <spamBeGoneforrestcspamBeGonespamimach.com> wrote:
> Vitaliy wrote:
> > Is the learning curve really as steep as some say (weeks/months)?
>
> No it's not that bad, although it might take that long for your brain to
> switch into vi mode.

I think it is much better than the line oriented editor
like DOS edlin and the Honeywell DPS8 GCOS editor (forgot
the name) I used to learn Fortan 77.

VAX/VMS editor (EDT) is not that bad as edlin. But then
I only used edlin for very short time (DOS3.3) since ne/pe
and EDIT came out.

Xiaofan

2007\11\25@103644 by Herbert Graf

flavicon
face
On Sat, 2007-11-24 at 21:52 -0700, Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)?

Weeks/Months? I use VI (actually mostly VIM and VILE, but sometimes just
plain VI) every single day (vile is one of the only editors that can
open 2+GB files and yet retain lots of functionality and speed, for
smaller stuff VIM is great for the syntax highlighting and the support
for more of the cursor keys) for the last 5+ years. That said, pretty
much every time I see someone else use VI (or one of it's cousins) I
learn something new.

The learning with VI never seems to stop, there's always something new
out there... That said, for VI to be truly useful I'd say around a week
or two is probably a good learning curve. You don't stop learning after
that, but at that point you know "enough" to know WHAT to ask.

> Is the
> benefit of faster/easier editing worth it?

Without question IMHO. VI is designed to edit files using only a
keyboard. While this sounds very slow and backwards, in reality it is
extremely powerful. With the right button presses I can select a whole
file, or just a range, position the cursor at the beginning of the 4th
word on a line, or the end, all with only a few keyboard taps.

The regex stuff is extraordinarily powerful, and this is mostly where
the learning never ends.

The biggest benefit of knowing VI is pretty much every single linux/unix
distro on the planet has vi installed by default. Heck, I flashed my
linksys router with the DDWRT firmware, logged in through telnet and
there was vi ready to edit the files I needed to edit.

TTYL

2007\11\25@112655 by Neil Cherry

picon face
Xiaofan Chen wrote:
> On 12/25/07, Forrest W Christian <TakeThisOuTforrestcEraseMEspamspam_OUTimach.com> wrote:
>> Vitaliy wrote:
>>> Is the learning curve really as steep as some say (weeks/months)?
>> No it's not that bad, although it might take that long for your brain to
>> switch into vi mode.
>
> I think it is much better than the line oriented editor
> like DOS edlin and the Honeywell DPS8 GCOS editor (forgot
>  the name) I used to learn Fortan 77.

We had punch cards so there was no editor other than
ourselves. :-)

> VAX/VMS editor (EDT) is not that bad as edlin. But then
> I only used edlin for very short time (DOS3.3) since ne/pe
> and EDIT came out.

The VMS default editor wasn't bad, it would have been nice
if I had a chance to learn it before being made the admin
of the VMS boxen we had. In the lab where I work I tend to
be one who gets stuck with the oddball support for protocols
used by the Cisco router. I started with IOS 7.0 and supported
things like XNS, PUP, DECNet (and LAT/LAST/LAVT), HP printing
and netbeui (ick). I play with more modern protocols like
MPLS, BGP and various IP over IP schemes. Oh the command line
editor in the Cisco router is emacs like. :-)

Edlin is an editor I learned to hate! I've used the Unix ed and ex
editor before learning edlin. Ed/ex I could tolerate but edlin I
just hated.

I also disliked switching between modes in vi but I did appreciate
it when I had to dial into a Unix box and the modem line wasn't
clean. Those modes saved me more than one when noise struck.

--
Linux Home Automation         Neil Cherry       RemoveMEncherryspamTakeThisOuTlinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2007\11\25@141808 by Tamas Rudnai

face picon face
The original VI is quite hard to learn let's say (there is no cursor
movement but keys like 'j', 'k', 'h' or 'l'). VIM (Vi IMproved) in the other
hand quite decent on modern operating systems - not only cursor keys can be
used but mouse with block editing functionality. I just can't live without
those functionalities it provides. Regexp is one of the things only but the
capability of searching for phrases on a touch of a button, of the
capability of listing up variables where where they used, to display a
#define just to touch a button again etc loads of loads of things.

The basic editor functionality is easy to use: if you are using it as a
replacement of other text editor you just have to learn 3 or 4 commands
(with the graphical version maybe even less). The only thing is that when
you use vim too much you got used to familiar with touching ESC all the time
so when you are doing something else you may get in trouble with pressing
ESC when you finished or 'i' before editing :-) iYou cwmay Rget osomething
xllike Athis :D

Tamas



On Nov 25, 2007 4:26 PM, Neil Cherry <ncherryEraseMEspam.....comcast.net> wrote:

{Quote hidden}

> -

2007\11\25@185535 by Xiaofan Chen

face picon face
On Nov 26, 2007 12:26 AM, Neil Cherry <RemoveMEncherryspam_OUTspamKILLspamcomcast.net> wrote:
> Xiaofan Chen wrote:
> > I think it is much better than the line oriented editor
> > like DOS edlin and the Honeywell DPS8 GCOS editor (forgot
> >  the name) I used to learn Fortan 77.
>
> We had punch cards so there was no editor other than
> ourselves. :-)
>

I only used punch card once in a university emchanical
engineering training session (to input the program for
an old NC machine). It is a pain.

Xiaofan

2007\11\25@190503 by Joshua Shriver

picon face
That's a nice breakdown.  I'm a nano/emacs user myself, but been wanting to
use vi since some systems only have it.

I was always lost when I couldn't use the arrow keys to move around the
test. So your description is a good intro list of how to get it done at
least. Thanks
-Josh

On Nov 25, 2007 12:13 AM, Neil Cherry <RemoveMEncherryTakeThisOuTspamspamcomcast.net> wrote:

{Quote hidden}

> -

2007\11\25@193751 by Bob Blick

face picon face


Neil Cherry wrote:
>
> learn. Make sure you know h (left), j (down), k (up), l (left),

Hi Neil,

"l" is not left, it's right. It's one of the ways I remember the
direction keys in vi!


Cheerful regards,

Bob

2007\11\25@194217 by William \Chops\ Westfield

face picon face
>
>> Is the  benefit of faster/easier editing worth it?

You didn't say...  Faster/easier compared to WHAT?  I doubt that
most users of a true "programmers' editors" (emacs, brief, TextMate,
epsilon, etc) would consider it worthwhile to convert to vi. But
if you're using a "word processor" or one of the rather minimal
editors that tend to be included with microcontroller IDEs, then
I was say that learning at least ONE of the more advanced editors
is definitely worthwhile...

(The MOST annoying thing about the IDE editors is that they're
manufacturer specific.  Even if the MPLAB editor happens to be
wonderful for editing PIC code, you can't carry over its useful
features when editing AVR code or MSP430 code or VC++ code, and
that's a real pain...)

BillW


2007\11\25@195832 by Bryan Bishop

picon face
On Sunday 25 November 2007, Rolf wrote:
> vim is vi improved. It is seldom available on the systems I use, but,
> when it is I am in development heaven. There are some languages that
> are

I have been using vim off-and-on for the past four years, as a fairly
active programmer I'd have to wonder, what sort of differences do you
see between vim and vi that makes vim a development heaven?

- Bryan

2007\11\25@200801 by Neil Cherry

picon face
Bob Blick wrote:
>
> Neil Cherry wrote:
>> learn. Make sure you know h (left), j (down), k (up), l (left),
>
> Hi Neil,
>
> "l" is not left, it's right. It's one of the ways I remember the
> direction keys in vi!

Dyslexia strikes again! ;-)

--
Linux Home Automation         Neil Cherry       RemoveMEncherryKILLspamspamlinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2007\11\25@214049 by soliton

picon face
Moving from "other editor" we know to vi/vim is very difficult. You
will get stuck every where, different command keys, a strange command
and edit mode. It made me mad when I first tried this editor. So I
gave up using this editor for almost a year and use SciTE instead (a
good and free editor). But then I came back to learn to use vi/vim,
now it made me addicted, I even try to use vi command in every editing
input :) such as my forefox address bar ;). Well, what I want to say
is, when you get through the first barrier, you will enter a whole
different new world, with new things to explore every day :), you will
want everything come with vi/vim input style :D

--
soliton
------------------------------------
Diskusi di http://phimega.com/forums

2007\11\25@221725 by Rolf

face picon face
Bryan Bishop wrote:
> On Sunday 25 November 2007, Rolf wrote:
>  
>> vim is vi improved. It is seldom available on the systems I use, but,
>> when it is I am in development heaven. There are some languages that
>> are
>>    
>
> I have been using vim off-and-on for the past four years, as a fairly
> active programmer I'd have to wonder, what sort of differences do you
> see between vim and vi that makes vim a development heaven?
>
> - Bryan
>  
Hmm, re-reading what you quoted... it was possibly somewhat overstated,
but, the things I really like about vim are:

smart-indent - very useful for getting the indents right in various file
formats (perl, etc.) Saves a lot of space-key pressing.
fast syntax highlighting - Lets you know exactly where mismatched quotes
are, etc. Especially as you are typing.
parenthesis matching - makes reading poorly formatted programs a lot easier.
expand-tab - not usre if this is in vi too, but very useful for 'fixing'
tab-indented code when I prefer space-indented.
syntax highlighting (did I mention that one already?).
The poor children in Uganda -
http://ianua.initd.org/vimit/vim70/html/uganda.html

For me it is mostly the syntax highlighting. I have (over time) become
very familiar with it, and things just make more sense when I look at
it, especially when working in multi-developer environments (which I am
almost always doing) because things look right even if formatted
differently.

I can't, off the cuff, think of other vim-exclusive features that I am
missing, but, that's just because I can't think of all the basic vi
features either.

Rolf

2007\11\26@123547 by Howard Winter

face
flavicon
picon face
Xiaofan,

On Mon, 26 Nov 2007 07:55:33 +0800, Xiaofan Chen wrote:

> I only used punch card once in a university emchanical
> engineering training session (to input the program for
> an old NC machine). It is a pain.

Huh!  You were lucky!  We had to punch all our programs in the Computer Science "A" Level course onto paper tape, using ASR33 teletypes.  At least with cards you
can throw away a bad one and just repunch it, or insert a new one.  If you miss something out on tape you have to copy the tape to the insertion point (at 10 cps)
and then type the new part, then copy the rest.  Cards are luxury by comparison...

I dunno, kids of today...  (uphill both ways in the snow, etc. etc. :-)

Cheers,


Howard Winter
St.Albans, England


2007\11\26@142411 by James Newton

face picon face
If "$" moves you to the end of the line, why doesn't "^" move you to the
beginning?

And why doesn't "d" delete a char, then "dl" delete a line, "dw" delete
word, etc...? Ok, I already know... It's because "x" is a single character
command and "d" is always a 2 character command. Makes the parser easy to
write.

--
James

{Original Message removed}

2007\11\26@170658 by Tamas Rudnai

face picon face
'^' moves to the first valuable char in the line, so for example you have a
formatted C source code, most of the lines starts other than the zero
position - goes to that char which makes sense I think. If you press '^'
twice on many vi implementation you'll go to the 0 position. But if you
press '0' then you go there straight.

With 'd' just think it over if you press 'd' how vi would know if you
intended to use the single 'd' or a double one like 'dd' or 'dw'. That's why
'x' is good :-) otherwise the parser would have to time out when you do not
press the second letter but then you'll be angry if you are slower tan that
or angry again if you have to wait a minute to delete a single char :-) With
vim for example you can use DEL and BS if you prefer that.

One of the strength of vi is the advanced use of these commands, like delete
till end of line: 'D' (capital d), or delete 50 lines '50dd' or delete 35
chars '35x' or delete till the bookmark a "d'a" or delete till semicolon
'df;' or delete till end of file 'dG' etc. There are just too much to
mention and would be quite confusing at the first time - but once someone
gets familiar with the basics will never wants to use other than vi :-)

Tamas




On Nov 26, 2007 7:24 PM, James Newton <jamesnewtonSTOPspamspamspam_OUTmassmind.org> wrote:

{Quote hidden}

> {Original Message removed}

2007\11\26@185544 by Neil Cherry

picon face
Howard Winter wrote:
> Xiaofan,
>
> On Mon, 26 Nov 2007 07:55:33 +0800, Xiaofan Chen wrote:
>
>> I only used punch card once in a university emchanical
>> engineering training session (to input the program for
>> an old NC machine). It is a pain.
>
> Huh!  You were lucky!  We had to punch all our programs in the Computer Science "A" Level course onto paper tape, using ASR33 teletypes.  At least with cards you
> can throw away a bad one and just repunch it, or insert a new one.  If you miss something out on tape you have to copy the tape to the insertion point (at 10 cps)
> and then type the new part, then copy the rest.  Cards are luxury by comparison...

Common you had to know how to read and repair paper tape. ;-)
Luckily I only had to read it every once in a while.

--
Linux Home Automation         Neil Cherry       spamBeGonencherrySTOPspamspamEraseMElinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2007\11\26@215828 by Apptech

face
flavicon
face
Ken:  last paragraph

>> If you miss something out on tape you have to copy the
>> tape to the insertion point (at 10 cps)
>> and then type the new part, then copy the rest.  Cards
>> are luxury by comparison...

> Common you had to know how to read and repair paper tape.
> ;-)
> Luckily I only had to read it every once in a while.


Or for editing cut the tape and insert a patch as you
mentioned :-).

My ME thesis uP system output its data on paper tape, even
though that media was even then long obsolete, because the
Burroughs B6700 mainframe being used to analyse the data had
a paper tape reader, and that was the most accessible form
of data input to it. Writing N track mag tape wasn't a
realistic option (although I had previously built an 8 track
tape reader using a MC6800 microprocessor). There's a
certain something (not necessarily good :-) ) to seeing your
data converted to many metres of paper tape and thousands of
chads. The chads make interesting (aka annoying) confetti as
they cling well to the skin due to small size. Not really
practical as they are also an eye hazard.

Reading paper tape with a home made reader is a dream - 9
photo diodes and a bright light. Clock off the 9th hole dot
feed line and hand pull at speed - tape breakage is the
upper limit of what can be achieved when hand feeding. In my
case the photo diodes were too wide to allow all to be
mounted in a single row at tape hole spacing so they were
staggered and half read on a different byte. Realign data
bits after input. [[Ken Mardle built the read head AFAIR.
Still in my museum I think.]].




       Russell


2007\11\27@043555 by Michael Rigby-Jones

picon face


-----Original Message-----
From: KILLspampiclist-bouncesspamBeGonespamMIT.EDU [EraseMEpiclist-bouncesspamEraseMEMIT.EDU] On Behalf
Of Forrest W Christian
Sent: 25 December 2007 14:47
To: Microcontroller discussion list - Public.
Subject: Re: [EE] Is vi worth learning?

Vitaliy wrote:
> Is the learning curve really as steep as some say (weeks/months)?

No it's not that bad, although it might take that long for your brain to

switch into vi mode.

> Is the benefit of faster/easier editing worth it?

Most programming-type tasks are much faster in vi, once you know how to
use it - partially because you never grab for the mouse, and partially
because of the interesting additional features in vi.   Like % which
takes you to the matching paren...   or odd syntax like "12yyP" which
makes a copy of the 12 lines following the cursor, or "D" - delete to
end of line.  or "j" - join the next line to this one....  or "cw" -
replace the word at the character position with what you are about to
type, etc.

Any decent programmers editor will let you do pretty much everything
without touching the mouse. I have used VI in the past, but IMO using it
these days is akin to going back to the old Word Processors that
required you to put escape codes in for formatting.  You can use it very
effectively after a lot of practice, but most people want to get on with
the job in hand rather than having to spend a long time learning a
non-intuitive tool.

For instance my favoured editor on Win32 is Ultraedit, it supports regex
expressions for search/replace (and across multiple files), supports
column mode which is invaluable when formatting tables etc, has a built
in hex editor, support multiple character encodings EBDIC, UTRF-8 etc,
syntax colouring, CTags, Macros and many other features.  It's also one
of the few applications that I have NEVER had lock up in the last 10
years.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2007\11\28@134042 by stef mientki

picon face
Vitaliy wrote:
> I've read a few things on the 'Net, but wanted to get a few first-person
> accounts from the engineers/programmers on this list. :)
>
> Is the learning curve really as steep as some say (weeks/months)? Is the
> benefit of faster/easier editing worth it?
>
>  
Interesting to see that this question or the way this question is asked,
almost only gives positive feedbacks,
thereby completely ignoring the rest of the universe,
where editors exist for which you have to learn nothing ;-)

cheers,
Stef

2007\11\28@140853 by Dario Greggio

face picon face
stef mientki wrote:

> Interesting to see that this question or the way this question is asked,
> almost only gives positive feedbacks,
> thereby completely ignoring the rest of the universe,
> where editors exist for which you have to learn nothing ;-)

Same feeling here :-)

--
Ciao, Dario
--
ADPM Synthesis sas - Torino

2007\11\28@160933 by Apptech

face
flavicon
face
BCC: What do Ken and Ross use?
___________

>> Interesting to see that this question or the way this
>> question is asked,
>> almost only gives positive feedbacks,
>> thereby completely ignoring the rest of the universe,
>> where editors exist for which you have to learn nothing
>> ;-)

> Same feeling here :-)

Maybe. But it seems a fine way to handle it if the question
asked is what is wanted to be known.
The question was not "Is vi a good editor" or "how does vi
compare to other editors" but "is vi good enough to be worth
the effort to learn, and how hard is it anyway". ??? <- use
these ?'s as required.

I personally have never used vi, and have used a number of
editors that require you to "learn nothing", at least
relative to vi, apparently, and still use several of these.
But, despite the complexities made apparent by the thread,
the information on vi's capabilities and the reasons for
using it that people have listed have been compelling
enough to make me think that I would like to learn to use it
"one of these days". (ie preferably tomorrow but probably it
will be never ;-) ). I often enough wish to process lists of
information, often file names, and my usual approach when
the tools are inadequate, is to write a small program to
handle the task in whatever language. It is evident from
what has been said that most of what I do in such cases
could be handled by a single vi line.



           Russell


2007\11\29@150525 by Gerhard Fiedler

picon face
Apptech wrote:

> It is evident from what has been said that most of what I do in such
> cases could be handled by a single vi line.

... or by a command in any of the other editors that can work with regexps
(assuming that you're talking about general text manipulations).

Usually learning to work with such an editor (better called "editing
system") takes a while; vi is not alone in this. And that's one of the
reasons why I still use CodeWright: it does a lot of these things (so the
pressure to switch is not really there, even though it's a dead product), I
don't work on Linux (CodeWright is Windows-only), I don't much work on
other people's systems (so I don't have to be able to get by with what's
usually there), especially not if it's Linux (I know the editors that come
with standard Windows anyway :) and I know it already (so learning e.g. vi,
Xemacs or some other powerful editor doesn't really look like a big thrill
:).

I'd say that anybody who spends a considerable time coding that's not very
much bound into a specific IDE should look into a generic code editor. IME
productivity can really be quite a bit better than without it. But the
features and approaches vary widely between these editors, and so do the
affinities with them, so the choice may not be easy. It's even less so when
you think that spending a couple hundred bucks into something that you use
probably for a few hours every working day is not a big expense for a
business, and expand your choices into the non-free editors. The fact that
with most of them you only discover whether you really like them or not
after you've learned enough to be able to configure them the way you like
it doesn't make the choice any easier, either.

(FWIW, what I've read here doesn't exactly make me /want/ to learn vi :)

Gerhard

2007\11\29@165644 by Dario Greggio

face picon face
Apptech wrote:

> The question was not "Is vi a good editor" or "how does vi
> compare to other editors" but "is vi good enough to be worth
> the effort to learn, and how hard is it anyway". ??? <- use
> these ?'s as required.

I did try using it back in 1989 more or less.
I found it even worse than EDLIN, though more powerful. In the
meanwhile, I was starting using Windows Notepad and MSVC EDIT in DOS,
and they were much nicer IMO.

I always agree that such tools have to be known in order to maintain a
System (it may happen), but sure I'd not spend more than a bit of time
on it.

--
Ciao, Dario

2007\11\30@232443 by soliton

picon face
The key to learn vi/vim is to master and get comfortable with its
command mode. It is not easy to switch from common modeless editor. At
first, it seem stupid to have such kind of command mode and edit mode
such as in vi/vim, but when you master it, you could never live
without it :) The power of vi/vim lies on its command mode, but of
course it cost you learning time. Therefore in my personal opinion you
should learn vi/vim only if you think learning is fun, and you eager
to find something new everyday. Vi/vim is not for every one. If you
don't have time to learn, and only want to edit something or in hurry
of choosing an editor, please do choose other countless good modeless
editor out there. :D

--
soliton
------------------------------------
Diskusi di http://phimega.com/forums


'[EE] Is vi worth learning?'
2007\12\02@230257 by Byron Jeff
flavicon
face
On Mon, Nov 26, 2007 at 11:24:54AM -0800, James Newton wrote:
> If "$" moves you to the end of the line, why doesn't "^" move you to the
> beginning?

  It does. The first non blank character on the line IIRC. Yup. Just
tested it. The 0 (zero) command moves to the beginning of the line even if
there's a blank there.

> And why doesn't "d" delete a char, then "dl" delete a line, "dw" delete
> word, etc...? Ok, I already know... It's because "x" is a single character
> command and "d" is always a 2 character command. Makes the parser easy to
> write.

Right. The d command is always followed by a direction command. So dl is
acually equivalent to 'x'.

BAJ

2007\12\03@030825 by Xiaofan Chen

face picon face
On 12/3/07, Byron Jeff <@spam@byronjeff@spam@spamspam_OUTclayton.edu> wrote:
> Right. The d command is always followed by a direction command. So dl is
> acually equivalent to 'x'.

but dd will delete the whole line. ;-)

2007\12\03@055227 by Peter Todd

picon face
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Dec 02, 2007 at 11:01:12PM -0500, Byron Jeff wrote:
{Quote hidden}

Cool, combining d, and 0, deletes everything up to the cursor...

- --
http://petertodd.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHU9wL3bMhDbI9xWQRAs0WAJ9mBjhaqdrE7W/tb5rPvsdfcggOCACfQQZi
G1bjOfePjPnefaQShmCjeIE=
=W7NT
-----END PGP SIGNATURE-----

2007\12\03@061330 by Tamas Rudnai

face picon face
I like the "df;", "d]}" and "d[{" commands when dealing with C files - those
that are quite hard to do with ordinary editors :-)

Tamas


On Dec 3, 2007 10:35 AM, Peter Todd <spamBeGonepetespamKILLspampetertodd.ca> wrote:

{Quote hidden}

> -

2007\12\03@074947 by Byron Jeff

flavicon
face
On Mon, Dec 03, 2007 at 04:08:22PM +0800, Xiaofan Chen wrote:
> On 12/3/07, Byron Jeff <.....byronjeffspam_OUTspamclayton.edu> wrote:
> > Right. The d command is always followed by a direction command. So dl is
> > acually equivalent to 'x'.
>
> but dd will delete the whole line. ;-)

It actually is consistent. There's no cursor movement that represents the
whole line. So the command set uses the specification of repeating the
command to represent the whole line so:

dd: delete a whole line
cc: change a whole line
yy: yank a whole line

Like I said, consistent. In class I call this the vi command hierarchy and
I find that it's one of its strengths.

BAJ

2007\12\03@085705 by Tamas Rudnai

face picon face
> It actually is consistent. There's no cursor movement that represents the
> whole line.

Actually that's weird for me as the dot (.) supposed to be the
representation of the actual line, so it's a mystery for me why not 'd.',
'y.' or 'c.' works. I agree that 'dd' is faster than 'd.' though.

Tamas


On Dec 3, 2007 12:48 PM, Byron Jeff <TakeThisOuTbyronjeff.....spamTakeThisOuTclayton.edu> wrote:

{Quote hidden}

> -

2007\12\03@120527 by Dave Tweed

face
flavicon
face
Tamas Rudnai <.....tamas.rudnaispamRemoveMEgmail.com> wrote:
> > It actually is consistent. There's no cursor movement that represents the
> > whole line.
>
> Actually that's weird for me as the dot (.) supposed to be the
> representation of the actual line, so it's a mystery for me why not 'd.',
> 'y.' or 'c.' works. I agree that 'dd' is faster than 'd.' though.

'.' represents the /number/ of the current line, not the line itself.
This is so you can do things like ":.,$s/^/> /" to quote the body of
a message, like I just did.

Note the overloading of '$' as well -- in normal command mode, it
represents a movement to the end of the current line, but in extended
(colon) commands, it represents the number of the last line of the buffer.

I've been using vi and vi work-alikes since the mid-1970s, so all of this
is second nature to me. My current setup is emacs + viper, which gives me
the best of both worlds, in a configurable way.

-- Dave Tweed

2007\12\03@193232 by Nate Duehr

face
flavicon
face
Xiaofan Chen wrote:
> On 12/3/07, Byron Jeff <RemoveMEbyronjeffspamspamBeGoneclayton.edu> wrote:
>> Right. The d command is always followed by a direction command. So dl is
>> acually equivalent to 'x'.
>
> but dd will delete the whole line. ;-)

And 22dd will delete 22 lines.

:-)

Nate

2007\12\04@004637 by soliton

picon face
There is also "c" command. You could "cc" change the whole line,
change part of line with ce,cw, c$, or c%, etc.
After taking some commands. You could easily repeat last command with
"." command.
Have I said, I am addicted :) ?




--
soliton
------------------------------------
Diskusi di http://phimega.com/forums


'[EE] Is vi worth learning?'
2008\01\19@014606 by Vitaliy
flavicon
face
Thank you all for your feedback.

However, I'm surprised that no one mentioned vimtutor. I just finished going
through the tutorial, and feel a lot more comfortable with using vi(m). For
those of you completely unfamiliar with vi, and wishing to learn, type
"vimtutor" at the command line.

Vitaliy


2008\01\19@081853 by Rolf

face picon face
Vitaliy wrote:
> Thank you all for your feedback.
>
> However, I'm surprised that no one mentioned vimtutor. I just finished going
> through the tutorial, and feel a lot more comfortable with using vi(m). For
> those of you completely unfamiliar with vi, and wishing to learn, type
> "vimtutor" at the command line.
>
> Vitaliy
>  
That is something I was unaware of.... there are lots if things in vim
like that ;-)

So, what about the original question... Is vi worth learning? Have an
opinion yet?

Rolf

2008\01\25@232627 by Vitaliy

flavicon
face
Rolf wrote:
> So, what about the original question... Is vi worth learning? Have an
> opinion yet?

I'm not sure. :)

For me personally, the primary practical motive to learn vi was to be able
to edit config files on the Linux server. Frankly, I would have much rather
preferred to use a "traditional" editor like the DOS Edit. I may soon get my
wish -- a coworker told me about XMing recently, which I plan to test drive
on our server next week:

http://sourceforge.net/projects/xming

In general, I prefer GUI and mouse over command-line interfaces, especially
for things that I use very rarely. With a visual interface, I know that
eventually I will find what I'm looking for. Commands are meant to be
memorized.

IMHO, unless you have a specific reason to learn vi (be able to edit on any
*nix, use regular expressions, impress friends), it's probably better to
stick with your favorite editor.

Vitaliy

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...