Linux applications: Vim custom commands

Source: Internet
Author: User

1. Customizing command settings

": Command option Custom command action": Define a command

": command! ... ": Redefine a Command (modify)

":d Elcommand custom Commands": Deleting custom commands

* Note 1: Custom commands must start with "uppercase" letters


2. Custom command Options-parameters

1) Description of the number of parameters

-nargs=0 No parameters
-nargs=1 a parameter
-nargs=* any number of arguments
-nargs=? No or one parameter
-nargs=+ one or more parameters

2) Use parameters (i.e., if the reference parameter is inside the operation)

<args> indicates the parameters of the command band
<q-args> parameters can be used with special characters
<f-args> converting a parameter to a format appropriate for a function call

3. Custom command options-line range

1) Default line range description

-range allowable Range: default is when forward
-range=% allowable Range: default to the entire file

2) Read the command line range (that is, the line range inside the operation)

<line1> First line line number
<line2> last line number

Linux applications: Vim custom commands

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.