Main Menu

Vi

Started by Muzer, July 08, 2010, 01:44:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Muzer

Is it worth learning how to use vi? I've been putting it off for years as I've been fine with nano - I'm just interested in the opinions of the people who do use it.
[21:42:56] <@Muzer> Apple products used to be good, if expensive
[21:42:59] <@Muzer> now they are just expensive

Kemaweyan

I use it :) For example:

#vi /etc/fstab

then press Insert (on keyboard) and edit the file. After editing press Esc, type :wq and press Enter. That's all ;)
Nìrangal frapo tsirvun pivlltxe nìNa'vi :D

Muzer

I know that, but I meant something more... just for simple functions, it's easier to use nano, but I was wondering if it was worth learning for the less simple functions.
[21:42:56] <@Muzer> Apple products used to be good, if expensive
[21:42:59] <@Muzer> now they are just expensive

Sіr. Ηaxalot

I would say that it isn't worth it, I'm fine with nano :P

Kemaweyan

I don't know why, but in Debian vi works not like in Mandriva (and how I know). And I don't understand how to use it here (when I press arrows this insert symbols into the text). I think, actually now in Debian better to use nano ;)

But in Mandriva vi works fine and I use it in Mandriva clon for flash-memory sticks from 2Gb and above (official Mandriva flash requires 8Gb).
Nìrangal frapo tsirvun pivlltxe nìNa'vi :D

bommel

I'm fine with nano. I know both and for me, nano is much more intuitive to use...

wm.annis

Very often people tend to stick with the first editor they learn.  A really good editor will have all sorts of special powers, and learning them all and to use them effectively is a major investment of brain power.  In my own personal opinion, anyone who programs with any editor than Emacs is clearly insane — but I also realize the learning curve may not seem worthwhile.

Some people can accomplish quite a lot programming huge systems using only vi as their editor.  These days most systems actually have vim, not plain vi.  The #1 reason I went with Emacs oh so long ago was because that editor is programmable.  If I need new functionality, I can add it myself easily (I mean live — I don't have to recompile anything).  These days vim is also programmable, taking it a bit closer to Emacs.

Stick with nano if you're happy with it.  If you plan to become a programmer, or do a lot of programming on your own, it may be worth your time to learn vim or Emacs.  Being able to program your editor is incredibly powerful.  If you're thinking of becoming a Unix sysadmin, then again learning vi might be good, if only the basics.  Not every system you touch will have nano.  While I'm a crazed Emacs user, I still use vi daily for quick system file edits.

(Amusingly, while writing this post, my fingers kept wanting to use vi editing commands.)

Muzer

I do use nano for most of my programming, though sometimes when I'm in a GUI mood I use kate. It has syntax highlighting, and I can get to a terminal with two keystrokes (ctrl + z) and back with three (fg<enter>) to compile, sed, etc., so I don't see why I would want to use emacs or vi{,m}. But I have heard generally that there are a lot of advantages to each (though other than your "programmable" comment, nobody has really been specific...), so I'm still wondering.

Also, is it at all easy to use on a Dvorak-keyboard? I've heard that it's very QWERTY-centred...
[21:42:56] <@Muzer> Apple products used to be good, if expensive
[21:42:59] <@Muzer> now they are just expensive

wm.annis

Quote from: Muzer on July 08, 2010, 04:17:24 PMBut I have heard generally that there are a lot of advantages to each (though other than your "programmable" comment, nobody has really been specific...), so I'm still wondering.

That programmability is the most giant one for me.  Plus, just like there are perl libraries, and python libraries, etc., there are emacs libraries and vim libraries (though vim's language is less powerful).  Almost anything you could possibly need to edit has some convenience library waiting for you already.

QuoteAlso, is it at all easy to use on a Dvorak-keyboard? I've heard that it's very QWERTY-centred...

The default key commands of both editors do make some qwerty assumptions.  In Emacs it is trivial to rebind key commands, though I gather the most recent versions of Emacs have a built-in Dvorak mode.  With old vi you're probably stuck, but vim is tweakable (google on "vim dvorak" or "emacs dvorak" for many discussions).

hawnuyuna'viyä

#9
Of course Vi is worth it - the raw power at your fingertips....
(Although emacs people will say the same about that.)

As with any skill once mastered, it *will* be useful in someway. With vi if you do lots of programming, then you will definetely find it useful. On the other hand, emacs offers a more established (quicker?) way to customize it - hence it has been jokingly called a complete OS.

I would suggest going straight to vim though, as it offers many improvements over its predecessor.

I do use vim with a dvorak layout without too many problems - I actually find some of the keys in a better place - but I don't use the onkeyboard navigation, I have to use the arrow keys.

To finish: a compulsory link to xkcd #378, and (although tauting emacs - the vi curve is true too) this.

Edit: Perhaps I did this too balanced? I suppose we don't want this thread to turn into another battle in the Editor wars.

Muzer

The interesting thing is, C-x M-c M-butterfly DOES actually do something in Emacs.

(And by "vi" I kind of meant "vim"; I thought the two terms were kind of used interchangeably as everyone now uses vim - maybe I was wrong)
[21:42:56] <@Muzer> Apple products used to be good, if expensive
[21:42:59] <@Muzer> now they are just expensive

hawnuyuna'viyä

Quote from: Muzer on July 08, 2010, 05:40:15 PM
The interesting thing is, C-x M-c M-butterfly DOES actually do something in Emacs.

(And by "vi" I kind of meant "vim"; I thought the two terms were kind of used interchangeably as everyone now uses vim - maybe I was wrong)
I consider the 2 seperately, which should be done otherwise problems can be found since to have the full power of vim, you have to :set nocp, otherwise you lose out!

If you go in for learning vim, consider switching WM to something like Awesome, otherwise you wll keep having to revert to the mouse (BAD!).

'Oma Tirea

Quote from: Muzer on July 08, 2010, 01:44:25 PM
Is it worth learning how to use vi? ... I'm just interested in the opinions of the people who do use it.

Why is it I first thought of the Na'vi suffix when I first saw this thread....
[img]http://swokaikran.skxawng.lu/sigbar/nwotd.php?p=2b[/img]

ÌTXTSTXRR!!

Srake serar le'Ìnglìsìa lì'fyayä aylì'ut?  Nari si älofoniru rutxe!!

Lisa

Quote from: Muzer on July 08, 2010, 05:40:15 PM
The interesting thing is, C-x M-c M-butterfly DOES actually do something in Emacs.

(And by "vi" I kind of meant "vim"; I thought the two terms were kind of used interchangeably as everyone now uses vim - maybe I was wrong)

VIM is short for "Vi IMproved".   It takes regular vi and adds a lot more functionality to it.   vi is frequently aliased to vim.   If you are used to vim, getting vi only can be a bit of a shock.

I learned on vi, but do prefer vim.  I've used Emacs as well, but I confess mostly just for Gnus.   Lisp gives me headaches.  :)

A time honored tradition:  http://en.wikipedia.org/wiki/Editor_war


Oeru syaw "Tirea Ikran" kop slä frakrrmi layu oe "Grammar Skxawng"   :)

bommel

I use IDEs for programming (i. e. Visual Studio and Eclipse). The only computers where I need a console text editor are my servers and they have both installed (vim & nano).

hawnuyuna'viyä

Quote from: bommel on July 09, 2010, 01:01:12 AM
I use IDEs for programming (i. e. Visual Studio and Eclipse). The only computers where I need a console text editor are my servers and they have both installed (vim & nano).

When used properly, vim is an IDE.

bommel

Quote from: hawnuyu na'viyä on July 09, 2010, 06:10:00 AM
Quote from: bommel on July 09, 2010, 01:01:12 AM
I use IDEs for programming (i. e. Visual Studio and Eclipse). The only computers where I need a console text editor are my servers and they have both installed (vim & nano).

When used properly, vim is an IDE.
I'm used to VS / WIndows development so there's no need for me to use vim :P
However, I know that some people like and use it.

hawnuyuna'viyä

Quote from: bommel on July 09, 2010, 01:03:44 PM
Quote from: hawnuyu na'viyä on July 09, 2010, 06:10:00 AM
Quote from: bommel on July 09, 2010, 01:01:12 AM
I use IDEs for programming (i. e. Visual Studio and Eclipse). The only computers where I need a console text editor are my servers and they have both installed (vim & nano).

When used properly, vim is an IDE.
I'm used to VS / WIndows development so there's no need for me to use vim :P
However, I know that some people like and use it.

I am an ex-VS user. I even went so far as to purchase vs.php so I could do web dev. from inside it too - but it didn't work very well under wine (for some reason (.net .not; I am looking at you!)).
Since I didn't like eclipse's primary focus being on Java (rather than C), I went back and customised vim to do exactly what I wanted.

bommel

I use Eclipse at work (Java EE). But somehow I'm the only one who has always problems with it...

Puvomun

Quote from: Muzer on July 08, 2010, 01:44:25 PM
Is it worth learning how to use vi? I've been putting it off for years as I've been fine with nano - I'm just interested in the opinions of the people who do use it.
It is worth it. Esp if you pursue a career involving unix or linux. vi is installed on every box.


OT but cool.
Krr a lì'fya lam sraw, may' frivìp utralit.

Ngopyu ayvurä.