毋庸置疑vim很强大,然而没有插件的话对于大多数人来说他的界面是很不友好的。下面简单写一下我对vim的配置

这是我的vim配置,装的插件不是很多,对我来说已经够用。左边的侧边栏是NERD插件提供的,还装了youcompleteme做代码补全用,其他的就是对vimrc的配置了。

插件都是使用bundle来管理的,在安装前需要在~下新建.vim/{plugin,doc,bundle}

1、安装vundle

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

2、在vimrc文件中输入如下配置,然后打开vim,运行 :PluginInstall,如果安装成功,你将看到Done!的提示字样。

3、YCM语法补全模块的编译

  不同于很多vim插件,YCM首先需要编译,另外还需要有配置。在vim启动后,YCM会找寻当前路径以及上层路径的.ycm_extra_conf.py.在~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py中提供了默认的模板

cd ~/.vim/bundle
cd YouCompleteMe
git clone https://github.com/Valloric/YouCompleteMe.git
git submodule update --init --recursive
./install.py --clang-completer

4、然后应该可以使用了

若想打造Python的IDE可以移步这里

附:.vimrc

"--------------------------------------------------------------------------
" Bundle
"--------------------------------------------------------------------------
"启用Vim的特性,而不是Vi的(必须放到配置的最前边)
set nocompatible
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required
Plugin 'scrooloose/nerdtree'
nnoremap <F2> :NERDTreeToggle<CR>Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"autocmd vimenter * NERDTree
" 设置NerdTree(侧边栏)
map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>
" 关闭文件时同时关闭文件浏览器
let NERDTreeQuitOnOpen =
"当打开vim且没有文件时自动打开NERDTree
autocmd vimenter * if !argc() | NERDTree | endif
" 只剩 NERDTree时自动关闭
autocmd bufenter * if (winnr("$") == && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif "--------------------------------------------------------------------------
" 基本设置
"--------------------------------------------------------------------------
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" 设置编码
set encoding=utf-
set fenc=utf-
set fileencodings=ucs-bom,utf-,cp936,gb2312,gb18030,big5
"显示行号
set number
"设置背景色
"set bg=dark "用 koehler 调色板
"colorscheme koehler
colorscheme desert
"隐藏工具栏和滑动条
set guioptions=aAce
"总是在窗口右下角显示光标的位置
set ruler "设置标签栏
"最多30个标签
set tabpagemax=
"显示标签栏
set showtabline= " 启用鼠标
if has('mouse')
set mouse=v
endif "设置语法高亮
if &t_Co > || has("gui_running")
syntax on
endif " 输入文本时隐藏鼠标
set mousehide
"--------------------------------------------------------------------------
" 搜索设置
"--------------------------------------------------------------------------
"打开搜索高亮
set hlsearch
"忽略大小写
set ignorecase
"在查找时输入字符过程中就高亮显示匹配点。然后回车跳到该匹配点。
set incsearch
"设置查找到文件尾部后折返开头或查找到开头后折返尾部。
set wrapscan

打造属于自己的vim利器的更多相关文章

  1. SuperSpider——打造功能强大的爬虫利器

    SuperSpider——打造功能强大的爬虫利器   1.爬虫的介绍 图1-1  爬虫(spider) 网络爬虫(web spider)是一个自动的通过网络抓取互联网 上的网页的程序,在当今互联网 中 ...

  2. 打造适合自己的vim编辑器方法总结

    vim使用方法总结 说明:这是打造适合自己的vim编辑器的进阶方法,关于vim基础知识,请自行百度.也可参考文章末尾推荐blog网址 如果觉得自己打造vim编辑器麻烦,可以从github上面克隆一个, ...

  3. 打造一个上传图片到图床利器的插件(Mac版 开源)

    写markdown博客如何将截图快速上传到图床--记一个工具插件的实现(windows版 开源)(2017-05-31 20:23) 打造一个上传图片到图床利器的插件 鉴于写博客截图手动上传到图床的步 ...

  4. 打造百度网盘备份利器:自动备份Linux VPS文件和多线程下载百度网盘资源

    前一段时间国内的各大网盘百度云盘,金山快盘,360云盘,华为网盘为争夺用户上演空间容量博弈,网盘商们还固执地以为中国的网民都不懂网络技术,可以像某公司那样用一些数字的手段来忽悠用户,参与到网盘商的数字 ...

  5. Github Atom开源文本代码编辑器- 由 Github 打造的下一代编程开发利器

    个人理解:Github 热度超凡的一个项目Atom,electron是整个atom的核心,对于electron可以理解成 electron =io.js + Chromium    通过 Electr ...

  6. 在 Linux 打造属于自己的 Vim

    Linux 系统中很多东西都是以脚本代码.配置文件的形式存在,使用 Linux 系统时,需经常对这些文件进行编辑.很显然,如果没有文本编辑器,江湖之路寸步难行. 我的选择是 Vim.Vim 是 Lin ...

  7. 学以致用十四-----打造一个简单的vim IDE

    一.安装dircolors git clone https://github.com/seebi/dircolors-solarized.git cd dircolors-solarized/ mv ...

  8. vim利器:vundle 管理器和NERDTree插件

    vundle 和nerdtree vundle git: https://github.com/VundleVim/Vundle.vim.git nerdtree git : https://gith ...

  9. 极客DIY:RFID飞贼打造一款远距离渗透利器

    本文使用最新的渗透工具RFID飞贼(Tastic RFID Thief)和RFID感应破解技术来获取一些拥有安防的建筑物的访问权限. Tastic RFID Thief是一个无声远距离RFID读卡器, ...

随机推荐

  1. 静默安装、授权及卸载Microsoft SQL Server、NET Framework、Windows Installer 、ArcGIS License Manager、ArcGIS Engine(Silent install、uninstall and Authorization.. .through Setup Factory)基于Setup Factory

    通过Setup Factory写的代码大概有1700行,所以就不整理了.思路如下: 静默安装都是通过去Microsoft 和Esri的官网找到静默安装的命令,然后File.Run(...)或者Shel ...

  2. csharp: MVC Controls

    http://mvccontrolstoolkit.codeplex.com/ MVC Controls Toolkit http://mvcjquerycontrols.codeplex.com/  ...

  3. u-boot中nandflash初始化流程分析(转)

    u-boot中nandflash初始化流程分析(转) 原文地址http://zhuairlunjj.blog.163.com/blog/static/80050945201092011249136/ ...

  4. 配置了<mvc:resources> 导致以前的controller 无法访问。

    解决方案: <mvc:annotation-driven/>

  5. Mysql的简单使用(三)

    接上文Mysql的简单使用(二) mysql中结构相同的两个表进行合并:(注意需要两个表的结构是一样的) 有如下结构的两个表father和person. 合并的步骤为: 1.把person表和fath ...

  6. WP修改ProgressBar的前景色

    重载默认主题中的值,修改ProgressBar的前景色 做一个小项目时,用到 ProgressBar添加一个加载效果,但是背景不是白色的,调试时发现自己选的主题色与背景色相近,特别不清晰,加载效果几乎 ...

  7. 【github】github 使用教程初级版

    github 是一个基于 git 的代码托管平台,付费用户可以建私人仓库,免费用户只能使用公共仓库.对于一般人来说公共仓库就已经足够了,而且也没多少代码来管理.下面简单介绍如何使用 github,供初 ...

  8. 参加2013中国大数据技术大会(BDTC2013)

    2013年12月5日-6日参加了为期两天的2013中国大数据技术大会(Big Data Technology Conference, BDTC2013),本期会议主题是:“应用驱动的架构与技术 ”.大 ...

  9. Objective-C学习笔记---构造函数和析构函数

    简单的讲,构造函数就是在创建一个对象的时候起到初始化的作用,对这个对象里的一些成员变量进行初始化,析构函数就是在对象被删除进行一些清理工作,也就是专门的扫尾工作,下面用代码来进行具体说明. 一.构造函 ...

  10. Android动画translate坐标图

    X坐标图示: Y坐标图示: