[ZLG-ARM] ubuntu安装及配置

[复制链接]
2028|1
 楼主| acertm 发表于 2009-5-14 13:02 | 显示全部楼层 |阅读模式
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这是我在大学的第二个学期了,这时,我第一次接触到了linux,了解了关于她的相关知识并亲身学习和体验了linux的乐趣所在。确切的说,我是在同学的推荐下接触和使用linux的,以我现在的心情来说,我很庆幸我与linux接下了不解的缘分,因为我从linux中找到了我的由一个兴趣爱好,更重要的是我从linux中领悟到了开源的精神,并从linux中体验到了操作系统以及其它开源软件的魅力。<br />&nbsp;&nbsp;&nbsp;我还是来说说我用ubuntu的确切过程吧:<br />&nbsp;&nbsp;&nbsp;1,知道了linux的存在<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我与linux真是相见很晚,当同学第一次向我介绍linux时,我完全是不知所云,但是我深深的被披着神秘面纱的linux所吸引,于是我带着好奇和期待的心开始搜集关于linux的各方面的知识,比如命令、系统文件、系统特色等等,当然都只是一个大概的了解而没有去深钻。<br />&nbsp;&nbsp;&nbsp;2,安装ubuntu8.04和ubuntu8.10<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当我从图书馆的书本上和互联网上了解了linux&nbsp;的相关知识后,我就迫不及待的想亲身体验一下它的魅力,于是我开始了比较漫长的安装之旅。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一开始的时候,安装的是ubuntu8.04,安装到是挺容易的,但是在配置之后就不能进入图形界面了,出于此我重复的安装了一次又一次,然而每次都以失败而告终。最后,没有办法,我只得试着找找其它的解决方案,我用了一个最简单的方案,即自己从网上下载了ubuntu8.10的镜像文件并刻录成光盘,然后再次安装,幸运的是这次终于成功了。(我是双系统的,即windows&nbsp;vista&nbsp;和ubuntu8.10)<br />&nbsp;&nbsp;&nbsp;3,更新ubuntu8.10的软件源<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a,启用root(最高权限)帐户(必须的)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;终端输入:#sudo&nbsp;passwd&nbsp;root<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;输入你希望的root用户的密码<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b,更新ubuntu8.10软件源<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;备份一下源列表<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo&nbsp;cp&nbsp;/etc/apt/sources.list&nbsp;/etc/apt/sources.list_backup<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用编辑器打开(将里面的内容更换为后面列表中的内容)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo&nbsp;gedit&nbsp;/etc/apt/sources.list<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;刷新(刷新这一步不能少)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo&nbsp;apt-get&nbsp;update<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;下面是一些源列表,你可以自己选择:<br />厦门大学更新服务器(教育网服务器):&nbsp;<br />deb&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-backports&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;ftp://ubuntu.realss.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br /><br />成都市&nbsp;电子科技大学更新服务器(教育网,推荐校园网和网通用户使用):&nbsp;<br />deb&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.uestc.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br /><br />==&nbsp;如果无法解析uestc.edu.cn域名,请使用以下地址&nbsp;==<br /><br />deb&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.dormforce.net/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br /><br />上海市上海交通大学更新服务器(教育网,推荐校园网和网通用户使用):&nbsp;<br />deb&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ftp.sjtu.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br /><br />中国科学技术大学更新服务器(教育网,推荐校园网和网通用户使用):&nbsp;<br />deb&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://debian.ustc.edu.cn/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br /><br />中国台湾&nbsp;台湾大学更新服务器(推荐网通用户使用,电信PING平均响应速度41MS。强烈推荐此源,比较完整,较少出现同步问题):&nbsp;<br />deb&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://ubuntu.csie.ntu.edu.tw/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br /><br />mirror.rootguide.org更新服务器(上海市&nbsp;电信):&nbsp;<br />deb&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;multiverse&nbsp;restricted&nbsp;universe<br />deb-src&nbsp;http://mirror.rootguide.org/ubuntu/&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br /><br />台湾的官方源速度也相当不错,有时甚至快于内地的:&nbsp;<br />deb&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-security&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-updates&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-backports&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />deb-src&nbsp;http://tw.archive.ubuntu.com/ubuntu&nbsp;intrepid-proposed&nbsp;main&nbsp;restricted&nbsp;universe&nbsp;multiverse<br />&nbsp;&nbsp;&nbsp;&nbsp;4,更改vim编辑器的配置文件(我是为了编程序方便)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第一步,更新VIM至full版。原因是ubuntu默认安装的VIM是tiny版的,不支持很多配置选项<br /><br />sudo&nbsp;apt-get&nbsp;install&nbsp;vim-full<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第二步,在当前用户的主目录下新建文件.vimrc,内容如下:<br /><br /><br />&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;一般设定<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;设定默认解码<br />set&nbsp;fenc=utf-8<br />set&nbsp;fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936<br /><br />&quot;&nbsp;不要使用vi的键盘模式,而是vim自己的<br />set&nbsp;nocompatible<br /><br />&quot;&nbsp;history文件中需要记录的行数<br />set&nbsp;history=100<br /><br />&quot;&nbsp;在处理未保存或只读文件的时候,弹出确认<br />set&nbsp;confirm<br /><br />&quot;&nbsp;与windows共享剪贴板<br />set&nbsp;clipboard+=unnamed<br /><br />&quot;&nbsp;侦测文件类型<br />filetype&nbsp;on<br /><br />&quot;&nbsp;载入文件类型插件<br />filetype&nbsp;plugin&nbsp;on<br /><br />&quot;&nbsp;为特定文件类型载入相关缩进文件<br />filetype&nbsp;indent&nbsp;on<br /><br />&quot;&nbsp;保存全局变量<br />set&nbsp;viminfo+=!<br /><br />&quot;&nbsp;带有如下符号的单词不要被换行分割<br />set&nbsp;iskeyword+=_,$,@,%,#,-<br /><br />&quot;&nbsp;语法高亮<br />syntax&nbsp;on<br /><br />&quot;&nbsp;高亮字符,让其不受100列限制<br />:highlight&nbsp;OverLength&nbsp;ctermbg=red&nbsp;ctermfg=white&nbsp;guibg=red&nbsp;guifg=white<br />:match&nbsp;OverLength&nbsp;'\%101v.*'<br /><br />&quot;&nbsp;状态行颜色<br />highlight&nbsp;StatusLine&nbsp;guifg=SlateBlue&nbsp;guibg=Yellow<br />highlight&nbsp;StatusLineNC&nbsp;guifg=Gray&nbsp;guibg=White<br /><br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;文件设置<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;不要备份文件(根据自己需要取舍)<br />set&nbsp;nobackup<br /><br />&quot;&nbsp;不要生成swap文件,当buffer被丢弃的时候隐藏它<br />setlocal&nbsp;noswapfile<br />set&nbsp;bufhidden=hide<br /><br />&quot;&nbsp;字符间插入的像素行数目<br />set&nbsp;linespace=0<br /><br />&quot;&nbsp;增强模式中的命令行自动完成操作<br />set&nbsp;wildmenu<br /><br />&quot;&nbsp;在状态行上显示光标所在位置的行号和列号<br />set&nbsp;ruler<br />set&nbsp;rulerformat=%20(%2*%&lt%f%=\&nbsp;%m%r\&nbsp;%3l\&nbsp;%c\&nbsp;%p%%%)<br /><br />&quot;&nbsp;命令行(在状态行下)的高度,默认为1,这里是2<br />set&nbsp;cmdheight=2<br /><br />&quot;&nbsp;使回格键(backspace)正常处理indent,&nbsp;eol,&nbsp;start等<br />set&nbsp;backspace=2<br /><br />&quot;&nbsp;允许backspace和光标键跨越行边界<br />set&nbsp;whichwrap+=&lt,&gt,h,l<br /><br />&quot;&nbsp;可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)<br />set&nbsp;mouse=a<br />set&nbsp;selection=exclusive<br />set&nbsp;selectmode=mouse,key<br /><br />&quot;&nbsp;启动的时候不显示那个援助索马里儿童的提示<br />set&nbsp;shortmess=atI<br /><br />&quot;&nbsp;通过使用:&nbsp;commands命令,告诉我们文件的哪一行被改变过<br />set&nbsp;report=0<br /><br />&quot;&nbsp;不让vim发出讨厌的滴滴声<br />set&nbsp;noerrorbells<br /><br />&quot;&nbsp;在被分割的窗口间显示空白,便于阅读<br />set&nbsp;fillchars=vert:\&nbsp;,stl:\&nbsp;,stlnc:\<br /><br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;搜索和匹配<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;高亮显示匹配的括号<br />set&nbsp;showmatch<br /><br />&quot;&nbsp;匹配括号高亮的时间(单位是十分之一秒)<br />set&nbsp;matchtime=5<br /><br />&quot;&nbsp;在搜索的时候忽略大小写<br />set&nbsp;ignorecase<br /><br />&quot;&nbsp;不要高亮被搜索的句子(phrases)<br />set&nbsp;nohlsearch<br /><br />&quot;&nbsp;在搜索时,输入的词句的逐字符高亮(类似firefox的搜索)<br />set&nbsp;incsearch<br /><br />&quot;&nbsp;输入:set&nbsp;list命令是应该显示些啥?<br />set&nbsp;listchars=tab:\|\&nbsp;,trail:.,extends:&gt,precedes:&lt,eol:$<br /><br />&quot;&nbsp;光标移动到buffer的顶部和底部时保持3行距离<br />set&nbsp;scrolloff=3<br /><br />&quot;&nbsp;不要闪烁<br />set&nbsp;novisualbell<br /><br />&quot;&nbsp;我的状态行显示的内容(包括文件类型和解码)<br />set&nbsp;statusline=%F%m%r%h%w\[POS=%l,%v][%p%%]\%{strftime(\&quot;%d/%m/%y\&nbsp;-\&nbsp;%H:%M\&quot;)}<br /><br />&quot;&nbsp;总是显示状态行<br />set&nbsp;laststatus=2<br /><br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;文本格式和排版<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;自动格式化<br />set&nbsp;formatoptions=tcrqn<br /><br />&quot;&nbsp;继承前一行的缩进方式,特别适用于多行注释<br />set&nbsp;autoindent<br /><br />&quot;&nbsp;为C程序提供自动缩进<br />set&nbsp;smartindent<br /><br />&quot;&nbsp;使用C样式的缩进<br />set&nbsp;cindent<br /><br />&quot;&nbsp;制表符为4<br />set&nbsp;tabstop=4<br /><br />&quot;&nbsp;统一缩进为4<br />set&nbsp;softtabstop=4<br />set&nbsp;shiftwidth=4<br /><br />&quot;&nbsp;不要用空格代替制表符<br />set&nbsp;noexpandtab<br /><br />&quot;&nbsp;不要换行<br />set&nbsp;nowrap<br /><br />&quot;&nbsp;在行和段开始处使用制表符<br />set&nbsp;smarttab<br /><br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;CTags的设定<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;按照名称排序<br />let&nbsp;Tlist_Sort_Type&nbsp;=&nbsp;&quot;name&quot;<br /><br />&quot;&nbsp;在右侧显示窗口<br />let&nbsp;Tlist_Use_Right_Window&nbsp;=&nbsp;1<br /><br />&quot;&nbsp;压缩方式<br />let&nbsp;Tlist_Compart_Format&nbsp;=&nbsp;1<br /><br />&quot;&nbsp;如果只有一个buffer,kill窗口也kill掉buffer<br />let&nbsp;Tlist_Exist_OnlyWindow&nbsp;=&nbsp;1<br /><br />&quot;&nbsp;不要关闭其他文件的tags<br />let&nbsp;Tlist_File_Fold_Auto_Close&nbsp;=&nbsp;0<br /><br />&quot;&nbsp;不要显示折叠树<br />let&nbsp;Tlist_Enable_Fold_Column&nbsp;=&nbsp;0<br /><br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;Autocommands<br />&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br />&quot;&nbsp;只在下列文件类型被侦测到的时候显示行号,普通文本文件不显示<br /><br />if&nbsp;has(&quot;autocmd&quot;)<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;FileType&nbsp;xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby&nbsp;set&nbsp;number<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;FileType&nbsp;xml,html&nbsp;vmap&nbsp;&ltC-o&gt&nbsp;&ltESC&gt'&lti&lt!--&ltESC&gto&ltESC&gt'&gto--&gt<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;FileType&nbsp;java,c,cpp,cs&nbsp;vmap&nbsp;&ltC-o&gt&nbsp;&ltESC&gt'&lto/*&ltESC&gt'&gto*/<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;FileType&nbsp;html,text,php,vim,c,java,xml,bash,shell,perl,python&nbsp;setlocal&nbsp;textwidth=100<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;Filetype&nbsp;html,xml,xsl&nbsp;source&nbsp;$VIMRUNTIME/plugin/closetag.vim<br />&nbsp;&nbsp;&nbsp;&nbsp;autocmd&nbsp;BufReadPost&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;if&nbsp;line(&quot;'\&quot;&quot;)&nbsp;&gt&nbsp;0&nbsp;&&&nbsp;line(&quot;'\&quot;&quot;)&nbsp;&lt=&nbsp;line(&quot;$&quot;)&nbsp;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;exe&nbsp;&quot;&nbsp;normal&nbsp;g`\&quot;&quot;&nbsp;|<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;endif<br />endif&nbsp;&quot;has(&quot;autocmd&quot;)<br /><br />&quot;&nbsp;F5编译和运行C程序,F6编译和运行C++程序<br />&quot;&nbsp;请注意,下述代码在windows下使用会报错<br />&quot;&nbsp;需要去掉./这两个字符<br /><br />&quot;&nbsp;C的编译和运行<br />map&nbsp;&ltF5&gt&nbsp;:call&nbsp;CompileRunGcc()&ltCR&gt<br />func!&nbsp;CompileRunGcc()<br />exec&nbsp;&quot;w&quot;<br />exec&nbsp;&quot;!gcc&nbsp;%&nbsp;-o&nbsp;%&lt&quot;<br />exec&nbsp;&quot;!&nbsp;./%&lt&quot;<br />endfunc<br /><br />&quot;&nbsp;C++的编译和运行<br />map&nbsp;&ltF6&gt&nbsp;:call&nbsp;CompileRunGpp()&ltCR&gt<br />func!&nbsp;CompileRunGpp()<br />exec&nbsp;&quot;w&quot;<br />exec&nbsp;&quot;!g++&nbsp;%&nbsp;-o&nbsp;%&lt&quot;<br />exec&nbsp;&quot;!&nbsp;./%&lt&quot;<br />endfunc<br /><br />&quot;&nbsp;能够漂亮地显示.NFO文件<br />set&nbsp;encoding=utf-8<br />function!&nbsp;SetFileEncodings(encodings)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;b:myfileencodingsbak=&fileencodings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;&fileencodings=a:encodings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endfunction<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function!&nbsp;RestoreFileEncodings()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;&fileencodings=b:myfileencodingsbak<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unlet&nbsp;b:myfileencodingsbak<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endfunction<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;au&nbsp;BufReadPre&nbsp;*.nfo&nbsp;call&nbsp;SetFileEncodings('cp437')|set&nbsp;ambiwidth=single&nbsp;au&nbsp;BufReadPost&nbsp;*.nfo&nbsp;call&nbsp;RestoreFileEncodings()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;高亮显示普通txt文件(需要txt.vim脚本)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;au&nbsp;BufRead,BufNewFile&nbsp;*&nbsp;setfiletype&nbsp;txt<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;用空格键来开关折叠<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;foldenable<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;foldmethod=manual<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nnoremap&nbsp;&ltspace&gt&nbsp;@=((foldclosed(line('.'))&nbsp;&lt&nbsp;0)&nbsp;?&nbsp;'zc':'zo')&ltCR&gt<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;minibufexpl插件的一般设置<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;g:miniBufExplMapWindowNavVim&nbsp;=&nbsp;1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;g:miniBufExplMapWindowNavArrows&nbsp;=&nbsp;1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;g:miniBufExplMapCTabSwitchBufs&nbsp;=&nbsp;1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;g:miniBufExplModSelTarget&nbsp;=&nbsp;1<br />5,随后,就是自己在其中尽情的探索了<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;朋友,祝你好运<br />
ictty 发表于 2009-5-14 13:15 | 显示全部楼层

我用Fedora

  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

7

主题

94

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部