Guest

_pentadactylrc

By: pchu on Jul 11th, 2011  |  syntax: None  |  size: 6.99 KB  |  hits: 394  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. "1.0b6 (created: 2011/03/09 09:25:18)
  2. loadplugins '\.(js|penta)$'
  3. group user
  4. set guioptions=bCrsT
  5.  
  6. " vim: set ft=pentadactyl:
  7.  
  8. "在配置文件内除了注释不能使用半角双引号
  9. "首先要把危险和影响使用的keymapping拿掉
  10. map A <Nop>
  11. map <C-q> <Nop>
  12. map <C-o> <Nop>
  13. map <C-i> <Nop>
  14. map <C-p> <Nop>
  15. map ZQ <Nop>
  16. map ZZ <Nop>
  17.  
  18. " 然后按照个人习惯增加mapping
  19. map -m n -builtin j 2j
  20. map -m n -builtin k 2k
  21. noremap J <C-d>
  22. noremap K <C-u>
  23. map -m n h gT
  24. map -m n l -builtin <C-n>
  25. map -m n w gT
  26. map -m n e -builtin <C-n>
  27. " 跳到第<n>个tab请使用<n>b
  28. " visual mode下的-builtin <C-n>是新窗口,而hl应用于移动
  29. noremap H h
  30. noremap L l
  31. map < <C-6>
  32. noremap > g$
  33. noremap , <C-o>
  34. noremap . <C-i>
  35. map U :ju<CR>
  36. map <C-.> :tabm<CR>
  37. noremap s <C-c>
  38. noremap S gf
  39. noremap <C-n> gb
  40. noremap <C-N> gB
  41. noremap \" gn
  42. noremap = +
  43.  
  44. " c-a, c-c, c-x, c-v的问题
  45. " older solutions
  46. "noremap <C-c> <C-v><C-c>
  47. "noremap <C-a> <C-v><C-a>
  48. "cnoremap <C-c> <C-v><C-c>
  49. "cnoremap <C-v> <C-v><C-v>
  50. "cnoremap <C-x> <C-v><C-x>
  51. "inoremap <C-a> <C-v><C-a>
  52. "inoremap <C-c> <C-v><C-c>
  53. "inoremap <C-v> <C-v><C-v>
  54. "inoremap <C-x> <C-v><C-x>
  55. "inoremap <C-z> <C-v><C-z>
  56. "inoremap <C-y> <C-v><C-y>
  57. "noremap <C-y> <C-v><C-y>
  58. " also use <S-Insert> to paste
  59. " pass keys
  60. map -m n,v,i,c <C-a> <Pass>
  61. map -m n,v,i,c <C-c> <Pass>
  62. map -m n,v,i,c <C-v> <Pass>
  63. map -m n,v,i,c <C-x> <Pass>
  64. map -m n,v,i,c <C-z> <Pass>
  65. map -m n,v,i,c <C-y> <Pass>
  66. map -m n,v,i,c <C-k> <Pass>
  67. map -m n,v,i,c <C-t> <Pass>
  68. " bookmark
  69. noremap <C-b> <C-v><C-b>
  70.  
  71. cnoremap <S-Return> <End>.org<Home><C-Right>www.<CR>
  72. cnoremap <C-Return> <End>.com<Home><C-Right>www.<CR>
  73. map -m n,v,i,c,t <S-BS> -builtin <C-z>
  74. map -m n,v,i,c,t <S-Del> -builtin <A-b>
  75. map O i0v$yv<Esc>P
  76. map <leader>s :source ~\\_pentadactylrc<CR>
  77. cabbrev : !
  78.  
  79. " courtesy of wanpeng.xxpp.ca
  80. " map t -js content.getSelection().toString()!=""?dactyl.execute(":tabopen "+ content.getSelection()):CommandExMode().open("tabopen ")
  81. " my modified version:
  82. map t -js str=util.domToString(buffer.focusedFrame.getSelection()); str!=""?dactyl.open(str, {where: dactyl.NEW_TAB}):CommandExMode().open("tabopen ")
  83. map o -js str=util.domToString(buffer.focusedFrame.getSelection()); str!=""?dactyl.open(str, {where: dactyl.CURRENT_TAB}):CommandExMode().open("open ")
  84.  
  85.  
  86. "<leader><price>
  87.  
  88. map <leader>iask :exe ":tabopen http://v.iask.com/v_play.php?vid="+util.domToString(buffer.focusedFrame.getSelection())<CR>
  89. map <leader>115 -js str=util.domToString(buffer.focusedFrame.getSelection()); str!=""?dactyl.execute(":tabopen http://u.115.com/file/"+ str):CommandExMode().open("tabopen http://u.115.com/file/")
  90. map <leader>bili -js str=util.domToString(buffer.focusedFrame.getSelection()); videoid=str.substr(0,2).toLowerCase()=="av"?str:"av".concat(str); dactyl.execute(":tabopen http://www.bilibili.tv/video/"+videoid)
  91. map <leader>v -js str=util.domToString(buffer.focusedFrame.getSelection()).toLowerCase(); str.substr(0,2)=="av"?dactyl.execute(":tabopen www.bilibili.tv/video/"+str):str.substr(0,2)=="ac"?dactyl.execute(":tabopen www.acfun.tv/v/"+str):str.substr(0,2)=="sm"?dactyl.execute(":tabopen www.nicovideo.jp/watch/"+str):str.substr(0,6)=="mylist"?dactyl.execute(":tabopen www.bilibili.tv/"+str):dactyl.execute(":tabopen www.bilibili.tv/video/av"+str)
  92. map <leader>pp :exe ":tabopen http://www.pixiv.net/member_illust.php?mode=medium&illust_id="+util.domToString(buffer.focusedFrame.getSelection())<CR>
  93. map <leader>pg :exe ":tabopen http://gelbooru.com/index.php?page=post&s=view&id="+util.domToString(buffer.focusedFrame.getSelection())<CR>
  94. map <leader>ie :js io.run("c:\\program files (x86)\\internet explorer\\iexplore.exe", [buffer.URL])<CR>
  95.  
  96. autocmd DownloadPost .* -js patt=/^C:\\Users\\Chao\\Documents\\.+(mp3|wma)$/i; if (patt.test(file)) { result=io.system("move /-Y "+file+" c:\\users\\chao\\music\\"+file.substr(24)); if (result.returnValue != 0) dactyl.echo("error while moving "+file) }
  97.  
  98. set passkeys+=mail.google.com:jk/<CR>,gi
  99. set titlestring=Mozilla\ Firefox
  100. set complete=lfbs
  101. set autocomplete=!.
  102.  
  103. " Finally, flavors like JavaScript, Ruby and Tcl do not support lookbehind at all, even though they do support lookahead.
  104. " 所以(?<!^) +http://和(?=[^^ ]) +http://行不通
  105. "set urlseparator=' {5,}\S+|\n+(?!$)(?!\s)|(\s\S*|^\S+)http://'
  106. "set urlseparator='\s((?!http://)[\s\S])*http://|((?!http://)\S)+http://|\s{5,}((?!http://)\S)+((?!http://)[\s\S])*$|(\s((?!http://)\S)+((?!http://)[\s\S])*\n|\n((?!http://)[\s\S])*((?!http://)\S)+)((?!http://)[\s\S])*$'
  107. set urlseparator='\s((?!http://)[\s\S])*(?=(https?|ftp)://)|(((?!http://)\S)*[^u\s]rce:|((?!http://)\S)*[^r\s]ce:|((?!http://)\S)*[^c\s]e:|((?!http://)\S)*[^e\s]:|((?!http://)\S)*[^:\s])(?=(https?|ftp)://)|\s{5,}((?!http://)\S)+((?!http://)[\s\S])*$|(\s((?!http://)\S)+((?!http://)[\s\S])*\n|\n((?!http://)[\s\S])*((?!http://)\S)+)((?!http://)[\s\S])*$'
  108.  
  109. "(((?!http://)\S)*[^u\s]rce:
  110. "|((?!http://)\S)*[^r\s]ce:
  111. "|((?!http://)\S)*[^c\s]e:
  112. "|((?!http://)\S)*[^e\s]:
  113. "|((?!http://)\S)*[^:\s]
  114. ")http://
  115.  
  116. "set hintmatching=contains,transliterated
  117.  
  118. set editor='C:\\Progra~2\\Notepa~1\\notepad++.exe -multiInst -nosession'
  119. "set editor='C:\\Program\ Files\ (x86)\\Notepad++\\notepad++.exe -multiInst -nosession'
  120.  
  121. "tab-options.js config
  122. "set tabclose=right,previous,opener,left
  123. "default value
  124. "set tabopen=link:right,orphan:groupright,external:end
  125.  
  126. " 齐全的next和previous……需要注意我在 \bnext\b 前加了一个 ^\bnext\b ,因为比如在SciAm网站,经常match到右上角的“What's next”栏目,而不是文章下方的next链接。先match前缀可以解决这个问题。又,suivant和précédent是法语
  127. set nextpattern='(下|后)一?(页|頁|篇|章|张)|次のページ|次へ','^\bnext\b','\bnext\b','\bsuivant\b','^(>|›)$','^(>>|»)$','^(>|»)','(>|»)$','\bmore\b'
  128. set previouspattern='(上|前)一?(页|頁|篇|章|张)|前のページ|前へ','^\bprev|previous\b','\bprev|previous\b','\bprécédent\b','^(<|‹)$','^(<<|«)$','^(<|«)','(<|«)$'
  129. " spaces are not permitted in stringlist
  130.  
  131. group google -loc www.google.com
  132. map -m i <Up> <Pass>
  133. map -m i <Down> <Pass>
  134.  
  135. "Look up the word you selected in dict.cn在dict.cn中查找所选词的英语
  136. "command! dict -nargs=* tabopen http://dict.cn/<args>
  137. "http://xbeta.info/vimperator.htm
  138.  
  139. " deprecated bash scripts
  140. " 装了dictd后,用F12轻松查单词,grep是用来去除空行的。<F12>查光标焦点所在的单词,<S-F12>查选中的单词
  141. "map <F12> ibvey<Esc><Esc>:!dict <C-v>|grep -v ^$<CR>
  142. "map <S-F12> Y:!dict <C-v>|grep -v ^$<CR>
  143. " 以下两个没有成功,原因估计是:frcn是 ~/bin 里的脚本,vimperator没读到;vimperator传中文字符“朗道英汉字典”时出问题
  144. " map <C-F12> Y:!frcn <C-v>|grep -v ^$<CR>
  145. " map <M-F12> Y:!sdcv -u "朗道英汉字典5.0" <C-v>|fgrep *[<CR>
  146.  
  147. "控制流量
  148. command noimg set! permissions.default.image=2
  149. command ysimg set! permissions.default.image=1
  150. command nojs set! javascript.enabled=false
  151. command ysjs set! javascript.enabled=true
  152.  
  153. cd C:\Users\Chao\Documents