最近开发PHP需要使用vi,但是php文件中需要支持中文,于是请教同事,有了结果。
以前是使用putty连接到freebsd服务器上,但是好像输入中文有问题,所以使用F-Secure SSH Client 5.4,使用 SSH Client也可以,比putty强点,不过没有那么方便。
要使vi中的代码加亮等,好像要使用bash,freebsd默认是csh,所以要修改一下:
% chpass heiyeluren
#Changing user database information for heiyeluren.
Shell: /usr/local/bin/bash
Full Name: heiyeluren
Office Location:
Office Phone:
Home Phone:
Other information:
如果你的shell是csh,那么你就修改成Shell: /usr/local/bin/bash
那么初步你就有加亮功能了,比如你ls一下的话,就能看见不同颜色了
然后你的主目录下就会出现 .bash_profile 文件,就是你的配置文件,你配置成下面这样:
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
注意上面几项内容:LANG=zh_CN.EUC,TERM=linux之类的,你修改一下跟上面类似。
最后再修改 .exrc 文件成下面的样子:
1 syntax on
2 set tabstop=4
3 set autoindent
4 set nu
保存修改就可以了。不过这时候不要关闭本终端,最好另外开一个终端,然后连接过去,如果能登陆最好,不能登陆马上修改回去,呵呵。
现在就能够高亮显示文件,并且能够支持显示和编辑中文了,比较爽了吧。
推荐使用F-Secure SSH Client ,并且把背景设为黑色就OK了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
