Last active
October 10, 2015 15:31
-
-
Save rbtnn/d8c868a8e78ae45e2a1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let s:save_cpo = &cpo | |
| set cpo&vim | |
| function! Matcher(path) | |
| let fromLinkTagList = [] | |
| let toLinkTagList = [] | |
| for line in readfile(a:path) | |
| call add(fromLinkTagList, matchstr(line,'|\zs\S\{-}\ze|')) | |
| call add(toLinkTagList, matchstr(line,'\*\zs\S\{-}\ze\*')) | |
| endfor | |
| let match_list = [] | |
| for char in toLinkTagList | |
| if index(fromLinkTagList, char) != -1 && !empty(char) | |
| call add(match_list, char) | |
| endif | |
| endfor | |
| return match_list | |
| endfunction | |
| function! PathGet() | |
| return split(globpath(&runtimepath, "doc/*.txt"),"\n") | |
| endfunction | |
| function! Report(notlink,filename) | |
| let ret = map(deepcopy(a:notlink), "{'filename':a:filename,'text':v:val}") | |
| call setqflist(ret) | |
| copen | |
| endfunction | |
| function! Main() | |
| let l:paths = PathGet() | |
| for path in l:paths | |
| let l:infomation = Matcher(path) | |
| if !empty(l:infomation) | |
| call Report(l:infomation, path) | |
| endif | |
| endfor | |
| endfunction | |
| call Main() | |
| let &cpo = s:save_cpo | |
| unlet s:save_cpo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment