Live data from Hacker News

Ask HN: What's the best way to get started with Vi(m)

news.ycombinator.com

31–40 of 42 posts

Re: Ask HN: What's the best way to get started with Vi(m)

#32
In addition to all the excellent suggestions here, I will also suggest reading the free book "A Byte of Vim" (http://www.swaroopch.com/notes/Vim_en:Table_of_Contents).

This is how the book introduces itself:

"A Byte of Vim" is a book which aims to help you to learn how to use the Vim editor (version 7), even if all you know is how to use the computer keyboard.

The first part of this book is meant for new users who want to understand what Vim is and learn how to use it.

The second part of this book is for people who already know how to use Vim and want to learn about features that make Vim so powerful, such as windows and tabs, personal information management, making it a programmer's editor, how to extend Vim with your own plugins, and more.

Re: Ask HN: What's the best way to get started with Vi(m)

#33

Type this into your terminal: emacs

On a more serious note, do please feel free to give any and all helpful advice on how to get started with emacs. I'm okay with vim, I've been using it more and less for about 2 years, but emacs has always seemed more esoteric and I never did quite get the hang of it.

This got long, but hopefully there is some good knowledge in here for you.

Steve Yegge wrote some great starter posts on Emacs. He essentially inspired me to get out and learn it. He provides some good starting defaults that you should use. You can Google for these.

If you start Emacs and type C-h t, you'll get the tutorial, which is a helpful starting point. C-h in general is your friend and an entree into several kinds of help, like what keystroke bindings are currently active, what a built-in function does, what a keystroke does, etc.

The Emacs Wiki is a great place to go and just click around for a while. On the front page is a section for the Emacs Newbie. The Nifty Tricks page alone could consume several weeks of learning.

http://www.emacswiki.org http://www.emacswiki.org/emacs/EmacsNewbie http://www.emacswiki.org/emacs/EmacsNiftyTricks

What really sold me on Emacs was M-x shell. I love having a terminal with functionally infinite history, with completions for any text I enter (not just files and programs, read about Hippie expand), where I can munge the output of a shell command in place or just search through it.

M-x shell in combination with server-mode essentially replaced screen for me. server-mode allows you to run Emacs as a long-running server process that you can attach to with emacsclient. So your Emacs process might have uptime measured in months, and you just keep attaching to it from home or at work.

I like ido-mode with fuzzy matching, which functions something like an awesome bar for your editing tabs (or "buffers" in Emacs lingo).

Eventually, you may plateau in your knowledge and you might want to read the manual. It is written in small, digestible bits. You can skip around but it might help to read the first chapters first. It took me about a year to get to the point where it made sense to start eating the elephant.

http://www.gnu.org/software/emacs/manual/emacs.html

Last, you might want to investigate Emacs Lisp programming. Writing little programs in the native language of your text editor will make you drunk with power.

Happy hacking!

Re: Ask HN: What's the best way to get started with Vi(m)

#34
post #2

Type `vimtutor` on your command line and hit enter.

That's the best tip of all. Ask yourself this question: "Can I walk through all the vimtutor examples without thinking too much?" If you can't, there is probably stuff in there you should learn. Make sure you know what an operator is, and what insert mode does. Listen to vimtutor when it tells you to learn by doing, not by trying to memorize everything in the tutorial. I learned by doing vimtutor over and over again until I could complete it without referring to help. If I forgot commands, I'd start over completely at the beginning and progress as far as I could until I had to start over to review. Do this a dozen times or so and soon you'll have basic facility.

Also, use vim for everything, not just code. Use it for email, writing projects, file management, and explore what else it can do for you.

Re: Ask HN: What's the best way to get started with Vi(m)

#35

This is the cheat sheet that I used to get started: http://home.uchicago.edu/~gan/file/vim.pdf Learn the basics first: 1. Basic movement (h l k j) 2. Insertion mode (i), deletion (x), selections/visual Mode (v), copying/yank (y), pasting/put (p), and exit insertion mode (esc) Once you learn those the rest is pretty easy to pick up. I should warn you though, once you get used to the key commands it's hard to go back t…

I've always thought that the f and t motions along with I and A to switch to insert mode, and . (repeat) should be included in the basic motions and text objects should be the next step.

They're relatively simple to remember and you can string them together to accomplish a lot more than the character-wise to word-wise motion progression I've seen in most vim intros.

Re: Ask HN: What's the best way to get started with Vi(m)

#36
post #21

Earlier quoted context omitted.

Get a friend that uses it well and will be nearby (physically) for a few months. I didn't learn until I spent a summer with Slava (coffeemug) at my side willing to answer questions. Find ways to do as much as you can of what you normally do with your computer in emacs. If you use IRC a lot, use erc. If you use email a lot, try out gnus or rmail. Don't try to replace your web browser with w3m, that's just stupid and y…

Thanks for the very helpful answer, it's just what I wanted. :) I do use IRC a lot, and I'll start using erc per your suggestion. One question, is there any way to get spell-checking on it? I'm hoping the solution is as straight-forward as x-chat's (this screenshot demonstrates it fairly well: http://i42.tinypic.com/rw2ljr.jpg though, I don't require fancy multi-language spell-checking, just an English spell-checker…

As for spelling I believe enabling flyspell-mode will do the job, i.e. M-x flyspell-mode

Re: Ask HN: What's the best way to get started with Vi(m)

#37
I found that being a touch-typist helped, since the concept of vim is to have your hands on the home row using letter keys rather than arrows or mice. (I happened to learn Dvorak but I'm sure Qwerty would have a similar impact on getting the most out of vim). Plus it's a transferable and generally recommended skill for programmers.

Re: Ask HN: What's the best way to get started with Vi(m)

#38
post #21

Earlier quoted context omitted.

Get a friend that uses it well and will be nearby (physically) for a few months. I didn't learn until I spent a summer with Slava (coffeemug) at my side willing to answer questions. Find ways to do as much as you can of what you normally do with your computer in emacs. If you use IRC a lot, use erc. If you use email a lot, try out gnus or rmail. Don't try to replace your web browser with w3m, that's just stupid and y…

Thanks for the very helpful answer, it's just what I wanted. :) I do use IRC a lot, and I'll start using erc per your suggestion. One question, is there any way to get spell-checking on it? I'm hoping the solution is as straight-forward as x-chat's (this screenshot demonstrates it fairly well: http://i42.tinypic.com/rw2ljr.jpg though, I don't require fancy multi-language spell-checking, just an English spell-checker…

you'll get better results with beer ;-)
Post reply on HN