Vi under FreeBSD supports Chinese display and compilation

Source: Internet
Author: User
Recently, PHP development requires the application of vi, but the PHP file must support Chinese characters. so I consulted my colleagues and found some results. Previously it was the application putty to connect to freebsd server, but it seems to be entered in Chinese with a title, so the application F-SecureSSHClient5.4, application

Recently, PHP development requires the application of vi, but the PHP file must support Chinese characters. so I consulted my colleagues and found some results.

Previously, putty was used to connect to the freebsd server, but it seems that there is a title in the Chinese language. Therefore, F-Secure SSH Client 5.4 can also be used, which is better than putty, but it is not that convenient.

To highlight the code in vi, it seems that bash is to be applied. freebsd uses csh by default, so you need to fix it:

% Chpass heiyeluren

# Changing user database information for heiyeluren.
Shell:/usr/local/bin/bash
Full Name: heiyeluren
Office Location:
Office Phone:
Home Phone:
Other information:

If your shell is csh, you can change it to Shell:/usr/local/bin/bash.

In the beginning, you will be able to see different colors. for example, you will be able to see different colors.

Then, the. bash_profile file will be displayed in your home directory, which is your configuration file. configure it as follows:

1 # PS1 = '[\ u @ \ H \ w] \ $'
2 PS1 = '[\ w] \ $'
3 alias vi = 'vim'
4 alias ll = 'ls-Al'
5 LANG = zh_CN.EUC
6 EDITOR = vim
7 TERM = linux
8 # TERM = xterm
9 export LANG EDITOR TERM
10 export CLICOLOR = 1
11 export PATH =/usr/local/bin: $ PATH
12 export CVSROOT =: pserver: heiyeluren @ cvs:/home/cvs/CVS

Pay attention to the above items: LANG = zh_CN.EUC, TERM = linux, and so on. you can fix it as above.

Finally, modify the. exrc file as follows:

1 syntax on
2 set tabstop = 4
3 set autoindent
4 set nu


You can retain the modification. However, do not close this terminal at this time. it is best to open another terminal and connect to the past. if you can log on to the terminal, you cannot log on to the terminal and immediately correct it.


Now you can highlight files and support the display and compilation of Chinese characters.

We recommend that you use the F-Secure SSH Client and set the background to a dark color.

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.