毋庸置疑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. C#使用 UdpClient 类进行简单通信的例子

    UdpClient 类提供了一些简单的方法,用于在阻止同步模式下发送和接收无连接 UDP 数据报. 因为 UDP 是无连接传输协议,所以不需要在发送和接收数据前建立远程主机连接.但您可以选择使用下面两 ...

  2. Tesseract-OCR引擎 入门

    OCR(Optical Character Recognition):光学字符识别,是指对图片文件中的文字进行分析识别,获取的过程. Tesseract:开源的OCR识别引擎,初期Tesseract引 ...

  3. 容器---List和AbstractList

    一.前言 前面我们介绍了Collection及其抽象实现,在JAVA的容器体系里,由Collection派生出来的有两大体系,即List和Map.本文以及后续文章将重点分析List体系.本文将重点分析 ...

  4. jquery 拓展

    1. 概述 jquery允许拓展自定义的方法, 绑定到$.fn对象上, 编写一个jQuery插件的原则: 给$.fn绑定函数,实现插件的代码逻辑: 插件函数最后要return this;以支持链式调用 ...

  5. Ajax基础实例

    前端代码 <script type="text/javascript"> var xmlhttp; function go(url) { xmlhttp=null; i ...

  6. 一些经典===>>用SQL语句操作数据

    用SQL语句操作数据 结构化查询语言(Structured Query Language)简称SQL(发音:/ˈes kjuː ˈel/ "S-Q-L"),是一种特殊目的的编程语言 ...

  7. 从自签名证书导出pfx和cer证书

    完整代码: public sealed class DataCertificate { #region 生成证书 /// <summary> /// 根据指定的证书名和makecert全路 ...

  8. 解决Spring MVC @ResponseBody返回html中中文字符串乱码问题

    最近有个应用,通过responsebody返回完整的html页面时出现乱码是异常的问题,因为是通过responsebody返回,所以一开始设置了text/plain的字符集,如下: <mvc:a ...

  9. rabbitmq+ keepalived+haproxy高可用集群详细命令

    公司要用rabbitmq研究了两周,特把 rabbitmq 高可用的研究成果备下 后续会更新封装的类库 安装erlang wget http://www.gelou.me/yum/erlang-18. ...

  10. javascript --- 设计模式之单体模式(一)

    单体是一个用来划分命名空间并将一些相关的属性与方法组织在一起的对象,如果她可以被实例化的话,那她只能被实例化一次(她只能嫁一次,不能二婚). 单体模式是javascript里面最基本但也是最有用的模式 ...