News for hackers. Stuff that matters.
Re:Learn Linux The Hard Way (β version) by exDM69 on Friday December 21, 2012 @06:02AM (#4952264)
I'm not sure it's a good idea to try to stuff vim in there. It's hard enough to try to learn unix command line skills, throwing vim in to the mix is just a detour. Nano is good enough for tutorial purposes.

And I'm a hard core Vim user. I have no strong opinions for or against specific text editors but any hacker worth their salt should know Vim and/or Emacs to be able to use a powerful text editor when stranded in the console for one reason or another.

But this kind of superficial introduction to Vim is a big disservice. The last thing we need is people who hate Vim because they understand it poorly based on a short tutorial.

Re:Learn Linux The Hard Way (β version) by koralatov on Friday December 21, 2012 @06:32AM (#4952326)
As an enthusiastic-but-incompetent vim user, I concur. Reading through that laughably brief introduction is going to scare off a lot of people, and makes the whole exercise much harder than it needs to be.
Re:Learn Linux The Hard Way (β version) by jiggy2011 on Friday December 21, 2012 @07:15AM (#4952420)
True, but one thing I noticed is that some command line tools like to just throw vi at you unannounced when you do something that required editing.

This was one of the most frustrating things when I was learning linux, "I press buttons but nothing happens, how do I get out of here?"

Re:Learn Linux The Hard Way (β version) by ay on Friday December 21, 2012 @07:28AM (#4952448)
EDITOR environment variable usually takes care of that for most of them.

An esoteric example from my MacOS X:

sh-3.2# EDITOR='cat' vipw | grep root:

root::0:0::0:0:System Administrator:/var/root:/bin/sh

daemon::1:1::0:0:System Services:/var/root:/usr/bin/false

vipw: no changes made

vipw: /etc/master.passwd: unchanged

_cvmsroot:*:212:212::0:0:CVMS Root:/var/empty:/usr/bin/false

sh-3.2#

Great excuse to talk about environment variables and changing/examining them...

Re:Learn Linux The Hard Way (β version) by pfortuny on Friday December 21, 2012 @06:51AM (#4952373)
Yep, I agree: just the feeling of pressing something and nothing happening is too hard for a novice. Thanks for saying this.
Re:Learn Linux The Hard Way (β version) by carlisle_ on Friday December 21, 2012 @08:22AM (#4952562)
I can recall a situation in one of my first experiences with linux where I wound up rebooting a machine because I couldn't figure out how to get out of vim.
Re:Learn Linux The Hard Way (β version) by pfortuny on Friday December 21, 2012 @08:42AM (#4952620)
My first vi experience was on a Unix terminal in a CS laboratory with a lot of people doing serious work and I just hitting keys to see if ANYTHING could take me away from that and the thing just BEEEPed...
Re:Learn Linux The Hard Way (β version) by Draiken on Friday December 21, 2012 @09:42AM (#4952807)
But isn't that a good reason to learn the smallest basics of vim? Maybe it's just me, but after I had my first bad experience with vim, I tried learning the basics so that would never happend again.

Since this is a guide for linux, this is a natural step in the linux learning :)

Re:Learn Linux The Hard Way (β version) by mwargh on Friday December 21, 2012 @07:58AM (#4952505)
I wrote this guide and I'm convinced basic vi usage is essential to learn. I have to encouter a system without vi yet.
Re:Learn Linux The Hard Way (β version) by JasonFruit on Friday December 21, 2012 @10:07AM (#4952905)
I absolutely agree — vi knowledge is essential, and I don't have it yet. Don't capitulate and let others be like me.
Re:Learn Linux The Hard Way (β version) by geophile on Friday December 21, 2012 @11:03AM (#4953165)
The first time I go to a machine for the first time, and I need an editor, I fire up emacs. If it isn't there, I do [apt-get|yum] install emacs, and then I fire up emacs.
Re:Learn Linux The Hard Way (β version) by mwargh_ on Sunday December 23, 2012 @10:33AM (#4959657)
Lucky you :) Good luck running emacs on some embedded things.
Re:Learn Linux The Hard Way (β version) by Draiken on Friday December 21, 2012 @06:57AM (#4952385)
If you want to learn linux, you will need to learn vim.

It's pretty much the only decent editor constant in all linux distos. I think it's better to get it out of the way or the linux user won't be able to edit a file properly.

Re:Learn Linux The Hard Way (β version) by clicks on Friday December 21, 2012 @07:12AM (#4952412)
Uhm.. no.

I know _way_ too many sysadmins, even distro maintainers, seasoned devops engineers, who have stuck with nano, joe, etc. for years and years and still stick by it. Although I am glad that I learned vim when I was starting out some 6 years ago, I wish I had spent all that time learning Python or Perl well. Too often the importance of vim is over-inflated as a necessary skill -- but it's just one _tool_ (besides emacs) that gets you some efficiency. That is all it is. I would _never_ advise someone starting out with Linux to spend huge amounts of time learning vim/emacs, it's too much of a distraction in the beginning.

Re:Learn Linux The Hard Way (β version) by dagw on Friday December 21, 2012 @07:30AM (#4952455)
The big difference between vi and all the other editors out there is that some version of vi is installed by default in just about every variation of *nix you're ever likely to encounter. Vi doesn't have to be your favorite editor, and you don't have to be a power user, but you have to know at minimum how to edit a file with reasonable proficiency, so you're not completely lost the first time you ssh into a box that doesn't have your favorite editor installed.
Re:Learn Linux The Hard Way (β version) by pbhjpbhj on Friday December 21, 2012 @08:28AM (#4952578)
Couldn't you just pull in a nano binary (assuming you've no access to a package manager on the remote host) if you've more than a few lines to edit.
Re:Learn Linux The Hard Way (β version) by dagw on Friday December 21, 2012 @10:18AM (#4952951)
Assuming you have one handy that is statically built against the the right libraries for the right architecture and the right OS, and assuming the machine (and network) is in a state where you can get at the place where the binary is stored. But that is a lot of assumptions and I would rather just take the time learn the basics of vi rather than hope that all those assumptions always happen to be true.
Re:Learn Linux The Hard Way (β version) by Draiken on Friday December 21, 2012 @09:24AM (#4952744)
It's not about being able to install your other favorite editor. It's about knowing how to use the one common editor between linux distros.
Re:Learn Linux The Hard Way (β version) by sjf on Friday December 21, 2012 @10:47AM (#4953082)
If you're a system administrator, it's highly likely that solving this problem is probably as difficult as the original task you had to do.
Re:Learn Linux The Hard Way (β version) by Draiken on Friday December 21, 2012 @07:29AM (#4952453)
But I never said you have to spend huge amounts of time learning vim. You just need to learn the basics and it will help you a lot more than not covering it at all.
Re:Learn Linux The Hard Way (β version) by ht_th on Friday December 21, 2012 @08:40AM (#4952613)
All you need to know is:

press

   i
to start editing text

to save and quit, press

    ESC + : + w + q + ENTER
Re:Learn Linux The Hard Way (β version) by tmrhmd on Friday December 21, 2012 @10:37AM (#4953052)
or just :x
Re:Learn Linux The Hard Way (β version) by nollidge on Friday December 21, 2012 @12:14PM (#4953508)
or Shift+Z-Z
Re:Learn Linux The Hard Way (β version) by pbhjpbhj on Friday December 21, 2012 @08:50AM (#4952645)
IIRC the basics are ":wq"?
Re:Learn Linux The Hard Way (β version) by Draiken on Friday December 21, 2012 @09:50AM (#4952836)
I think the biggest confusion in vi is the insert/normal mode. Unexperienced people tend to think on a text editor when you type ":" you add that to the text, while in vim it's the start of a command :D