Hacker News new | past | comments | ask | show | jobs | submit login

Because UNIX shell is the most powerful integrated programming environment for development with any language/technology combination. Instead of your typical menu commands (you are lucky if you have 100 or so commands to do very basic and limited things on a selection that you must build with mouse manually) you literally have tens of thousands of extremely sophisticated commands that can easily be chained together to produce amazing things with very little work.

Vim is just part of that tool chain designed to edit text efficiently. Vim is not so much a text editor as it is a language for manipulating text. Vim has dozens of motion commands to move cursor over chars, words, sentences, paragraphs, code blocks, methods, pages, regex etc. So general form of vim commands is nCm i.e. repeat n times command C to the text cursor moves over with motion command m. So for example w is a command that moves to the next word. d is a delete command. So, dw says delete word. 5dw says delete next 5 words. Let's say you are inside if (.) block and you want to change the if condition. ci( says "change inner bracket text" (i.e. everything inside brackets). This deletes everything inside () and puts you to INSERT mode and let's you type new condition.

This makes Vim extremely predictable and discoverable. You learn a new command say gU (turn to upper case) and you immediately know how to turn to upper case entire word because you know how to move by words with w. gUw turn entire word to upper case. gU) turns entire sentence to upper case, etc.

After a while these things just become part of you, and you become really fast at bending text to your will without even thinking. The fact that you can navigate text/code and get to where you want in matter of milliseconds (faster than it takes you to take the hand off the keyboard and reach for the mouse, shake the mouse to find where the cursor is etc) is amazingly liberating of disruptive context switches.

And then if you add shell integration, it means you can apply advanced filters to your text to do pretty much anything. This gets as esoteric as run filter on regex in lines that match another regex, where regex can be any Perl compatible regular expression. But can also be as simple as reformat code, beautify paragraph, insert current date, listing of directory etc. Then you add code completion, file navigation etc and you have something amazing.




> Because UNIX shell is the most powerful integrated programming environment for development with any language/technology combination.

Only if you never experimented with a Lisp / Smalltalk REPL from the old Xerox PARC environments.

EDIT: Should have mentioned the later Lisp Machines and Oberon (specially System 3) as well.


So where would you suggest going to learn all of this seemingly endless amount of information?


Don't aim to learn everything. Learn to be productive and get to the point where you do things you do fast enough. Vim itself has enormous amount of functionality, so it is useful to read vim reference manual. It comes with one and you can get one in PDF as well here:

ftp://ftp.vim.org/pub/vim/doc/book/vimbook-OPL.pdf

Also read entire exhaustive help at least once so you get the idea of what is available (it can be done in one weekend, don't try to memorize too much just familiarize yourself with content, then later when you wonder how would you do that in Vim you will remember you read something about that once).

Vim has really great indexed help that you can access directly:

:h :h index :h <topic>

and there is also grep for help to search entire help for matches

:helpgrep <search_term>

No matter what you do understand that you will get slower before you get faster. At first expect your productivity to go down seriously, because everything will be strange and new. But persist with it and force yourself to use it. Once you get to the nicer bits you probably will not want to go back. After 6 months of regular use, you will not be able to back, every other editor will feel dumb and will frustrate you to no end (be careful when typing email: ESC key dismisses the compose dialog in a lot of email programs without asking you anything :D).

As for UNIX shell and tools, again get a good BASH tutorial book and learn the basics of interactive shell, learn how to do loops, globs etc. The rest is then all about learning individual tools, not shell itself, which is rather small command interpreter. Look in your /usr/bin and /usr/local/bin for commands and read their man pages. Experiment a lot with them and look at examples of creative use of these.

Back in the early 90s I had a year long course in vi (not Vim) but started using Vim on Amiga 500 days, and after 20 years I still come across new commands and ways to do things. This is the beauty of Vim, you grow with it and it never stops to amaze you. But it is a skill that you keep for a lifetime. It's like learning to touch type, you do it once and you type efficiently for the rest of your life. You may get faster or slower at times in your life but you are always faster than hunt and peckers. Same with Vim, dumb editors come and go, but none ever approach the completeness of Vim.


It doesn't just seem endless, it is endless. You just start and at some point you realize you will never be done.


But typing speed is never an issue when programming. It's just not the bottleneck.


It's not about speed, it's all about flow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: