aboutsummaryrefslogtreecommitdiff
path: root/files/.vim/ftplugin/rfc.vim
diff options
context:
space:
mode:
Diffstat (limited to 'files/.vim/ftplugin/rfc.vim')
-rwxr-xr-xfiles/.vim/ftplugin/rfc.vim21
1 files changed, 21 insertions, 0 deletions
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 <lilydjwg@gmail.com>
+" 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 <buffer> <silent> <C-]> :call <SID>rfcTag()<CR>