A Byte of Vim

Categories:

Recommended

Vim en:Introduction

What is Vim?

Vim is a computer program used for writing any kind of text, whether it is your shopping list, a book, or software code. What makes Vim special is that it is one of those few software which is both simple and powerful. Simple means it is easy to get started with. Simple means that it has a minimalistic interface that helps you to concentrate on your main task – writing. Simple means it is built around few core concepts that helps you learn deeper functionality easily. Powerful means getting things done faster, better and easier. Powerful means making not-so-simple things possible. Powerful does not mean it has to be complicated. Powerful means following the paradigm of “Minimal effort. Maximal effect.”

What can Vim do?

I can hear you say, “So it’s a text editor. What’s the big deal anyway?” Well, a lot. Let’s see some random examples to compare Vim with your current choice of editor. The point of this exercise is for you to answer the question “How would I do this in the editor I currently use?” for each example.

( Example of Edit & Vim, please read page. 8-9)

In these examples, you can see the power of Vim in action. Any other editor would make it insanely hard to achieve the same level of functionality. And yet, amazingly, all this power is made as understandable as possible. Notice that we didn’t use the mouse even once during these examples! This is a good thing. Count how many times you shift your hand between the keyboard and the mouse in a single day, and you’ll realize why it is good to avoid it when possible. Don’t be overwhelmed by the features here. The best part of Vim is that you don’t need to know all of these features to be productive with it, you just need to know a few basic concepts. After learning those basic concepts, all the other features can be easily learned when you need them.

Vim en:Installation

Let’s see how to get Vim installed on your computer.

Windows

If you use Microsoft Windows, then the following steps will help you get the latest version of Vim 7 installed on your computer: 1. Visit http:/ / www. vim. org/ download. php#pc 2. Download the “Self-installing executable” (gvim72.exe[ 1 ] as of this writing) 3. Double-click the file and install Vim like any other Windows-based software.

Mac OS X

If you use Mac OS X, then you already have the terminal version of Vim installed. Run the menu command Finder → Applications → Utilities → Terminal. In the terminal, run the command v i m and press enter, you should now see the Vim welcome screen. If you want to use a graphical version of Vim, download the latest version of the Cocoa-based MacVim project [2]. Double-click the file (such as MacVim-7_2-stable-1_2.tbz ), it will be unarchived and a directory called MacVim-7_2-stable-1_2 will be created. Open the directory, and copy the M a c V i m app to your A p p l i c a t i o n s directory. For more details MacVim diffrences, including how to run MacVim from the terminal see the macvim refrence: 1. Click on Finder → Applications → MacVim. 2. Type : h e l p m a c v i m and press the Enter key.

Linux/ BSD

If you are using a Linux or *BSD system, then you will have at least a minimal console version of Vim already installed. Open a terminal program such as konsole gnome-terminal, run v i m and you should see the Vim welcome screen. If you get a message like vim: command not found , then Vim is not installed. You will have to use your system-specific tools to install Vim, such as aptitude in Ubuntu/Debian Linux, yum in Fedora Linux, pkg_addorport in FreeBSD, etc. Please consult your specific system’s documentation and forums on how to install new packages. If you want the graphical version, install the vim-gnome package or alternatively, the gvim package.

Summary

Depending on how it is installed, you can run the vim command in the shell or use your operating system’s menus to open a graphical version of the Vim application. Now that we have Vim installed on your computer, let us proceed to use it in the next chapter.

Category:

Attribution

Swaroopch, A Byte of Vim v0.51 (for Vim version 7), URL: https://vim.swaroopch.com/byte-of-vim.pdf

This work is licensed under Creative Commons Attribution-Share Alike 3.0 Unported license:  (https://creativecommons.org/licenses/by-sa/3.0/).

VP Flipbook Maker

Displaying your work as a digital flipbook allows your readers to read your work anytime, anywhere, from a device with an Internet connection. Try creating your work with VP Online Flipbook Maker now!