Here is the question:
How relevant is vi in a GUI enabled OS like mac?
Recently got my MacBook Pro Retina and I am reading some tutorials, I came across one that uses vi to edit text files. I know vi is a powerful editor, but is it more powerful than a fully fledged, mouse enabled, menu filled, graphical text editor?
on my imho - vi is obsolete, and not intuitive. Waste of time to remember all commands, while u need just simply edit file. Use nano, joe, mcedit, if they are on mac
is it more powerful than a fully fledged, mouse enabled, menu filled, graphical text editor?
Simply put, a whole order of magnitude more powerful. You cannot compare them it's not even funny.

Now before this goes in a major troll-fest, some things to ponder:

vi is old
vi is an old arcane piece of software that has become ubiquitous in modern computing. However it's a bit outdated. Starting the late 80s and all throughout the 90s, a lot of vi-clones projects appeared to modernize the software. The most successful clone (but far from being the only one) is called Vim. This is the one I'll be referring to hereafter.

vi is not obviously better
vi(m) happens to be one of these software that are far better than others, however it is not obviously better. It happens that some people use it for months and still cannot see what the big deal is. The problem is that Vim won't let you save a huge amount of time on one single annoying task. It will however let you save a few milliseconds on tasks you repeat thousands of times a day. This is why the superiority of the editor is very subtle (yet very real).

vi is modal
The main idea behind vi, and the source of its genius, is a technique called "modal" editing. Understanding and embracing the modal mindset is the secret behind successfully adopting the editor. What does modal mean?

On the GUI editors you mention, pressing the "a" key will always have the same effect: Insert character "a" at the current position of the cursor. If you're lucky, you get some modifiers like CTRL or ALT to use the key for some command.

vi works differently. You can either be in "insert" mode (similar to the described above) or in "command" mode. In command mode, keys are actually shortcuts to text-manipulating functions, like "delete", "paste", "repeat (last action)", "change", "replace", ... These actions (commands) can be coupled with targets (I cannot remember the correct appelation), to form complex commands like "move the following paragraph to the top of the file", "replace the two following words with a new one", ... This may not seem much, but think about this: every time you had to press the arrow keys more than twice in a row on your GUI editor, there's a better and more optimal way to do it.

Vim has support for even more powerful commands called macros, which are basically an entry way for programmable shortcuts, (very easy to use). And it comes with a powerful scripting language embedded called Vimscript.

vi is keyboard only
That's not completely true. Vim has gained support for the mouse for years now. However, vi was developed before the mouse ever existed, and can perfectly live without a mouse plugged in. As a matter of facts, most users do not use the mouse at all. The reason is simple: Mouses are slow.

If you are convinced that the power of vi consists of reducing a few milliseconds off every action you do, then you'll quickly realize how much time you lose moving your wrists from the keyboard to the mouse. Keyboard only setups are the first step towards real speed. Do you ever see hackers in Hollywood movies interrupt their flow of typing to select something with the mouse?

One more interesting piece of trivia: vi uses the keys 'h', 'j', 'k', 'l' instead of the arrow keys for cursor movements. The historical reason why it did this was because ... arrow keys were not invented yet (yes, vi is that old!). As a side effet, you don't move your wrists all the way to the arrow keys, and keep them in a single position at all time. You wouldn't believe how much time that saves you until you actually try it.

vi is expert-friendly
This is probably the main weakness of the editor, the reason why it's not more widely adopted. Newcomers have a very hard time with vi, especially if they come from the GUI editors world. A lot of efforts have been put into making the transition as easy as possible, with tutorials, exercises and cheat sheets. However, when it comes to muscle memory, you cannot take shortcuts. From my experience, it takes around a couple of months to notice the first improvements. It also takes a LOT of frustration to get through the first week.

Bottom line, if you want to learn it, you have to commit to it.


vi is famous
It's been around since forever, it can be found anywhere today, and you can find a ton of litterature about it. I'll leave you with my latest favorite Vim story: Vim Creep.
Thanks for the _as expected_ elaborate explanation Rahmu. I had a feeling this topic would provoke you a bit. The thing is, would I need that "subtle" improvement in editing, how much would I be using a basic (not in a bad way) editor as vi vs. using an IDE like XCode or otherwise. I am not planning to write any shell scripts or do programming outside the bounds of an IDE, so the benefits vs. the learning curve don't look that attractive, unless I am missing something.
The thing is, would I need that "subtle" improvement in editing
That's up to you to decide. I cannot tell you whether it's "worth" it or not. There're a ton of amazing things out there, and every skill is worth getting. But do you have time for everything? You have to prioritize.

The best I can give you is my own experience. I used Vim exclusively for a little less than 2 years. It started out of frustration at Eclipse at work (I had a job working in PHP, for the record). I have tried a few other text editorsfor a while. Honestly, it was a refreshing change of pace. But I couldn't decide on any, until I decided to learn the venerable (and scary) Vim.

I started out with the 'vimtutor', the official tutorial for vim. For two weeks, I would repeat the vimtutor every morning before starting work. Sure, I was not very productive these days, and I did get very frustrated a few times. After a month or so, my fingers were getting comfortable with the modal editing. After two months, I remember feeling more productive than ever before. By the time I was 6 months in, it had become standard for random guys at the office to stop behind me just to look at me working, amazed by the speeds I had reached, and asking me the eternal question: "How did you do that?!"

Don't mistake this for me bragging about my speed. I did nothing. This is the natural state of working with Vim. I shifted at the beginning of this year to another editor. It's been 7 months today, I prefer emacs over Vim, but as far as raw speed goes, nothing will ever come close to what I used to do with Vim. And there are old timers who go a whole order of magnitude faster than what I used to.

I don't want to tell you to stop using XCode or VS and replace them by Vim. However, for me, now that I actually know Vim, there is no way I could ever be satisfied with an old and boring IDE. Just the thought of how long it takes to start, to open a file or to move words around. To me, that feels like comparing broadband with the old 33kbps modem. Remember how cool the upgrade to 56kbps was? This is how I feel when someone brags about their new IDE feature: I'm running at 100 MBits/s and you're bragging about a 20kbps increase...

I'm getting lost in my rants. My point is not to criticize IDEs. You're free to do whatever you want with whatever tool you want. But the feeling of extreme empowerment coming from learning this editor is very real and very pleasant.

One final anecdote: A good friend of mine who had an on/off relationship with Vi, just started using Vim again. Yesterday morning he leaves me a message saying, literally "I'm too much in love with vim. I just can't, i just can't." The reason I mention this is because:

1- It's a very common feeling.
2- He's a member here and likes to play devil's advocate way too much. That's my pre-emptive defensive strike before he starts talking nonsense again.
I've been using Vim (mostly in MacVim) for about a year and a half and I love it.

Vim definitely takes a lot of time and commitment to learn well, but if you are good at using Vim you will be more productive at editing code (and other text) than almost anyone using any other editor.

Vim has definitely seen a resurgence lately, and I think among serious programmers it will continue to be popular indefinitely. This recent poll shows that Vim is actually the most popular editor for Ruby on Rails development right now.

If you don't choose to use Vim, I would suggest Sublime Text. It's much more modern in a lot of ways, and you can even use it with Vim key bindings, which would give you the best of both worlds.
rahmu wroteI don't want to tell you to stop using XCode or VS and replace them by Vim. However, for me, now that I actually know Vim, there is no way I could ever be satisfied with an old and boring IDE. Just the thought of how long it takes to start, to open a file or to move words around. To me, that feels like comparing broadband with the old 33kbps modem. Remember how cool the upgrade to 56kbps was? This is how I feel when someone brags about their new IDE feature: I'm running at 100 MBits/s and you're bragging about a 20kbps increase...
How do you debug your code using Vim?
Kassem wroteHow do you debug your code using Vim?
How do you cut your hair using a fork?

Diffrent tools have different purposes. My editor doesn't debug and it's a good thing.

On the rare occasions I need a debugger I use gdb. But most of the time I just use 'print()'.
Kassem wroteHow do you debug your code using Vim?
You don't need to. You have access to a terminal and any debugger relevant to the platform/language you're using.

The IDE provides friendlier usage in terms of visualization but other than that, it's merely uses the debugger for that specific language.

Example: mdgb
Concerning the topic at hand, make no mistake, it's quite easy to get frustrated with Vi(m). It needs patience, it needs time, you could spend years using it and not know 20% of what it's capable of doing.

But believe me when I tell you, once you're comfortable with the basics and start moving onto more advanced use cases, you will not be able to let go of it.

No matter how much you pat it, how much you caress it, how much foreplay time you give it. Vi(m) will not put out.
I use vim. it's nice and easy to use.
Vim gives you a language to talk about editing text.
It understands words, paragraphs, and a lot of other stuff.

This lets you do cool things:
Change this: foo.bar('baz');
Into this: foo.bar('quux');
Vim understands when you say change inside quotes:
ci'quux
As you learn Vim, you begin to think in this text editing language and suddenly you don't have to think about how to move the cursor in order to edit text, you just think of what you want to do with the text and your fingers will automatically make Vim do it.

Here's a more interesting example, stolen from Vim Golf
Change this:

A
list
of
words

Into this:

[ "A", "list", "of", "words" ]
Vim does it blazingly fast with something like this:
4J:%s/ /", "/gI[ "<ESC>A" ]<ESC>
This is saying: Join 4 lines, replace spaces with ", " and insert [ " at the beginning of the line, append " ] to the end of the line.

Don't even get me started on macros! I have stuff recorded that writes most of my Java code for me. :)
2 months later
To me vi comes handy when you are logged in remotely to a server and you want to edit some configuration files or check logs without downloading them.
vi is not obsolete it depends on how you are using it.