Java Tutorial - Java Script :
The Attack of the Vi Clones: Vim
Vi is the “visual editor” that has been around on Unix and Unix-like operating systems (such as Linux) for decades. As a result, many people are familiar with it. As people moved to other operating systems, there was a desire to bring the familiar Vi editor with them. This need spawned a large number of Vi clones. If you are running Linux or almost any other Unix variant, you already have at least one Vi clone. There are several clones available for Windows as well. Of these, my personal favorite is Vim (which stands for Vi improved) and its graphical user interface sibling, Gvim. From here on, when we reference Vim we are referring to both Vim and Gvim.
Vim is supported well in all Windows and Linux environments with both command-line and graphical user interface (GUI) versions. In a GUI environment, Vim can be configured so that the user can use the mouse to highlight text and perform familiar cut-and-paste operations. Indeed, in a GUI environment, Vim can work almost just like any other standard GUI editor without the need to learn most of the Vi commands. Color syntax highlighting is supported for Java as well as XML, HTML, and many other languages. Vim can be configured to format source code and compile code automatically. Vim also has a simple programmable macro capability that is surprisingly powerful.
The following table gives you a summary of Vim.
Vim has some nice features for Windows users, including a standard Windows installation utility and the ability to edit a file by right-clicking the file in Windows Explorer and choosing Edit with Vim from the context menu. To install Vim under Windows, first download the file gvim61.exe from http://www.vim.org or one of its mirror sites. Run the program and select the typical options when prompted. When the installation is complete, there should be three icons on the desktop and a Vim 6.1 item under the programs folder on the Start menu. Figure 4.1 shows Gvim running on Windows.Windows allows associations to be created between files and programs. To associate Java files with Vim on Windows 9x/Me platforms, navigate to a Java file in Windows Explorer, right-click on the Java file, and choose Open with...from the context menu. On Windows 9x/Me, you will be presented with a dialog box that allows you to select of a program to use to open the file. If Gvim does not appear, then click the Other... button to navigate to the Gvim executable. On Windows NT/2000/XP, you will be given a short list of programs and an option to choose a program. Selecting Gvim will associate Vim with your Java source code files, allowing the editor to be opened automatically when you click on a Java file.Figure 4.1 Gvim running under Windows. Even if you do not enable the file association, Vim provides a quick edit feature associated with the right mouse button. When you right-click the mouse over a file in Windows Explorer, there will be an option to edit it with Vim.Selecting this option immediately opens the file inside of Vim for editing.To create a new file choose File ➪New from the menu
or enter the characters::enew
