用户讨论:Corey

来自Ubuntu中文
Corey留言 | 贡献2008年4月3日 (四) 15:55的版本
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

喜欢使用ubuntu和vim,但是都不是很了解,都在慢慢学!

最近写的一个gvim的marks脚本。方便自己方便大家!

链接 http://www.vim.org/scripts/script.php?script_id=2194

vim marks


" ---------
" remark
fun! Move_sign()

let s:tempItem = ["","",""]
let vRLn = "".line(".")
let vRFileName = expand("%:p")

let s:tempItem[1] = vRLn
let s:tempItem[2] = vRFileName
"echo s:tempItem
let vRIndex = s:Check_list(s:tempItem)

if (s:remarkItem[0] ==# "REMARK" )
if vRIndex > 0
silent! exe 'sign define CS' . s:mylist[vRIndex][0] . ' text='. s:mylist[vRIndex][0] .' texthl=Search'
silent! exe 'sign place ' . s:mylist[vRIndex][0] . ' line=' . vRLn . ' name=CS'. s:mylist[vRIndex][0] . ' file=' . vRFileName
let s:remarkItem = s:mylist[vRIndex]
let s:myIndex = vRIndex
"echo s:remarkItem
endif
else
let pionter = s:Check_list(s:remarkItem)
"echo vRIndex ."|" .pionter
if ((vRIndex < 0) && (pionter > 0))
silent! exe 'sign unplace ' .s:remarkItem[0] . ' file=' . s:remarkItem[2]
"silent! exe 'sign undefine' .s:remarkItem[0]
"echo 'sign define CS' . s:remarkItem[0] . ' text='. s:remarkItem[0] .' texthl=ErrorMsg'
silent! exe 'sign define CS' . s:remarkItem[0] . ' text='. s:remarkItem[0] .' texthl=ErrorMsg'
"echo 'sign place ' . s:remarkItem[0] . ' line=' . s:remarkItem[1] . ' name=CS' . s:remarkItem[0] . ' file=' . s:remarkItem[2]
silent! exe 'sign place ' . s:remarkItem[0] . ' line=' . vRLn . ' name=CS' . s:remarkItem[0] . ' file=' . vRFileName
let s:mylist[pionter][1] = vRLn
let s:mylist[pionter][2] = vRFileName
"echo s:mylist[pionter]
let s:myIndex = pionter
let s:remarkItem = ["REMARK","SEARCH","FLAG"]
endif
endif
endfun

--

let outputStr = ""
let tmpList = ["",""]
let tabList = [tmpList]

set nomore
redir => outputStr
exec 'tabs'
redir END

let i = 1
while match(outputStr,'^*\n$', i) > -1
let tmpstr = matchstr(matchstr(outputStr,'^*\n$', i),'^ [1-9]*\n$')
if len(tmpstr) > 1

let i = i + 1

endwhile

return 0