FreeBSD under the VI support Chinese display and editing

Source: Internet
Author: User
Tags modify php file ssh client linux

Recently developed PHP need to use VI, but the PHP file needs to support Chinese, so consult colleagues, with the results.

It used to be connected to the FreeBSD server using putty, but it seems to be problematic to enter Chinese, so using f-secure SSH client 5.4, SSH client can also be more than putty, but not so convenient.

To make the code in VI highlight, as if to use Bash,freebsd default is CSH, so to modify:

% 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, then you modify it into a shell:/usr/local/bin/bash

Then you will have the initial highlight function, such as you LS, you can see the different colors

Then your home directory will appear with the. bash_profile file, which is your configuration file, which you configure 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
Ten Export Clicolor=1
Export Path=/usr/local/bin: $PATH
Export cvsroot=:p Server:heiyeluren@cvs:/home/cvs/cvs

Note the above: LANG=ZH_CN. Euc,term=linux and the like, you change it like above.

Finally, modify the. exrc file as follows:

1 syntax on
2 Set Tabstop=4
3 Set Autoindent
4 Set Nu


Save the changes on it. But this time do not close this terminal, it is best to open a terminal, and then connect the past, if the best landing can not be landed immediately modify back, hehe.


Now you can highlight the file, and can support the display and editing of Chinese, it is more fun.

It is recommended to use the F-secure SSH Client and set the background to Black to OK.



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.