gvim写html代码时如何快速地跳转到一个标签的结束位置: 终极插件: matchit.vim

gvim写html代码时如何快速地跳转到一个标签的结束位置

参考这个vimrc的配置, 里面有一些 很好的东西, 配置很有用, 以前没有用到: http://www.cnblogs.com/wangj08/archive/2013/03/13/2957309.html
比如:

set showmatch " 插入括号时,短暂地跳转到匹配的对应括号
set matchtime=2 " 短暂跳转到匹配括号的时间
set magic " 设置魔术
set hidden " ??? 如果这个有用的话, 就不用在切换buffer的时候, 反复的写:w了. 允许在有未保存的修改时切换缓冲区,此时的修改由 vim 负责保存

set cmdheight=1 " 设定命令行的行数为 1

nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>   " 用空格键来开关折叠

如何在不退出 vim的情况下, 重新载入当前文件, 即当前文件在vim 外部被修改(如被gedit修改, 主要是为了 好粘贴)后, 如何在vim中生效? 使用命令: e /cur_filename, :e命令,是打开某个文件, 实际上, 这里是 重新去打开一次 "当前文件" , 然后把当前窗口重新 加载刷新一次!


"-----------------------------------------------------------------  
" plugin – checksyntax.vim    JavaScript常见语法错误检查  
" 默认快捷方式为 F5  
"-----------------------------------------------------------------  
let g:checksyntax_auto = 0 " 不自动检查  

"-----------------------------------------------------------------  
" plugin - matchit.vim   对%命令进行扩展使得能在嵌套标签和语句之间跳转  
" % 正向匹配      g% 反向匹配  
" [% 定位块首     ]% 定位块尾  
"--------------------------

Vundle分为三类:
在Github vim-scripts 用户下的repos,只需要写出repos名称
在Github其他用户下的repos, 需要写出"用户名/repos名"
不在Github上的插件,需要写出git全路径

在vim中支持鼠标显示: set mouse=v 但是这样设置后 好像有问题??

Two other motions, [% and ]%, go to the start and end of the current block, respectively(分别的, 对应的...).

vim中的插件的网址在哪里?

  1. github上的vim-scripts目录下的插件: https://github.com/vim-scripts/...
  2. github上,非vim-scripts下的插件: http://www.vim.org/scripts/...
  3. vim-script的https地址是: https://vim.sourceforge.io/

vim中安装html标签匹配的插件: (关于match匹配的插件很多, 这里主要是安装 MatchTagAlways.vim, matchit.vim这两个插件就好了)

MatchTagAlways, 这个插件,的名字是 首字母全部大写;
他的效果, 类似于 notepad++ 中的标签对应高亮. 安装过程是:

用vundle安装
1 . 先在vimrc中配置路径:
Plugin 'Valloric/MatchTagAlways'
2 . 打开vim执行:
:PluginInstall

关于matchit的使用

  1. matchit.zip : extended % matching for HTML, LaTeX, and many other languages
  2. 名字叫 matchit
  3. 普通安装下载插件包的时候, 下载插件包的名字, 叫 matchit.zip.
  4. 如果在vim中的 vundle安装, 它的插件名称是: thisivan/vim-matchit, 用户名是: thisivan, this-ivan, 在matchit前面加上vim-

821299-20170308162702719-1055414116.png

821299-20170308163512000-997496578.png

821299-20170308162715750-184371093.png

thisivan/vim-matchit的用法:

  1. 使用的符号是%
  2. 如果光标定位在 括号 符号上, 如 (, [, { 等符号, 则会跳转到相对应的 括号上;
  3. 如果要在 标签之间 跳转, 如<div>.............</div> 两个div之间 跳转, 则要将 光标定位在 标签的内部. 如,字符 d, i, v上. 就可以了.
  4. 是在 normal模式下, 单击% 进行 跳转的.

===========================================

vim中的doc 文档的格式基本上都是这样的:

  1. 首先是整个plugin的介绍, 和 一个目录
  2. 目录下的 列表项 其实 都是一些 文档内部的链接 anchor, 你可以单击/双击 这些列表项, 来跳转到相对应的 文档节
  3. 然后, 整个说明doc 其实都是 由多个 文档sections 组成的.

821299-20170308170337906-33366506.png
821299-20170308170343859-1367965905.png

821299-20170308170439547-719083027.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
gvim常用插件及其配置文件 支持c,perl,python,latex。 需要自己安装ctags .vim: after compiler doc indent ltags perl-support skeleton syntax autoload c-support ftdetect keymap Makefile plugin snipMate.vim.ct tools colors CVIMSYN ftplugin latextags Makefile.in README.csupport snippets .vim/after: ftplugin plugin syntax .vim/after/ftplugin: c_snippets.vim java_snippets.vim python_pydiction.vim python_snippets.vim sh_snippets.vim .vim/after/plugin: .vim/after/syntax: cpp.vim c.vim java.vim .vim/autoload: acp.vim perlsupportgui.vim perlsupportprofiling.vim perlsupportregex.vim snipMate.vim .vim/colors: desertEx.vim peachpuff.vim zenburn.vim .vim/compiler: tex.vim .vim/c-support: codesnippets doc rc scripts templates wordlists .vim/c-support/codesnippets: calloc_double_matrix.c main.cc print_array.cc.noindent calloc_int_matrix.c Makefile print_double_array.c.noindent main.c Makefile.multi-target.template print_int_array.c.noindent .vim/c-support/doc: ChangeLog c-hotkeys.pdf c-hotkeys.tex .vim/c-support/rc: customization.ctags customization.gvimrc customization.indent.pro customization.vimrc .vim/c-support/scripts: wrapper.sh .vim/c-support/templates: c.comments.template cpp.comments.template cpp.preprocessor.template c.statements.template c.cpp.template cpp.cpp.template cpp.statements.template Templates c.idioms.template cpp.idioms.template c.preprocessor.template Templates~ .vim/c-support/wordlists: c-c++-keywords.list c-c++-keywords.list.bak k+r.list stl_index.list .vim/CVIMSYN: engspchk.contraction engspchk.dialect engspchk.dict engspchk.match engspchk.proper engspchk.rare .vim/doc: acp.jax latexhelp.txt latex-suite-quickstart.css Makefile taglist.txt acp.txt latex-suite latex-suite-quickstart.html Makefile.in tags catalog.xml la
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值