Vim advanced editing (1)

Source: Internet
Author: User
Vim advanced editing (1) This article is based on "using vi editor, Lamb & amp; Robbins compilation". the content of this article is summary: set settings. vimrc configures vim to execute linux commands and use linux commands to edit the abbreviation of the current file phrase. This article stipulates that the $ + command indicates the life of the common bash... vim advanced editing (1) This article is based on "using vi editor, Lamb & Robbins compilation". the content of this article is summary: set settings. vimrc configures vim to execute linux commands and use linux commands to edit the abbreviation of the current file phrase. This article stipulates that the $ + command is displayed under the normal bash command line: + The Command indicates that in vim's ex (command) mode, press "Ctrl" + ":" to enter the sorted set command, there are two types of options: Items can be modified using the: set command: trigger options that are not on or off, and options with numbers or string values (such as the margin position and file name). Generally, the trigger option command is: the command for setting cmd to disable the option is: set nocmd the command above indicates a command option such as: set ic ignores case when searching (ic = ignore case ): set noic is case-insensitive during search. you can use the: set all command to view all options. you can see the value you set or the default value: set option? View the current setting value of option: set is displayed in. the vimrc file or the options modified or set during the current session. the vimrc file is in Linux ,. you can modify this file if vimrc is in the user's home directory (not in the initial state, you need to create one yourself. You can write the set, AB, and map commands to this file. when you enable vim editing, the configuration in this file will be used to replace the environment except to read. in addition to the vimrc configuration file, vim can also read. vimrc file, which can be used to set the options for special projects. Note: You can set some options in. vimrc in the home directory, and then cancel these settings in the local directory. When editing a linux command in vim, you can display or read the execution results of any Linux command. Use an exclamation point (!) You can create a shell in vim and regard the content following it as a Linux command ::! Command example ,:! Date: The Command above the current time can only be executed once, and then return to the vim editing environment. if you want to execute multiple commands without returning to the vim editing environment, you can use the command ,: sh is actually a new shell, which can be operated like a normal command line. If you want to exit the shell and return to vim editing, press Ctrl + D and use the read (r) Command to read the Linux command execution result to the current edited File: r! Date will read the current time into the editing file and use the command to filter the text and use the exclamation point to execute the linux command, so that vim can edit it using the functions provided by the linux command. For example, the file content: 4523 to sort these rows from small to large, you can use the system's sort command: 1, 4! Sort will be very useful for the abbreviations of the four sort phrases. we often repeatedly enter phrases of the same length in the file, whether in insert mode or command mode, vim and ex have many different methods for saving long command sequences: AB hw hello world! This command indicates that hw is hello world! In insert or command mode, if you enter hw as a complete word (not part of other words), it will be automatically expanded to hello world! To cancel this abbreviation, enter "unab hw" to list all current abbreviations: AB.
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.