打造属于自己的vim利器
毋庸置疑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利器的更多相关文章
- SuperSpider——打造功能强大的爬虫利器
SuperSpider——打造功能强大的爬虫利器 1.爬虫的介绍 图1-1 爬虫(spider) 网络爬虫(web spider)是一个自动的通过网络抓取互联网 上的网页的程序,在当今互联网 中 ...
- 打造适合自己的vim编辑器方法总结
vim使用方法总结 说明:这是打造适合自己的vim编辑器的进阶方法,关于vim基础知识,请自行百度.也可参考文章末尾推荐blog网址 如果觉得自己打造vim编辑器麻烦,可以从github上面克隆一个, ...
- 打造一个上传图片到图床利器的插件(Mac版 开源)
写markdown博客如何将截图快速上传到图床--记一个工具插件的实现(windows版 开源)(2017-05-31 20:23) 打造一个上传图片到图床利器的插件 鉴于写博客截图手动上传到图床的步 ...
- 打造百度网盘备份利器:自动备份Linux VPS文件和多线程下载百度网盘资源
前一段时间国内的各大网盘百度云盘,金山快盘,360云盘,华为网盘为争夺用户上演空间容量博弈,网盘商们还固执地以为中国的网民都不懂网络技术,可以像某公司那样用一些数字的手段来忽悠用户,参与到网盘商的数字 ...
- Github Atom开源文本代码编辑器- 由 Github 打造的下一代编程开发利器
个人理解:Github 热度超凡的一个项目Atom,electron是整个atom的核心,对于electron可以理解成 electron =io.js + Chromium 通过 Electr ...
- 在 Linux 打造属于自己的 Vim
Linux 系统中很多东西都是以脚本代码.配置文件的形式存在,使用 Linux 系统时,需经常对这些文件进行编辑.很显然,如果没有文本编辑器,江湖之路寸步难行. 我的选择是 Vim.Vim 是 Lin ...
- 学以致用十四-----打造一个简单的vim IDE
一.安装dircolors git clone https://github.com/seebi/dircolors-solarized.git cd dircolors-solarized/ mv ...
- vim利器:vundle 管理器和NERDTree插件
vundle 和nerdtree vundle git: https://github.com/VundleVim/Vundle.vim.git nerdtree git : https://gith ...
- 极客DIY:RFID飞贼打造一款远距离渗透利器
本文使用最新的渗透工具RFID飞贼(Tastic RFID Thief)和RFID感应破解技术来获取一些拥有安防的建筑物的访问权限. Tastic RFID Thief是一个无声远距离RFID读卡器, ...
随机推荐
- sql apply
可以给表值函数传column,而join不可以
- Retention、Documented、Inherited三种注解
Retention注解 Retention(保留)注解说明,这种类型的注解会被保留到那个阶段. 有三个值:1.RetentionPolicy.SOURCE —— 这种类型的Annotations只在源 ...
- Linux守护进程实现程序只运行一次
1.守护进程 守护进程(Daemon)是一种运行在后台的特殊进程,它独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件. 2.让程序只运行一次 如果让程序只运行一次,有很多方法,此处的一种 ...
- 树状数组---Squared Permutation
BNUOJ 51636 最近,无聊的过河船同学在玩一种奇怪的名为“小Q的恶作剧”的纸牌游戏. 现在过河船同学手有张牌,分别写着,打乱顺序之后排成一行,位置从左往右按照标号. 接下来小Q同学会给出个 ...
- C语言范例学习03-下
树与图 3.5 二叉树及其应用 PS:二叉树是最经典的树形结构,适合计算机处理,具有存储方便和操作灵活等特点,而且任何树都可以转换成二叉树. 实例101 二叉树的递归创建 实例102 二叉树的遍历 问 ...
- PowerBuilder反编译
最近需要了解某个PowerBuilder程序如何工作的,这已经是某个时代的产物了.除了EXE之外,还有一些PBD文件.PBD文件是PowerBuilder动态库,作为本地DLL的一个替 ...
- 【github】github 使用教程初级版
github 是一个基于 git 的代码托管平台,付费用户可以建私人仓库,免费用户只能使用公共仓库.对于一般人来说公共仓库就已经足够了,而且也没多少代码来管理.下面简单介绍如何使用 github,供初 ...
- SAP中给当前指定的活动用户发系统信息的函数
函数名:TH_POPUP 输入集团.当前在线用户.Message即可
- CRM 2013 系统设置新功能二:Entity images 图像字段
CRM2013系统默认的许多实体都已经有了图像的选择,如 右上角可以设置当前用户的头像. 客户.联系人等都可以,下面将介绍一下此项新功能: 一.实体中新建图像字段,其中系统自动命名entityinag ...
- 解决Sharepoint 2010 custom display form 不显示附件的问题
sharepoint 2010用designer添加自定义的 display form默认是不会显示附件的. 需要添加如下代码才会显示附件: <tr> <td width=" ...