From da709cd9e90c3ab644bb92700f0ed40d965b80d3 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Thu, 13 Oct 2011 11:17:19 +0600 Subject: Initial commit. --- files/.vim/ftplugin/rfc.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 files/.vim/ftplugin/rfc.vim (limited to 'files/.vim/ftplugin/rfc.vim') diff --git a/files/.vim/ftplugin/rfc.vim b/files/.vim/ftplugin/rfc.vim new file mode 100755 index 0000000..0a8bb13 --- /dev/null +++ b/files/.vim/ftplugin/rfc.vim @@ -0,0 +1,21 @@ +" Vim script file +" FileType: RFC +" Author: lilydjwg +" Last Change: 2010年1月16日 + +function! s:rfcTag() + " 从目录跳转到正文 + let syn = synIDattr(synID(line("."), col("."), 1), "name") + if syn == 'rfcContents' || syn == 'rfcDots' + let l = getline('.') + let l = matchstr(l, '\v[0-9.]+\s(\w|\s)\S') + let l = '^\V' . l + call search(l, 's') + else + echohl Error + echomsg '光标不位于目录项!' + echohl None + endif +endfunction + +nmap :call rfcTag() -- cgit v1.2.3