Basic use of Windows Gvim (Vi/vim)

Source: Internet
Author: User

Vim is a very powerful editor on a Linux platform, and he is an enhanced version of the VI editor of the early years. This gvim is a Windows version and has a standard Windows-style graphical interface, so it's called G (graphical) Vim. We can interpret Gvim as a graphical version of Vim (vi's enhanced version), whose instructions and usage are identical, so you can refer to Vim's instructions. This is an international version, will automatically select the appropriate language pack according to the installed platform, support Chinese and its various codes, even the interface is Chinese, please feel free to use. This editor with UNIX features and style (the best of the best) believes it will give you a different feeling.

"Historical Review"

Vim is a multi-platform text editor developed from VI. Code completion, compilation and error jumps and other convenient programming features are particularly rich, widely used in programmers, and Emacs parallel to become UNIX-like system users favorite editor. Some people have joked that there are only three programmers in the world, one that uses Emacs, one that uses VI, and one that uses other editors.

Creator Bram Moolenaar when he bought his Amiga computer in the late 80, since the Amiga did not have his most commonly used editor Vi,bram began with an open source VI replication Stevie, the 1.0 version of Vim was developed. The original goal was to completely replicate the function of VI, when VIM was the abbreviation for VI imitation (analog). The 1992 1.22 version of Vim was ported to UNIX and MS-DOS. Since then, the full name of Vim has become VI improved (improved) as the function continues to increase. It is now a charitable software release in open source mode.

"Feature Summary"

    1. Can be fully compatible with the original VI according to the setting
    2. Multi-buffered editing
    3. Any number of split windows (horizontal, vertical)
    4. scripting language with list and dictionary capabilities
    5. You can call Perl,ruby,python,tcl,mzscheme in the script
    6. Word abbreviation function
    7. Dynamic Word Completion
    8. Multiple undo and Redo
    9. Syntax highlighting for more than 400 types of text files
    10. Automatic indentation of more than 40 languages such as C/c++,perl,java,ruby,python
    11. Use the Ctags tab to jump
    12. File recovery after crash
    13. Save restore of cursor position and open buffering State (Session function)
    14. Diff mode for two files with differential, synchronous function
    15. Remote file editing
    16. Omni Complement (context-dependent completion)

"Working mode"

The vim derived from VI has a variety of modes, and this unique design makes it easy to confuse beginners. Almost all editors have two modes of inserting and executing commands, and most editors use a different approach to vim: a command menu (mouse or keyboard driver), a combination of keys (usually with the control key (CTRL) and Alt (ALT)), or mouse input. Vim and VI, just as the keyboard to switch among these modes. This allows vim to operate without a menu or mouse, and to minimize the operation of key combinations. It can greatly enhance the speed and efficiency of the text entry clerk or programmer.

VIM has 6 basic modes and 5 derivation modes:

{Basic Mode}

Normal mode

In normal mode, users can perform general editor commands, such as moving the cursor, deleting text, and so on. This is also the default mode after Vim is started. This is exactly the opposite of what many new users expect (most editor default mode is insert mode).

A large part of Vim's powerful editing capabilities comes from its normal mode commands. Normal mode commands often require an operator end. For example, the normal mode command "DD" deletes the current row, but the first "D" can be followed by another move command instead of the second "D", such as the "J" Key moved to the next line to delete the current row and the next row. You can also specify the number of commands to repeat, "2DD" (repeat "DD" two times), and "DJ" effect is the same. Users learn a variety of text between the move/jump commands and other common mode of editing commands, and can be used flexibly combined, can be more efficient than those without the pattern of the editor for text editing.

In normal mode, there are many ways to get into insert mode. The more common way is to press "a" (append/append) key or "I" (insert/insert) key.

Insert mode

In this mode, most keystrokes insert text into the text buffer. Most new users want this mode to persist throughout the text editor editing process.

In insert mode, you can press the ESC key back to normal mode.

Visual mode

This pattern is similar to normal mode. However, the move command expands the highlighted text area. The highlighted area can be a character, a line, or a piece of text. When a non-moving command is executed, the command is executed to the highlighted area. Vim's "text object" can also be used in this mode as the move command.

Selection mode

This pattern is similar to the behavior of the modeless editor (the way Windows standard text controls are). In this mode, you can use the mouse or cursor keys to highlight the selection of text, but the input of any character, Vim will use this character to replace the selected highlighted text block, and automatically enter the insertion mode.

Command-line mode

In command-line mode, you can enter text that will be interpreted and executed. For example Execute command (":" Key), Search ("/" and "?" Key) or the filter command ("!" Key). After the command is executed, VIM returns to the pattern before the command-line mode, usually in normal mode.

Ex Mode

This is similar to command-line mode, where you can execute multiple commands at one time before using the ": visual" command to leave the ex mode.

{Derived mode}

Operator wait mode

This derivation pattern refers to normal mode, in which Vim waits for an "action" to complete this command after executing an action command. Vim also supports the use of "text object" as an action in the operator wait mode, including "AW" a word (word), "as" a sentence (a sentence), "AP" a paragraph (a paragraph), and so on.

For example, in normal mode "D2as" deletes the current and next sentence. In visual mode, "ApU" capitalizes all the letters in the current paragraph.

Insert Normal Mode

This mode is entered when the Ctrl-o key is pressed in insert mode. This time temporarily into normal mode, after executing a command, VIM returns to insert mode

Inserting visual mode

This mode starts when you press the Ctrl-o key in insert mode and start a visual selection. When you select Cancel in the viewable area, VIM returns to insert mode.

Insert Selection Mode

This mode is usually accessed by dragging the mouse or by the shift arrow key in insert mode. When the selection area is canceled, VIM returns to insert mode.

Replacement mode

This is a special insert mode in which the same operation can be done in the same mode as the insert mode, but each input character overrides the existing character in the text buffer. Press "R" key in normal mode to enter.

Other

Evim

Evim is a special GUI mode used to perform as much as possible with the "modeless" editor. The editor automatically enters and stays in insert mode, and the user can only manipulate the text with the menu, mouse, and keyboard control keys. You can enter "Evim" or "vim-y" at the command line. Under Windows, you can usually also click the Evim icon on your desktop.

"Related articles"

GVim using tutorials [download. doc version GVim tutorial/vi/vim Tutorial]

GVim command list diagram (image)

GVim graphical Keyboard instructions

GVim command Format explanation tree structure diagram

Prompted

For most users, VIM has a steep learning curve. This means that it may be slow to start learning, but once you have mastered some basic operations, you can significantly improve your editing efficiency. To help with learning, Vim prepares the vim teaching for beginners. You can usually enter "Vimtutor" under the UNIX system command line or click the Vim instruction icon on the Windows system desktop. The basic and advanced features of Vim are described in more detail in the VIM user manual. You can enter ": Help User-manual" into the user manual in Vim. In addition to the original English version, the Handbook has also been translated into various languages by volunteers, including Chinese.

New users should also learn about Vim's help system. You can enter "Help" without parameters in vim to read the main helper file.

Official download: http://www.vim.org/download.php [DOWNLOAD]

Article source http://gnrsu.cn/archives/11681

Basic use of Windows Gvim (Vi/vim)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.