Linux how to use vim for advanced editing

  

vim is a text editor, can be used in Linux systems, for the use of Linux commands can refer to the system home Linux how to use vi /vim command, today Xiaobian to everyone Introduced the way Linux uses vim for advanced editing.

In this article Summary:

set provided

.vimrc configuration
linux execute command

using a linux command

vim To edit the current file

Phrase abbreviation

This document convention:

$ + command is indicated under the normal bash command line

: + command is indicated in Vim's ex (command) mode, press “Ctrl” + “:” Enter

set command

There are two types of options that can be modified using the :set command: not open Is the trigger option and the option with numeric or string values ​​(such as the position and file name of the margin)

The command to trigger the option is: set cmd

Command to close the option To: set nocmd

The above cmd represents a certain command option

For example,

:set ic ignores case when searching (ic=ignore case)

:set noic does not ignore case when searching

You can use the :set all command to view all the options, you can see you The default value is set, or the value of

: set option? View the current setting value of the option option

:set Display options that have been modified or set during the .vimrc file or during the current session

.vimrc file

In Linux, .vimrc can be modified in the user's home directory (not at the beginning, you have to create one yourself).

You can write the set, ab and map commands to this file, then open the vim editor and use the configuration in this file

to replace the environment

in addition to reading the home In addition to the .vimrc configuration file in the directory, you can also have vim read the .vimrc file in the current directory, which allows you to set options for special projects.

Note that you can set some options in .vimrc in your home directory and then undo these settings in your local directory.
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved