Monday, 16. April 2007, 05:25:42
vim
linux下vim想要解决编码问题,我相要在vim的配置文件中加入下面几句话:
set fileencoding=gb2312
set fileencodings=utf-8, gbk, utf-16, gb2312, big5
set ambiwidth=double
Thursday, 7. December 2006, 09:43:09
linux, vim
打开/etc/profile
添加一行:alias ls=’ls –color=auto’ ,重新登陆,ok了
当然如果再加上一条:alias ll='ls -lh --color=tty',就多了一条更好用的ll命令。
以上改动可心在~/.bashrc里面进行,这样就只影响当前的用户了
顺便把vi的也加上,这样在vi中编写html、cpp就好看多了:
打开/etc/vim/vimrc
找到:’syntax on ,把前面的注视号去掉,保存,重新开启vi,ok
Thursday, 28. September 2006, 07:55:10
vim
在$home/.vimrc(_vimrc)或在vim安装目录的_vimrc(.vimrc)文件中加入以下内容
" multi-encoding setting
if has("multi_byte")
"set bomb
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,sjis,euc-kr,ucs-2le,latin1
" CJK environment detection and corresponding setting
if v:lang =~ "^zh_CN"
" Use cp936 to support GBK, euc-cn == gb2312
set encoding=cp936
set termencoding=cp936
set fileencoding=cp936
elseif v:lang =~ "^zh_TW"
" cp950, big5 or euc-tw
" Are they equal to each other?
set encoding=big5
set termencoding=big5
set fileencoding=big5
elseif v:lang =~ "^ko"
" Copied from someone's dotfile, untested
set encoding=euc-kr
set termencoding=euc-kr
set fileencoding=euc-kr
elseif v:lang =~ "^ja_JP"
" Copied from someone's dotfile, untested
set encoding=euc-jp
set termencoding=euc-jp
set fileencoding=euc-jp
endif
" Detect UTF-8 locale, and replace CJK setting if needed
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
endif
"关掉备份文件
set nobackup
"暂时没用,留着吧
hi CursorLine guibg=LightBlue
"高亮当前行
set cursorline
"设置颜色方案
colorscheme torte
"显示行号
set number
Thursday, 6. April 2006, 13:04:37
vim
打开文件后,不用任何鼠标、菜单,只须在键盘上按下“ggguG”就行了。极品软件就是这样:唯有功能强到极致,操作才能简到极致!
解释一下:ggguG分作三段gg gu G
gg=光标到文件第一个字符
gu=把选定范围全部小写
G=到文件结束