|
|
(未显示同一用户的3个中间版本) |
第7行: |
第7行: |
| [[Image:Vim marks.PNG|vim marks]] | | [[Image:Vim marks.PNG|vim marks]] |
|
| |
|
| <br>
| |
|
| |
|
| " ---------<br>" remark<br>fun! Move_sign()
| |
|
| |
|
| let s:tempItem = ["","",""]<br> let vRLn = "".line(".")<br> let vRFileName = expand("%:p")
| | <br> |
| | |
| let s:tempItem[1] = vRLn<br> let s:tempItem[2] = vRFileName<br> "echo s:tempItem <br> let vRIndex = s:Check_list(s:tempItem)
| |
| | |
| if (s:remarkItem[0] ==# "REMARK" ) <br> if vRIndex > 0<br> silent! exe 'sign define CS' . s:mylist[vRIndex][0] . ' text='. s:mylist[vRIndex][0] .' texthl=Search'<br> silent! exe 'sign place ' . s:mylist[vRIndex][0] . ' line=' . vRLn . ' name=CS'. s:mylist[vRIndex][0] . ' file=' . vRFileName<br> let s:remarkItem = s:mylist[vRIndex]<br> let s:myIndex = vRIndex<br> "echo s:remarkItem<br> endif<br> else<br> let pionter = s:Check_list(s:remarkItem)<br> "echo vRIndex ."|" .pionter <br> if ((vRIndex < 0) && (pionter > 0)) <br> silent! exe 'sign unplace ' .s:remarkItem[0] . ' file=' . s:remarkItem[2]<br> "silent! exe 'sign undefine' .s:remarkItem[0]<br> "echo 'sign define CS' . s:remarkItem[0] . ' text='. s:remarkItem[0] .' texthl=ErrorMsg'<br> silent! exe 'sign define CS' . s:remarkItem[0] . ' text='. s:remarkItem[0] .' texthl=ErrorMsg'<br> "echo 'sign place ' . s:remarkItem[0] . ' line=' . s:remarkItem[1] . ' name=CS' . s:remarkItem[0] . ' file=' . s:remarkItem[2]<br> silent! exe 'sign place ' . s:remarkItem[0] . ' line=' . vRLn . ' name=CS' . s:remarkItem[0] . ' file=' . vRFileName<br> let s:mylist[pionter][1] = vRLn<br> let s:mylist[pionter][2] = vRFileName<br> "echo s:mylist[pionter]<br> let s:myIndex = pionter<br> let s:remarkItem = ["REMARK","SEARCH","FLAG"]<br> endif<br> endif<br>endfun<br>
| |
| | |
| --<br>
| |
| | |
| let outputStr = ""<br> let tmpList = ["",""]<br> let tabList = [tmpList]
| |
| | |
| set nomore<br> redir => outputStr <br> exec 'tabs'<br> redir END
| |
| | |
| let i = 1<br> while match(outputStr,'^*\n$', i) > -1<br> let tmpstr = matchstr(matchstr(outputStr,'^*\n$', i),'^ [1-9]*\n$')<br> if len(tmpstr) > 1
| |
| | |
| let i = i + 1<br> <br> endwhile
| |
| | |
| return 0<br>
| |
2008年4月14日 (一) 20:52的最新版本
喜欢使用ubuntu和vim,但是都不是很了解,都在慢慢学!
最近写的一个gvim的marks脚本。方便自己方便大家!
链接 http://www.vim.org/scripts/script.php?script_id=2194