Enable Vim syntax highlighting settings in SSH Secure Shell Client
The related settings on the SSH Secure Shell client are: Setting --> profile setting --> connection --> terminal, select ANSI or xterm.
====================================
When you use Vim to edit a terminal, by default, the editing interface does not display line numbers, syntax High Brightness Display, smart indentation, and other functions. To better work in Vim, You need to manually set a configuration file:. vimrc.
When Vim is started, the. vimrc file under the root directory of the current user will be automatically read. This file can contain some settings or even scripts,
Therefore, it is easier to create the. vimrc file in the root directory of the current user. The command is:
$ VI ~ /. Vimrc
After setting
$: X or $ WQ
Save and exit.
The following example shows the frequently used settings. For detailed settings, see references:
"Comments rows starting with double quotation marks, the same below
"Remove the annoying VI consistency mode and avoid bugs and limitations in earlier versions.
Set nocompatible
"Show row number
Set number
"Detection file type
Filetype on
"Records the number of historical rows
Set history = 1000
"Black is used for background
Set background = dark
"Syntax High Brightness Display
Syntax on
"The following two lines are useful in the format when writing code;
"In the first line, VIM uses automatic start, that is, to apply the format of the current row to the next line;
"The second line, based on the preceding setup format, intelligently selects the setup method.
"Writing is very useful.
Set autoindent
Set smartindent
"The Tab key of the first line is set to 4 spaces, and the second line is set to use 4 spaces when lines are staggered.
Set tabstop = 4
Set shiftwidth = 4
"Set the matching mode, similar to the right brace that will be matched when a left brace is entered.
Set showmatch
"Remove toolbar from Vim's Gui version
Set guioptions = T
"When Vim is being edited, if a command error occurs, a sound will be triggered. This setting removes the sound.
Set VB t_vb =
"The status line at the cursor position is displayed in the lower right corner during editing.
Set ruler
"By default, matching is displayed in High Brightness. This setting turns off the highlighted display.
Set nohls
"It is very convenient to query. To search for the book word, when/B is entered, the first
"A word starting with B. When it is input to/Bo, it will automatically find the word starting with the first Bo, according
"And so on, you can use this setting to quickly find the answer.
"Don't forget to press ENTER
Set incsearch
"After a file is modified, it is automatically backed up. The backup file name is added to the original file name." ~ "Suffix
If has ("VMS") // note that double quotation marks must be enclosed in half-width quotation marks ""
Set nobackup
Else
Set backup
Endif
After the annotation is removed, a complete. vimrc configuration is as follows:
Set nocompatible
Set number
Filetype on
Set history = 1000
Set background = dark
Syntax on
Set autoindent
Set smartindent
Set tabstop = 4
Set shiftwidth = 4
Set showmatch
Set guioptions-= T
Set VB t_vb =
Set ruler
Set nohls
Set incsearch
If has ("VMS ")
Set nobackup
Else
Set backup
Endif
If the function does not work after setting, check whether the vim-enhanced package is installed in the system. The query command is:
$ Rpm