Vim安装与配置..docxVIP

  • 7
  • 0
  • 约3.17千字
  • 约 6页
  • 2017-01-27 发布于重庆
  • 举报
Vim安装与配置.

Vim安装vim比vi的功能强大,但ubuntu里面只有vi和vim.tiny,所以要自己安装。在命令行输入vi再按tab,可以看到:键入命令:sudo apt-get install vim-gtk,然后输入y,就可以自己下载安装vim了。Tip:前提是保证虚拟机能连接到网络,否则会出现E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?的错误 A、共享主机无线网络的方法:1、在主机上运行cmd,输入命令services.msc,找到VMvare Nat Service和 VMvare DHCP Service右击开启。2、右击虚拟机右下部的netwoark adapters点击settings,出现如下窗口,选择NAT:使其共享主机IP(注意:每一次需要网络连接的时候都要手动打开上述两个服务器。)连接到网络后重复步骤二,完成后键入命令vim,显示如下则vim安装成功。安装好vim,就可以开始配置了,使用命令sudo apt-get install vim-script vim-doc,下载文档和插件。下载过程中如果还出现如下错误,解决办法:清除catche里的缓存使用命令 sudo rm /var/catche/apt/archieves/partial/*,在使用命令sudo apt-get clean在/home/usr(你的用户名,我的是hagog)下,使用命令gedit .vimrc,在新建的文件下输入配置信息,那你的vim就有高亮,缩进,显示行号的功能 This line should not be removed as it ensures that various options are properly?set?to?work with the Vim-related packages available?in?Debian.?debian.vim Uncomment the next line to make Vim more Vi-compatible NOTE:?debian.vim sets?nocompatible.?Setting?compatible?changes numerous options, so any other options should be set AFTER setting compatible.set nocompatible Vim5?and?later versions support syntax highlighting.?Uncommenting the following enables syntax highlighting by default.if has(syntax)?syntax on???????????? 语法高亮endifcolorscheme ron? elflord ron peachpuff default 设置配色方案,vim自带的配色方案保存在/usr/share/vim/vim72/colors目录下 detect file typefiletype?onfiletype plugin?on If using a dark background within the editing area and syntax highlighting turn?on?this?option?as wellset?background=dark Uncomment the following to have Vim jump to the last position when reopening a fileif?has(autocmd)?au BufReadPost?*?if?line(\) 1 line(\)?=?line($)?|?exe?normal! g\ | endif?have Vim load indentation rules?and?plugins according?to?the detected filetype?filetype plugin indent?onendif The following are commented out as they cause vim to behave a lot differently from regular Vi.?They are highly recommended though.set ignorecase??搜索模式里忽略大小写set smartcase??如果搜索模式包含大写字符,不使用?ignorecase?选项。只有在输入搜索模式并且打

文档评论(0)

1亿VIP精品文档

相关文档