2010-03-21

Ubuntu中安装VIM编辑器

Posted in FreeBSD/Unix服务器 at 18:15 Author:仲远

标签:

Ubuntu安装好以后,默认是安装使用nano编辑器。不过这对于用惯了vim的人可能会有些不习惯。好在Ubuntu下安装vim还是比较简单的,使用如下命令即可:

sudo apt-get install vim

系统就会自动安装好vim,以下为安装好以后的部分提示:

Setting up vim (2:7.2.245-2ubuntu2) …
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.

在安装完vim之后,还可以选择通过修改Ubuntu中默认编辑器的命令,来指定vim为默认编辑器:

sudo update-alternatives –config editor

系统可能会提示如下:

There are 4 alternatives which provide `editor’.

  Selection    Alternative
———————————————–
          1    /usr/bin/vim.tiny
          2    /bin/ed
*+        3    /bin/nano
          4    /usr/bin/vim.basic

Press enter to keep the default[*], or type selection number:

选择/usr/bin/vim.basic,即输入4,回车即可。

如果你嫌vim中的色彩还不够漂亮,可以上网查查vim的配置,或者从别的机器上拷贝一份.vimrc到本机即可。

本文可以自由转载,转载时请保留全文并注明出处:
转载自仲子说 [ http://www.wangzhongyuan.com/ ]
原文链接:

Leave a Comment

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word