CentOS6 下Vim安装和配置
1.系统只安装了vim-minimal,执行以下命令安装另外两个组件
yum install vim-common
yum install vim-enhanced
2.安装ctags
yum install ctags
下载linux-2.6.32.27内核源码并解压到~/arm/linux-2.6.32.27,进入该目录,生成索引文件
ctags -R *
3.安装插件(基本上就是解压到~/.vim目录):taglist/nerdcommenter/omnicppcomplete/echofunc/bufexplorer/winmanager
4.配置文件
" 关闭vi的键盘模式
set nocompatible
" 关闭备份
set nobackup
" 禁止生成临时文件
set noswapfile " 允许使用鼠标定位和选择
set mouse=a
set selection=exclusive
set selectmode=mouse,key " 显示行号
set number
" 禁止折行
set nowrap " 突出显示当前行
"set cursorline cursorcolumn " 切换文件时自动保存当前改动文件
set autowrite " 设置状态栏显示的内容
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
" 设置总是显示状态栏
"set laststatus=2 " 光标移动到顶部和底部时保持3行距离
set scrolloff= " 检测文件类型
filetype on
filetype plugin on " 设置编码
set encoding=utf-
set termencoding=utf-
set fileencodings=ucs-bom,utf-,gbk,gb2312,cp936
set fileencoding=utf- " 设置语言
set langmenu=zh_CN.UTF-
set helplang=cn " 设置tab
set noexpandtab " 不将tab扩展成空格
set tabstop= " 一个tab显示出来是多少个空格
set shiftwidth= " 每一级缩进多少个空格
set smarttab " 根据文件中其他地方的缩进空格个数来确定一个tab是多少个空格 " 设置缩进
set nocindent " 关闭cindent缩进方式
"set cindent " 开启C/C++语言的缩进方式
"set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s " 设置C/C++语言的具体缩进方式
set noautoindent " 关闭autoindent缩进方式
set nosmartindent " 关闭smartindent缩进方式 if has("autocmd")
filetype plugin indent on autocmd FileType text setlocal textwidth=
autocmd FileType text set nocindent
autocmd FileType html set formatoptions+=tl
autocmd FileType css set smartindent
autocmd FileType c,cpp,slang,esqlc set cindent
endif " 语法高亮
syntax enable
syntax on " 设置配色
colorscheme desert
"colorscheme darkblue
"colorscheme peachpuff " 搜索忽略大小写
set ignorecase
" 如果搜索模式包含大写字母则忽略'ignorecase'选项
set smartcase
" 搜索逐字符高亮
set hlsearch
set incsearch " 高亮显示匹配的括号
set showmatch
" 匹配括号高亮的时间(单位是十分之一秒)
set matchtime= " --ctags settings--
map <F12> :!ctags -R --c++-kinds=+p --fields=+ialS --extra=+q .<CR><CR> :TlistUpdate<CR>
imap <F12> <ESC>:!ctags -R -c++kinds=+p --fields=+ialS --extra=+q .<CR><CR> :TlistUpdate<CR>
set tags=tags
set tags+=~/arm/linux-2.6.32.27/tags " add the linux kernel source's tags file
set tags+=./tags " add current directory's generated tags file " --OmniCppComplete settings--
imap<F3> <C-X><C-O>
set completeopt=menu,menuone " 关闭智能补全时的预览窗口
let OmniCpp_MayCompleteDot= " autocomplete with .
let OmniCpp_MayCompleteArrow= " autocomplete with ->
let OmniCpp_MayCompleteScope= " autocomplete with ::
let OmniCpp_SelectFirstItem= " select first item, but don't insert
let OmniCpp_NamespaceSearch= " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr= " show function prototype in popup window
let OmniCpp_GlobalScopeSearch= " enable the global scope search
let OmniCpp_DisplayMode= " class scope completion mode: always show all members
"let OmniCpp_DefaultNamespaces=["std"]
let OmniCpp_ShowScopeInAbbr= " show scope in abbreviation and remove the last column
let OmniCpp_ShowAccess= " --Taglist settings--
let Tlist_Ctags_Cmd='ctags'
let Tlist_Use_Right_Window=
let Tlist_Show_One_File= " 允许同时显示多个文件的函数列表
let Tlist_File_Fold_Auto_Close= " 非当前文件,函数列表折叠隐藏
let Tlist_Exit_OnlyWindow= " 当Taglist是最后一个分割窗口时,自动退出vim
let Tlist_Process_File_Always= " 实时更新tags
let Tlist_Inc_Winwidth=
let Tlist_WinWidth=
"nmap tl :Tlist<CR> " --BufExplorer settings--
let g:bufExplorerDefaultHelp= " Do not show default help.
let g:bufExplorerShowRelativePath= " Show relative paths.
let g:bufExplorerSortBy='mru' " Sort by most recently used. " --WinManager setting--
let g:winManagerWindowLayout='BufExplorer|FileExplorer' " 设置我们要管理的插件
let g:persistentBehaviour= " 如果所有编辑文件都关闭了,退出vi
let g:winManagerWidth=
nmap wm :TlistToggle<CR> :WMToggle<CR> " --QuickFix settings--
"map <F7> :make<CR> :copen<CR>
"map <F8> :cp<CR>
"map <F9> :cn<CR>
"imap <F7> <ESC>:make<CR> :copen<CR>
"imap <F8> <ESC>:cp<CR>
"imap <F9> <ESC>:cn<CR> " --Fold settings--
function! ToggleFold()
if foldlevel('.')==
normal! l
else
if foldclosed('.')<
. foldclose!
else
. foldopen!
endif
endif
" clear status line
echo
endfunction noremap <space> :call ToggleFold()<CR> function FoldBrace()
if getline(v:lnum+)[]=='{'
return
endif
if getline(v:lnum)=~'{'
return
endif
if getline(v:lnum)[]=~'}'
return '<1'
endif
return -
endfunction if has("autocmd")
autocmd BufReadPost *.h,*.hh,*.c,*.ec,*.cpp,*.hpp,*.ecpp,*.pc set foldexpr=FoldBrace()
autocmd BufReadPost *.h,*.hh,*.c,*.ec,*.cpp,*.hpp,*.ecpp,*.pc set foldmethod=expr
autocmd BufReadPost *.h,*.hh,*.c,*.ec,*.cpp,*.hpp,*.ecpp,*.pc set foldenable
endif " --Terminal color settings--
hi Folded term=standout cterm=bold ctermfg=DarkGreen ctermbg=NONE
hi IncSearch term=bold ctermfg=red ctermbg=black
hi Search term=bold ctermfg=red ctermbg=black
CentOS6 下Vim安装和配置的更多相关文章
- 阿里云centOS6 下python安装及配置、pip安装及配置、ipython安装及配置
我是在阿里云服务器上进行的python环境搭建,阿里云服务器会自带python但是版本低,所以打算自己安装一个,期间遇到各种问题,而且百度根本不够用无奈上的外网很快解决了.在此分享一下. 一.pyth ...
- CentOs6.5中安装和配置vsftp简明
这篇文章主要介绍了CentOs6.5中安装和配置vsftp简明教程,需要的朋友可以参考下 一.vsftp安装篇 复制代码代码如下: # 安装vsftpdyum -y install vsftp ...
- CentOs6.5中安装和配置vsftp简明教程[转]
CentOs6.5中安装和配置vsftp简明教程 林涛 发表于:2017-3-17 10:10 分类:WebServer 标签: 101次 一.vsftp安装篇 复制代码代码如下: # 安装vsftp ...
- [moka同学摘录]在Centos 6.5下成功安装和配置了vim7.4
来源:https://my.oschina.net/gzyh/blog/266097 资源下载地址: 链接:http://pan.baidu.com/s/1kVuaV5P 密码:xkq9 摘要: ...
- CentOS6下编译安装Python2.7.6方法
关于在CentOS6下编译安装Python2.7.6的方法非常的多了,小编以前也介绍过相关的文章了,下面一聚教程小编再来为各位介绍一下吧,希望文章能帮助到各位. CentOS下面Python在升级 ...
- centos6下的安装navicat premium
centos6下的安装navicat premium CentOS6下做开发的时候,数据库客户端是一个必须要有的工具,因为经常要和数据库打交道.由于数据库的类型多样,有MySQL.Oracle.Pos ...
- centos6下yum安装mariadb数据库的解决方法
在centos6下Yum安装mariadb数据库时老是提示无法正常安装,看错误日志才发现,是没有mariadb release源文件在/etc/yum.repos.d/中,为此,我特意在新建文件: # ...
- [转]:Ubuntu 下Apache安装和配置
[转]:Ubuntu 下Apache安装和配置_服务器应用_Linux公社-Linux系统门户网站 https://www.linuxidc.com/Linux/2013-06/85827.htm ...
- libCURL开源库在VS2010环境下编译安装,配置详解
libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 http://blog.csdn.net/su ...
随机推荐
- HDU 5317 RGCDQ (质数筛法,序列)
题意:从1~1000,000的每个自然数质因子分解,不同因子的个数作为其f 值,比如12=2*2*3,则f(12)=2.将100万个数转成他们的f值后变成新的序列seq.接下来T个例子,每个例子一个询 ...
- Image.FromFile 方法锁住文件解决方法
Image.FromFile 一旦使用后,对应的文件在一直调用 其生成的Image对象被Disponse前都不会被解除锁定,这就造成了一个问题,就是在这个图形被解锁前无法对图像进行操作(比如删除,修 ...
- C# GDI+学习笔记1
前言 本文是学习C# GDI+系列的第一篇文章,简单的介绍了GDI+的一些基本绘图内容,比较粗糙.但本文主要是让大家简单的回顾一下GDI+的基本概念.本篇文章的参考代码请在此下载 . GDIPTes ...
- JQuery实现分页程序代码,源码下载
Web开发,分页在所难免的,微软GridView.AspPager等设置分页数据可以自动分页,但是这里浏览器会闪动,用户体验不是很友好,在此我整理了JQuery实现分页,并且使用 JQuery模板显示 ...
- C++模板知识小结
模板定义:模板就是实现代码重用机制的一种工具,它可以实现类型参数化,即把类型定义为参数, 从而实现了真正的代码可重用性.模版可以分为两类,一个是函数模版,另外一个是类模版. 由于类模板包含类型参数,因 ...
- bat 批处理脚本
目录: 1:ping多个不同服务器IP 2:每隔一段时间清一次DNS缓存 3:将一个文件夹中的所有文件,分别保存在一个新文件夹中,以保持每个文件夹一个文件 功能1:ping多个不同服务器IP 环境开通 ...
- 【转】从外行的视角尝试讲解为什么这回丰田栽了【全文完】【v1.01】
转自:http://club.tgfcer.com/thread-6817371-1-1.html [第一部分]背景简介 前几年闹得沸沸扬扬的丰田刹不住事件最近又有新进展.十月底俄克拉荷马的一次庭审 ...
- B.xml
pre{ line-height:1; color:#1e1e1e; background-color:#f0f0f0; font-size:16px;}.sysFunc{color:#627cf6; ...
- Java 断点调试总结
为了准备调试,你需要在代码中设置一个断点先,以便让调试器暂停执行允许你调试,否则,程序会从头执行到尾,你就没有机会调试了. 1. 条件断点 断点大家都比较熟悉,在Eclipse Java 编辑区的行头 ...
- phpcms V9实现QQ登陆OAuth2.0
phpcmsV9使用的QQ登陆依然是OAuth1.0,但现在腾讯已经不审核使用OAuth1.0的网站了.这对于使用pc的站长来讲是一个无比巨大的坑.经过对phpcms论坛的一位同学做的插件进行修改,现 ...