Show
Ignore:
Timestamp:
05/25/09 12:19:19 (4 years ago)
Author:
from_kyushu
Message:

update metarw

Location:
dotfiles/vim/from_kyushu/.vim
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • dotfiles/vim/from_kyushu/.vim/autoload/metarw.vim

    r19257 r33548  
    11" metarw - a framework to read/write a fake:path 
    2 " Version: 0.0.3 
    3 " Copyright (C) 2008 kana <http://whileimautomaton.net/> 
     2" Version: 0.0.4 
     3" Copyright (C) 2008-2009 kana <http://whileimautomaton.net/> 
    44" License: MIT license  {{{ 
    55"     Permission is hereby granted, free of charge, to any person obtaining 
     
    298298  \                               a:event_name ==# 'FileAppendCmd') 
    299299  if _[0] ==# 'write' 
     300    let v:errmsg = '' 
    300301    execute a:line1 ',' a:line2 'write' v:cmdarg _[1] 
    301302    if v:shell_error != 0 
    302       let _ = ['error', 'Failed to write: ' . string(a:fakepath)] 
     303      let _ = ['error', 'Failed to :write !{cmd}'] 
     304    endif 
     305    if v:errmsg != '' 
     306      let _ = ['error', 'Failed to write: ' . v:errmsg] 
     307    endif 
     308 
     309    if _[0] != 'error' && 3 <= len(_) 
     310      execute _[2] 
    303311    endif 
    304312  endif 
  • dotfiles/vim/from_kyushu/.vim/doc/metarw.txt

    r19257 r33548  
    11*metarw.txt*    a framework to read/write a fake:path 
    22 
    3 Version 0.0.3 
    4 Copyright (C) 2008 kana <http://whileimautomaton.net/> 
     3Version 0.0.4 
     4Script ID: 2335 
     5Copyright (C) 2008-2009 kana <http://whileimautomaton.net/> 
    56License: MIT license  {{{ 
    67    Permission is hereby granted, free of charge, to any person obtaining 
     
    5455Optionals: 
    5556- |metarw-scheme-script| such as |metarw-git| (vimscript#2336) 
    56 - |ku| (vimscript#2337) and |ku-source-metarw| (vimscript#2344) 
     57- |ku| (vimscript#2337) and |ku-metarw| (vimscript#2344) 
     58 
     59Demo: 
     60- http://www.screencast.com/t/fCc8cFaiQj 
     61 
     62Latest version: 
     63http://github.com/kana/config/commits/vim-metarw 
     64 
     65Document in HTML format: 
     66http://kana.github.com/config/vim/metarw.html 
    5767 
    5868 
     
    181191 
    182192                        This function must return a list with two items.  The 
    183                         first item indicates the type of the second value: 
    184  
    185                         1st value       2nd value ~ 
    186                         ---------       --------- ~ 
    187                         "error"         a string which represents an error 
     193                        first item indicates the type of a return value, and 
     194                        the second item is an additional information for the 
     195                        return value.  The meanings of return values are as 
     196                        follows: 
     197 
     198                        First item      Second item ~ 
     199                        ----------      ---------------------------------- ~ 
     200                                                *metarw#{scheme}#read()-error* 
     201                        "error"         A string which represents an error 
    188202                                        message. 
    189                         "read"          a string which will be given to 
     203                                                *metarw#{scheme}#read()-read* 
     204                        "read"          A string which will be given to 
    190205                                        |:read| to read the content of 
    191206                                        {fakepath}. 
    192                         "browse"        a list to set up 
     207                                               *metarw#{scheme}#read()-browse* 
     208                        "browse"        A list to set up 
    193209                                        |metarw-content-browser|. 
    194210 
     
    217233                        true, does appending instead of writing. 
    218234 
    219                         This function must return a list with two items like 
    220                         |metarw#{scheme}#read()|, but the meaning of values is 
    221                         as follows: 
    222  
    223                         1st value       2nd value ~ 
    224                         ---------       --------- ~ 
    225                         "error"         a string which represents an error 
    226                                         message. 
    227                         "write"         a string which will be given to 
    228                                         |:write| to write the content of 
    229                                         {fakepath}. 
    230                         "done"          ignored.  This 1st value means that 
    231                                         writing is already done by 
    232                                         |metarw#{scheme}#write()|. 
     235                        This function must return a list with one or more 
     236                        items like |metarw#{scheme}#read()|, but the meanings 
     237                        of return values are as follows: 
     238 
     239                        First item      Rest items ~ 
     240                        ----------      ----------------------------------- ~ 
     241                                               *metarw#{scheme}#write()-error* 
     242                        "error"         The second item must be a string which 
     243                                        represents an error message. 
     244                                               *metarw#{scheme}#write()-write* 
     245                        "write"         The second item must be a string which 
     246                                        will be given to |:write| to write the 
     247                                        content of {fakepath}. 
     248 
     249                                        The third item is optional; if it is 
     250                                        given, it must be a string which is 
     251                                        a Vim script and it will be 
     252                                        |:execute|d after writing. 
     253                                                *metarw#{scheme}#write()-done* 
     254                        "done"          The rest items are just ignored.  This 
     255                                        type means that writing is already 
     256                                        done by |metarw#{scheme}#write()|. 
    233257 
    234258                        Don't reset 'modified' in this function.  It will be 
     
    274298CHANGELOG                                       *metarw-changelog* 
    275299 
    276 0.0.3   2008-08-30T03:11:55+09:00 
     3000.0.4   2009-05-23T14:51:43+09:00               *metarw-changelog-0.0.4* 
     301        - Refine the document. 
     302        - |metarw#{scheme}#write()|: 
     303          - Fix a bug that some kind of errors are not handled properly. 
     304          - Add a way to execute a script after writing.  See 
     305            |metarw#{scheme}#write()-write| for the details. 
     306 
     3070.0.3   2008-08-30T03:11:55+09:00               *metarw-changelog-0.0.3* 
    277308        - |metarw#{scheme}#write()|: 
    278309          - Fix wrong implementation. 
    279310          - Add new type of return value "done". 
    280311 
    281 0.0.2   2008-08-10T23:43:48+09:00 
    282         - Separate |ku-source-metarw| as a independent package. 
    283  
    284 0.0.1   2008-08-10T12:19:52+09:00 
     3120.0.2   2008-08-10T23:43:48+09:00               *metarw-changelog-0.0.2* 
     313        - Separate |ku-metarw| as a independent package. 
     314 
     3150.0.1   2008-08-10T12:19:52+09:00               *metarw-changelog-0.0.1* 
    285316        - Add a special source of ku (see |metarw-schemes-as-ku-sources|). 
    286317        - Fix autocommands not to hook fakepaths with any schene name which 
     
    293324          Vim 7.1.299.  (thanks to id:thinca) 
    294325 
    295 0.0.0   2008-07-11T16:51:59+09:00 
     3260.0.0   2008-07-11T16:51:59+09:00               *metarw-changelog-0.0.0* 
    296327        - Initial version. 
    297328 
     
    300331 
    301332============================================================================== 
    302 vim:tw=78:ts=8:ft=help:norl:fdm=marker: 
     333vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker: 
  • dotfiles/vim/from_kyushu/.vim/plugin/metarw.vim

    r19257 r33548  
    11" metarw - a framework to read/write a fake:path 
    2 " Version: 0.0.3 
    3 " Copyright (C) 2008 kana <http://whileimautomaton.net/> 
     2" Version: 0.0.4 
     3" Copyright (C) 2008-2009 kana <http://whileimautomaton.net/> 
    44" License: MIT license  {{{ 
    55"     Permission is hereby granted, free of charge, to any person obtaining 
  • dotfiles/vim/from_kyushu/.vim/syntax/metarw.vim

    r19257 r33548  
    11" Vim syntax: metarw - for content browser of metarw 
    2 " Version: 0.0.3 
    3 " Copyright (C) 2008 kana <http://whileimautomaton.net/> 
     2" Version: 0.0.4 
     3" Copyright (C) 2008-2009 kana <http://whileimautomaton.net/> 
    44" License: MIT license  {{{ 
    55"     Permission is hereby granted, free of charge, to any person obtaining