Vim

来自开放百科 - 灰狐
2010年9月24日 (五) 09:04Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索
Vim-90x90.gif
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Vim Thanks, Wikipedia.

Vim 和 GNU Emacs 作为开源世界最重要的编辑器,以其强大的功能和可定制能力被众多开发者所喜爱。Vim 和 GNU Emacs 是系统开发人员的至爱。

目录

GTK

apt-get install vim-gtk //  enhanced vi editor - with GTK2 GUI
gvim &

Debian vim stable version: 6.3.82

#apt-get install vim-full // vim-full - Vi IMproved - full fledged version of the enhanced vi editor
#apt-get install vim-gtk // GTK2 Version, 将 remove vim-python , 安装 vim-python 将 remove vim-gtk
gvim 
#apt-get install vim-gnome // GNOME2 Version , 将 remove vim-gtk, 安装 vim-python 将 remove vim-gnome

Version 7.0

wget ftp://ftp.vim.org/pub/vim/unix/vim-7.0.tar.bz2
bunzip2 vim-7.0.tar.bz2
tar xvf vim-7.0.tar
cd vim70
./configure --with-tlib 
checking for linking with yes library... configure: error: FAILED 

常用命令

:set nu! // 显示行号
:set cin! // c语言自动缩进
直接输入G,就是到文件末尾了

disable VIM swap and backup

在 .vimrc 文件中加入

set nobackup
set nowritebackup
set noswapfile

注意:Add these lines to the bottom ,要加到文件末尾

UTF-8

在 .vimrc 或 vimrc 文件中加入, /etc/vim/vimrc or /etc/vim/gvimrc

set encoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
set ambiwidth=double

Vim Scripts

C/C++

Python

#apt-get install vim-python // vim-python - Vi IMproved, with python scripting support

python.vim : A set of menus/shortcuts to work with Python files

http://vim.sourceforge.net/scripts/script.php?script_id=30

将 python.vim 放在 C:\Program Files\Vim\vim70\plugin ,即在下次启动 vim 后,在菜单上就会显示Python菜单条目。

Perl

#apt-get install vim-perl // vim-perl - Vi IMproved, with perl scripting support

PHP

Ruby

#apt-get install vim-ruby // vim-ruby - Vi IMproved, with ruby scripting support

Tcl

#apt-get install vim-tcl // vim-tcl - Vi IMproved, with tcl scripting support

Docs

Links

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱