Skip to content

Instantly share code, notes, and snippets.

@guiyanzhong
Forked from jhezjkp/.vimrc
Created July 27, 2016 05:39
Show Gist options
  • Save guiyanzhong/0935659eef92aa17234099e47cf2d9c4 to your computer and use it in GitHub Desktop.
Save guiyanzhong/0935659eef92aa17234099e47cf2d9c4 to your computer and use it in GitHub Desktop.
vim配置
"安装/更新:BundleInstall
"卸载即将对应项注释后再运行:BundleClean
"取消兼容模式
set nocompatible
"关闭文件类型侦测,必须
filetype off
"powerline配置要求
set laststatus=2
"编码设置
set encoding=utf-8
set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gbk2312,cp936
"显示行号
set number
"开启语法高亮
syntax on
"显示不完整的命令
set showcmd
"搜索相关
set showmatch "高亮显示匹配的括号
set hlsearch "高亮显示搜索结果
set incsearch "进行搜索时进行实时匹配
set ignorecase "搜索时忽略大小写
set smartcase "只有搜索关键字中出现一个大写字母时才区分大小写
"tab转空格的相关设置
set shiftwidth=4
set sts=4
set tabstop=4
set expandtab "用空格代替制表
"设置默认的Ctrl+X Ctrl+K自动补全
set dictionary+=/usr/share/dict/words "把系统默认字典添加进来
set isk+=- "不把中划线看作是单词分隔符
"设置光标所在行阴影高亮
set cursorline
"vundle设置
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"使用vundle管理vundle,vundle要求
Bundle 'gmarik/vundle'
"自定义安装的bundle,配置github库名
"powerline插件
Bundle 'Lokaltog/vim-powerline'
"zencoding插件: 输入zen表达式,然后按Ctrl+y,再按,即可将表达式展开
Bundle 'mattn/zencoding-vim'
"git插件
Bundle 'tpope/vim-fugitive'
"记录上次编辑位置的插件
Bundle 'lastpos.vim'
"python插件
Bundle 'klen/python-mode'
"tagbar插件: <F4>激活(个人配置)
Bundle 'majutsushi/tagbar'
"undo插件: <F5>激活(个人配置)
Bundle 'sjl/gundo.vim'
"vim-snipmate前置依赖
Bundle 'MarcWeber/vim-addon-mw-utils'
"vim-snipmate前置依赖
Bundle 'tomtom/tlib_vim'
"vim-snipmate:
"<Tab>键激活,相关snippets在~/.vim/bundle/snipmate-snippets/snippets/目录下
Bundle 'garbas/vim-snipmate'
"代码片段库
Bundle 'honza/snipmate-snippets'
"注释插件: , cc为注释 , cu为取消注释
Bundle 'scrooloose/nerdcommenter'
"文件系统视图插件: <F7>激活(个人配置)
Bundle 'scrooloose/nerdtree'
"配色主题插件
Bundle 'ootoovak/vim-tomorrow-night'
"对齐线插件
Bundle 'nathanaelkane/vim-indent-guides'
"vim-ruby插件
Bundle 'vim-ruby/vim-ruby'
"rail-vim插件(rails相关的快速方切切换插件): :find XX
Bundle 'tpope/vim-rails'
"ctrlp插件(文件切换): Ctrl+p激活
Bundle 'kien/ctrlp.vim'
"ack插件(类引用查找,类似grep): :Ack XXX 然后用:cn和:cp进行向前向后查找
Bundle 'mileszs/ack.vim'
"雇用文件类型侦测插件并为特定文件类型载入缩进文件,必须
filetype plugin indent on
"NERDCommenter设置
let mapleader = ','
"NERDTree设置
let NERDTreeWinPos = 'left'
let NERDTreeWinSize = 30
nmap <F7> <ESC>:NERDTreeToggle<RETURN>
"python-mode设置
"允许在vim中运行python
let g:pymode_run = 1
"运行python的快捷键为E
let g:pymode_run_key = '<C-E>'
"自动补全
map <C-Space> <nop> " disable python-mode RopeCodeAssistInsertMode Key binding
"Ctrl+O打开自动补全(使用Ctrl+N和Ctrl+P来向前、向后翻页)
inoremap <C-O> <C-R>=RopeCodeAssistInsertMode()<CR>
"tagbar配置
"按F4打开/关闭tagbar界面
nmap <silent> <F4> :TagbarToggle<CR>
"设置tagbar宽度
let g:tagbar_width = 30
"设置tagbar在右边
let g:tagbar_left = 0
"设置tagbar打开时是否自动获取焦点
let g:tagbar_autofocus = 0
"设置tagbar默认打开(大屏幕显示器可以打开)
"autocmd VimEnter * nested TagbarOpen
"gundo配置
"按F5打开/关闭gundo界面
noremap <F5> :GundoToggle<CR>
"配色主题设置
colorscheme tomorrow-night
"indent-guides配置
"设置对齐线宽度为1
let g:indent_guides_guide_size=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment