vim 设计详解

vim 最终效果

vim 脚本安装注意

  • 若是Linux已经安装apt-get,直接运行PluginsInstall.sh;

  • 若是系统为FPG,则执行FPGInstall.sh;

  • github: https://github.com/moses1989/mosesGitHub

-若您有任何问题或者设计建议,请留言给我,我会尽快回复

vim 快捷键

Button state
F1 帮助文档
F2 新建一个标签页
F3 NERDTree 目录文件
F4 快速运行
F5 编译运行
F6 代码格式优化、
F7 winmanager 窗口管理
F8 代码调试
F9 taglist 方法列表
F11 时光机
F12 缩进重排

vim 相关技巧

1.tab标签页命令:

:tabnew [++opt选项] [+cmd] 文件 建立对指定文件新的tab
:tabc 关闭当前的tab
:tabo 关闭所有其他的tab
:tabs 查看所有打开的tab
:tabp 前一个
:tabn 后一个
map :tabp
map :tabn

2.分屏功能:

横向切割窗口
:new+窗口名(保存后就是文件名)
:split+窗口名,也可以简写为:sp+窗口名
纵向切割窗口名
:vsplit+窗口名,也可以简写为:vsp+窗口名
窗口切换
:ctrl+w+j/k,通过j/k可以上下切换,或者:ctrl+w加上下左右键,还可以通过快速双击ctrl+w依次切换窗口。
给窗口重命名
:f file
vi打开多文件
vi a b c
:n 跳至下一个文件,也可以直接指定要跳的文件,如:n c,可以直接跳到c文件
:e# 回到刚才编辑的文件
文件浏览
:Ex 开启目录浏览器,可以浏览当前目录下的所有文件,并可以选择
:Sex 水平分割当前窗口,并在一个窗口中开启目录浏览器
:ls 显示当前buffer情况
vi与shell切换
:shell 可以在不关闭vi的情况下切换到shell命令行
:exit 从shell回到vi

3.文件对比功能:

:vert diffsplit
nnoremap :vert diffsplit

4.模糊搜索当前文件的函数:

:CtrlPFunky
nnoremap fu :CtrlPFunky
nnoremap :CtrlPFunky

5.执行shell命令:

:!command
:!ls 列出当前目录下文件
:!perl -c script.pl 检查perl脚本语法,可以不用退出vim,非常方便。
:!perl script.pl 执行perl脚本,可以不用退出vim,非常方便。
:suspend或Ctrl - Z 挂起vim,回到shell,按fg可以返回vim。
重复上一次shell操作:
:!!

6.替换命令:

ra 将当前字符替换为a,当期字符即光标所在字符。
s/old/new/ 用old替换new,替换当前行的第一个匹配
s/old/new/g 用old替换new,替换当前行的所有匹配
%s/old/new/ 用old替换new,替换所有行的第一个匹配
%s/old/new/g 用old替换new,替换整个文件的所有匹配
:10,20 s/^/ /g 在第10行知第20行每行前面加四个空格,用于缩进。
ddp 交换光标所在行和其下紧邻的一行。

7.其他:

查看键盘映射:
:map

添加注销
Ctrl+c

取消注销
Ctrl+x

自动补全
Ctrl+p or Ctrl+n

去掉所有空行
:g/^\s*$/d

全选
ggVG

把鼠标设置为V模式
set mouse=v

左移 右移
V模式选择后{Shift+,}左移 , {Shift+.}右移

重复上次操作
{.}句号键

跳到首行
gg

跳到末行
G

字符变大写
gU

字符变小写
gu

光标所在行跳到页面中间显示
zz

块操作
{C-v} {C-d} I– [ESC]

把所有的行连接成一行
V模式选择多行按大J

自动缩进
= 等于号

vimrc 源码及解析

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM File Format & layout """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 自动缩进为4个空格
set sw=4
" Tab 宽度为4 set ts=4 " 设置光标超过88列时候折行
"set tw=88 " 不折行
set nowrap
" 在行和段开始处使用制表符, 按下删除键直接删除4个空格 set smarttab " 智能缩进
set smartindent
" 不在单词中间折行 set lbr " 自动格式化
set formatoptions=tcrqn
" 继承前一行的缩进方式,特别适用于多行注释 set autoindent " 使用C样式的缩进
set cindent
" 制表符为4 set tabstop=4 " 统一缩进为4
set softtabstop=4
set shiftwidth=4
" 带有如下符号的单词不要被换行分割 set iskeyword+=_,$,@,%,#,- " 字符间插入的像素行数目
set linespace=0

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM File Setting """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 编辑时将所有Tab替换成空格
set et
" 设定默认解码 set fenc=utf-8 set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936 " 历史记录数
set history=1000
" 在处理未保存或只读文件的时候,弹出确认 set confirm " 侦测文件类型
"filetype on " 载入文件类型插件
"filetype plugin on " 为特定文件类型载入相关缩进文件
"filetype indent on " 使回格键(backspace)正常处理indent, eol, start等
set backspace=2
" 防止特殊符号无法正常显示 set ambiwidth=double " 禁止生成临时文件
set nobackup
" 不要生成swap文件,当buffer被丢弃的时候隐藏它 setlocal noswapfile set bufhidden=hide " 打开拼写检查,光标放在单词上  z= 出现拼写建议, ]s 跳到下一个拼写错误处
"set spell " 打开C/C++风格自动缩进,可以通过:set paste关闭,:set nopaste重新开启
"set cin " 允许backspace和光标键跨越行边界(不建议)
"set whichwrap+=b,s,h,l,<,>,~,[,] """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " VIM Search & Matching
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 搜索时高亮显示被找到的文本 set hls "搜索忽略大小写
set ignorecase
" 匹配括号高亮的时间(单位是十分之一秒) set matchtime=2 "高亮被搜索的句子 nohlsearch为不高亮
set hlsearch
" 在搜索时,输入的词句的逐字符高亮 set incsearch " 高亮显示匹配的括号
set showmatch

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM UI Config """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 光标移动到buffer的顶部和底部时保持3行距离
set scrolloff=3
" 不要闪烁 set novisualbell " 显示括号配对情况
set sm
" 在被分割的窗口间显示空白,便于阅读 set fillchars=vert:\ ,stl:\ ,stlnc:\ " 打开上色功能, 语法高亮
syntax on
"高亮光标所在行 set cul set cuc " 不要图形按钮  
set go=   
" 用浅色高亮当前行 autocmd InsertEnter * se cul " 输入的命令显示出来,看的清楚些    
set showcmd          
" 允许折叠 "set foldenable  
" 手动折叠 ""set foldmethod=manual " 显示中文帮助
if version >= 603
    set helplang=cn
    set encoding=utf-8
endif
" 使用空格代替制表符 set expandtab "将tab替换为空格
nmap tt :%s/\t/    /g<CR>
" 显示行号 set number "语言设置
set langmenu=zh_CN.UTF-8
set helplang=cn
"字体设置 set guifont=Bitstream\ Vera\ Sans\ Mono\ 10 "背景颜色设置
set t_Co=256
if has('gui_running')
    set background=light
else
    set background=dark
endif
colorscheme solarized

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM Status Line & Command Line """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 打开vim状态栏标尺
set ru
" 启动显示状态行(1),总是显示状态行(2) set laststatus=2 " 命令行(在状态行下)的高度,默认为1,这里是2
set cmdheight=2
"状态行显示的内容 set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} " 高亮字符,让其不受100列限制
":highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white ":match OverLength '\%101v.*'
" 状态行颜色 "highlight StatusLine guifg=SlateBlue guibg=Yellow
"highlight StatusLineNC guifg=Gray guibg=White " 命令模式Tab自动补全
set wildmenu
" 在状态行上显示光标所在位置的行号和列号 set ruler set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " VIM Other Config
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 打开断行模式对亚洲语言支持 set fo+=mB " 启动的时候不显示那个援助乌干达儿童的提示  
set shortmess=atI  

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM Action Item """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
set mouse=a
"set selection=exclusive "set selectmode=mouse,key
" 输入:set list命令是应该显示些啥? set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " 当右键单击窗口的时候,弹出快捷菜单
set mousemodel=popup
" 删除键可以继续往前删除数据 set backspace=indent,eol,start " 通过使用: commands命令,告诉我们文件的哪一行被改变过
set report=0

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM Normal Config """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 不兼容vi
set nocp
"去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限 set nocompatible " 与windows共享剪贴板
set clipboard+=unnamed  
" 保存全局变量 set viminfo+=! " 去掉输入错误的提示声音
set noeb
" 设置当文件被改动时自动载入 set autoread "代码补全
set completeopt=preview,menu
"自动保存 set autowrite " 突出显示当前行
"set cursorline " 设置魔术
set magic   
" 隐藏工具栏 set guioptions-=T " 隐藏菜单栏          
set guioptions-=m
if has("autocmd")
    autocmd BufReadPost *
                \ if line("'\"") > 0 && line("'\"") <= line("$") |
                \   exe "normal g`\"" |
                \ endif
endif
"当打开vim且没有文件时自动打开NERDTree autocmd vimenter * if !argc() | NERDTree | endif " 只剩 NERDTree时自动关闭
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Vim 所工作的终端 (或者 Windows 的 Console 窗口) 的字符编码方式 set termencoding=utf-8 " 当前字符编码
set encoding=utf8
" 设置编码自动识别 set fileencodings=utf8,ucs-bom,gbk,cp936,gb2312,gb18030 au FileType php setlocal dict+=~/.vim/dict/php_funclist.dict au FileType css setlocal dict+=~/.vim/dict/css.dict au FileType c setlocal dict+=~/.vim/dict/c.dict au FileType cpp setlocal dict+=~/.vim/dict/cpp.dict au FileType scale setlocal dict+=~/.vim/dict/scale.dict au FileType javascript setlocal dict+=~/.vim/dict/javascript.dict au FileType html setlocal dict+=~/.vim/dict/javascript.dict au FileType html setlocal dict+=~/.vim/dict/css.dict """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " markdown  轻量级标记语言
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=mkd "au BufRead,BufNewFile *.{go}   set filetype=go
"au BufRead,BufNewFile *.{js} set filetype=javascript "自动解析markdown为HTML  
"nmap md :!~/.vim/markdown.pl % > %.html <CR><CR> "nmap fi :!firefox %.html & <CR><CR>
"nmap \ \cc "vmap \ \cc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" New File Title """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 新建.c,.h,.sh,.java文件,自动插入文件头
autocmd BufNewFile *.cpp,*.[ch],*.sh,*.rb,*.java,*.py exec ":call SetTitle()"
" 定义函数SetTitle,自动插入文件头 func SetTitle() "如果文件类型为.sh文件
    if &filetype == 'sh'
        call setline(1,"\#!/bin/bash")
        call append(line("."), "")
    elseif &filetype == 'python'
        call setline(1,"#!/usr/bin/env python")
        call append(line("."),"# coding=utf-8")
        call append(line(".")+1, "")
    elseif &filetype == 'ruby'
        call setline(1,"#!/usr/bin/env ruby")
        call append(line("."),"# encoding: utf-8")
        call append(line(".")+1, "")
    else
        call setline(1, "/*************************************************************************")
        call append(line("."), " > File Name: ".expand("%"))
        call append(line(".")+1, " > Author: ")
        call append(line(".")+2, " > Mail: ")
        call append(line(".")+3, " > Created Time: ".strftime("%c"))
        call append(line(".")+4, " ************************************************************************/")
        call append(line(".")+5, "")
    endif
    if expand("%:e") == 'cpp'
        call append(line(".")+6, "#include<iostream>")
        call append(line(".")+7, "using namespace std;")
        call append(line(".")+8, "")
    endif
    if &filetype == 'c'
        call append(line(".")+6, "#include<stdio.h>")
        call append(line(".")+7, "")
    endif
    if expand("%:e") == 'h'
        call append(line(".")+6, "#ifndef _".toupper(expand("%:r"))."_H")
        call append(line(".")+7, "#define _".toupper(expand("%:r"))."_H")
        call append(line(".")+8, "#endif")
    endif
    if &filetype == 'java'
        call append(line(".")+6,"public class ".expand("%:r"))
        call append(line(".")+7,"")
    endif
endfunc
"新建文件后,自动定位到文件末尾 autocmd BufNewFile * normal G """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags (function 跳转工具) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Sort_Type = "name"    " 按照名称排序 let Tlist_Use_Right_Window = 1 " 在右侧显示窗口  
let Tlist_Compart_Format = 1    " 压缩方式 let Tlist_Exist_OnlyWindow = 1 " 如果只有一个buffer,kill窗口也kill掉buffer  
""let Tlist_File_Fold_Auto_Close = 0  " 不要关闭其他文件的tags ""let Tlist_Enable_Fold_Column = 0 " 不要显示折叠树  
"let Tlist_Show_One_File=1 "不同时显示多个文件的tag,只显示当前文件的
"设置tags set tags=tags; set autochdir """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " VIM Keyboard Commands
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"新建一个标签页 map <F2> <Esc>:tabnew<CR> " shift tab pages
map <F12> gg=G

:autocmd BufRead,BufNewFile *.dot map <F5> :w<CR>:!dot -Tjpg -o %<.jpg % && eog %<.jpg  <CR><CR> && exec "redr!"
"C,C++ 按F5编译运行 map <F5> :call CompileRunGcc()<CR> func! CompileRunGcc() exec "w" if &filetype == 'c' exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'cpp' exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'java' exec "!javac %" exec "!time java %<" elseif &filetype == 'sh' :!time bash % elseif &filetype == 'python' exec "!time python2.7 %" elseif &filetype == 'html' exec "!firefox % &" elseif &filetype == 'go' "        exec "!go build %<"
        exec "!time go run %"
    elseif &filetype == 'mkd'
        exec "!~/.vim/markdown.pl % > %.html &"
        exec "!firefox %.html &"
    endif
endfunc
"C,C++的调试 map <F8> :call Rungdb()<CR> func! Rungdb() exec "w" exec "!g++ % -g -o %<" exec "!gdb ./%<" endfunc "代码格式优化化

map <F6> :call FormartSrc()<CR><CR>

"定义FormartSrc() func FormartSrc() exec "w" if &filetype == 'c' exec "!astyle --style=ansi -a --suffix=none %" elseif &filetype == 'cpp' || &filetype == 'hpp' exec "r !astyle --style=ansi --one-line=keep-statements -a --suffix=none %> /dev/null 2>&1" elseif &filetype == 'perl' exec "!astyle --style=gnu --suffix=none %" elseif &filetype == 'py'||&filetype == 'python' exec "r !autopep8 -i --aggressive %" elseif &filetype == 'java' exec "!astyle --style=java --suffix=none %" elseif &filetype == 'jsp' exec "!astyle --style=gnu --suffix=none %" elseif &filetype == 'xml' exec "!astyle --style=gnu --suffix=none %" else exec "normal gg=G" return endif exec "e! %" endfunc "结束定义FormartSrc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"其他东东 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"python补全 let g:pydiction_location = '~/.vim/codeComplete/py-complete-dict' let g:pydiction_menu_height = 20 let Tlist_Ctags_Cmd='/usr/local/bin/ctags' let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplModSelTarget = 1 autocmd FileType python set omnifunc=pythoncomplete#Complete """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " VIM Vundle
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'gmarik/vundle' " My Bundles here:
" " original repos on github

" 窗口管理 Bundle 'winmanager' " 设置界面分割
let g:winManagerWindowLayout = "TagList|FileExplorer"
"设置winmanager的宽度,默认为25 let g:winManagerWidth = 30 "定义打开关闭winmanager快捷键为F8
nmap <silent> <F7> :WMToggle<cr>
"在进入vim时自动打开winmanager "let g:AutoOpenWinManager = 1

" taglist (函数列表) Bundle 'taglist.vim' "默认打开Taglist
let Tlist_Auto_Open=0
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的 let Tlist_File_Fold_Auto_Close = 1 let Tlist_WinWidt = 28 "设置taglist的宽度
let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vim "let Tlist_Use_Right_Window = 1 "在右侧窗口中显示taglist窗口 let Tlist_Use_Left_Window = 1 "在左侧窗口中显示taglist窗口
nmap tl :Tlist<cr>
:nmap <silent> <F9> <ESC>:Tlist<RETURN>

" nerdtree (文件列表) Bundle 'scrooloose/nerdtree' let NERDTreeWinPos='left' let NERDTreeWinSize=28 map <F3> :NERDTreeToggle<CR> imap <F3> <ESC> :NERDTreeToggle<CR> "打开树状文件目录
map <C-F3> \be

" miniBufExplorer (buffer控制) Bundle 'fholgado/minibufexpl.vim' let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplModSelTarget = 1 let g:miniBufExplMoreThanOne=0 "map <F10> :MBEbp<CR>
"map <F11> :MBEbn<CR> " airline (状态栏美化)
Bundle 'bling/vim-airline'

" C (C插件) Bundle 'c.vim' " Grep (vim的搜索工具)
Bundle 'grep.vim'

" MRU (打开最近打开的文件列表 :MRU) Bundle 'mru.vim' " Comments (代码注释,V模式 Ctrl+c:添加注销; Ctrl+x: 删除注释;)
Bundle 'comments.vim'

" Syntastic (静态语法检查) Bundle 'scrooloose/syntastic' let g:syntastic_check_on_open = 1 let g:syntastic_cpp_include_dirs = ['/usr/include/'] let g:syntastic_cpp_remove_include_errors = 1 let g:syntastic_cpp_check_header = 1 let g:syntastic_cpp_compiler = 'clang++' let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++' "set error or warning signs
let g:syntastic_error_symbol = 'XX'
let g:syntastic_warning_symbol = '!!'
"whether to show balloons let g:syntastic_enable_balloons = 1 " Sparkup (zendCoding 代码补全工具)
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}

" IndentLine (代码缩进线) Bundle 'Yggdroot/indentLine' "let g:indentLine_char = '┊'

" L9 (自动补全AutoComplPop的依赖库) Bundle 'L9' " FuzzyFinder (快速搜索,buffer,书签, 标签)
Bundle 'FuzzyFinder'

" AutoPairs (自动补全括号) Bundle 'Auto-Pairs' let g:AutoPairsLoaded = 1 if !exists('g:AutoPairs') let g:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", '"':'"', '`':'`'} endif " python-imports (python IDE)
Bundle 'python-imports.vim'

" CaptureClipboard (获取剪贴板) Bundle 'CaptureClipboard' " Ctrlp (快速找到项目中的文件)
Bundle 'ctrlp.vim'
Bundle 'tacahiroy/ctrlp-funky'
Bundle 'ctrlp-modified.vim'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.png,*.jpg,*.gif     " MacOSX/Linux set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe,*.pyc,*.png,*.jpg,*.gif " Windows
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = '\v\.(exe|so|dll)$'
let g:ctrlp_extensions = ['funky']
let NERDTreeIgnore=['\.pyc']

" 最后编辑标记, 下次打开文件在修改的位置 Bundle 'last_edit_marker.vim' Bundle 'synmark.vim' " SQL 补全工具
Bundle 'SQLComplete.vim'

"java Bundle 'Javascript-OmniCompletion-with-YUI-and-j' "css3语法高亮
Bundle 'hail2u/vim-css3-syntax'
Bundle 'rstacruz/vim-ultisnips-css'

"html5语法高亮 Bundle 'othree/html5.vim' "html xml自动闭合标签
Bundle 'docunext/closetag.vim'

"javascript Bundle "pangloss/vim-javascript" Bundle 'othree/yajs.vim' Bundle 'othree/javascript-libraries-syntax.vim' Bundle 'maksimr/vim-jsbeautify' Bundle 'Vim-Script-Updater' "颜色符号显示对应颜色
Bundle 'gorodinskiy/vim-coloresque'

"时光机 Bundle 'sjl/gundo.vim' nnoremap <F11> :GundoToggle<CR> "区域选中
Bundle 'terryma/vim-expand-region'
vmap v <Plug>(expand_region_expand)
vmap V <Plug>(expand_region_shrink)

"快速执行 Bundle 'thinca/vim-quickrun' let g:quickrun_config = { \ "_" : { \ "outputter" : "message", \ }, \} let g:quickrun_no_default_key_mappings = 1 nmap <Leader>r <Plug>(quickrun) map <F4> :QuickRun<CR> "行末空格高亮
Bundle 'bronson/vim-trailing-whitespace'
map <leader><space> :FixWhitespace<cr>

"多光标操作 Bundle 'terryma/vim-multiple-cursors' let g:multi_cursor_use_default_mapping=0 "Default mapping
let g:multi_cursor_next_key='<C-m>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'

"标签跳转 跳转到对应的标签 Bundle 'vim-scripts/matchit.zip' "Bundle 'The-NERD-Commenter'
"Bundle 'django_templates.vim' "Bundle 'DjangoProjectsm-scripts/matchit.zip'' "Bundle 'vim-scripts/AutoClose' "Bundle 'https://github.com/wincent/command-t.git' "ndle 'tpope/vim-rails.git' " vim-scripts repos" "Bundle 'Lokaltog/vim-powerline' "Bundle 'tpope/vim-fugitive' "Bundle 'Valloric/YouCompleteMe' " let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' " let g:ycm_collect_identifiers_from_tags_files = 1 " let g:ycm_seed_identifiers_with_syntax = 1 " let g:ycm_confirm_extra_conf = 0 "Bundle 'Python-mode-klen' "Bundle 'JavaScript-Indent' "Bundle 'jslint.vim' "Bundle 'Better-Javascript-Indentation' "Bundle 'FredKSchott/CoVim' "Bundle 'djangojump' " ... let g:html_indent_inctags = "html,body,head,tbody" let g:html_indent_script1 = "inc" let g:html_indent_style1 = "inc" " required! filetype plugin indent on 

你可能感兴趣的:(vim,编辑器)