Learn More
Please note that GitHub no longer supports Internet Explorer versions 7 or 8.

We recommend upgrading to Internet Explorer 9, Google Chrome, or Firefox.

Browse code

Removed alc source.

By reason of copyright.
commit c4d9df121e48eea1bf6c6b06d48faebd7afb9f9e 1 parent 91fb1b2d81
authored
107  autoload/ref/alc.vim
... ...
@@ -1,107 +0,0 @@
1  
-" A ref source for alc.
2  
-" Version: 0.2.1
3  
-" Author : soh335 <sugarbabe335@gmail.com>
4  
-"        : thinca <thinca+vim@gmail.com>
5  
-" License: Creative Commons Attribution 2.1 Japan License
6  
-"          <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
7  
-
8  
-let s:save_cpo = &cpo
9  
-set cpo&vim
10  
-
11  
-" options. {{{1
12  
-if !exists('g:ref_alc_start_linenumber')  " {{{2
13  
-  let g:ref_alc_start_linenumber = 33
14  
-endif
15  
-
16  
-if !exists('g:ref_alc_cmd')  " {{{2
17  
-  let g:ref_alc_cmd =
18  
-  \ executable('elinks') ? 'elinks -dump -no-numbering -no-references %s' :
19  
-  \ executable('w3m')    ? 'w3m -dump %s' :
20  
-  \ executable('links')  ? 'links -dump %s' :
21  
-  \ executable('lynx')   ? 'lynx -dump -nonumbers %s' :
22  
-  \ len(globpath(&rtp, 'autoload/wwwrenderer.vim')) > 0
23  
-  \   ? ':wwwrenderer#render("%s")' :
24  
-  \ ''
25  
-endif
26  
-
27  
-if !exists('g:ref_alc_encoding')  " {{{2
28  
-  let g:ref_alc_encoding = &termencoding
29  
-endif
30  
-
31  
-if !exists('g:ref_alc_use_cache')  " {{{2
32  
-  let g:ref_alc_use_cache = 0
33  
-endif
34  
-
35  
-
36  
-
37  
-let s:source = {'name': 'alc'}  " {{{1
38  
-
39  
-function! s:source.available()
40  
-  return !empty(g:ref_alc_cmd)
41  
-endfunction
42  
-
43  
-function! s:source.get_body(query)
44  
-  if type(g:ref_alc_cmd) == type('')
45  
-    let cmd = split(g:ref_alc_cmd, '\s\+')
46  
-  elseif type(g:ref_alc_cmd) == type([])
47  
-    let cmd = copy(g:ref_alc_cmd)
48  
-  else
49  
-    return ''
50  
-  endif
51  
-
52  
-  let org = s:iconv(a:query, &encoding, 'utf-8')
53  
-  let str = ''
54  
-  for i in range(strlen(org))
55  
-    let c = org[i]
56  
-    let str .= c =~ '\w' ? c : printf('%%%02X', char2nr(c))
57  
-  endfor
58  
-
59  
-  let url = 'http://eow.alc.co.jp/' . str . '/UTF-8/'
60  
-  call map(cmd, 'substitute(v:val, "%s", url, "g")')
61  
-  if len(cmd) > 0 && cmd[0] =~ '^:'
62  
-    return eval(join(cmd, ' ')[1:])
63  
-  elseif g:ref_alc_use_cache
64  
-    let expr = 'ref#system(' . string(cmd) . ').stdout'
65  
-    let res = join(ref#cache('alc', a:query, expr), "\n")
66  
-  else
67  
-    let res = ref#system(cmd).stdout
68  
-  endif
69  
-  return s:iconv(res, g:ref_alc_encoding, &encoding)
70  
-endfunction
71  
-
72  
-function! s:source.opened(query)
73  
-  execute "normal! ".g:ref_alc_start_linenumber."z\<CR>"
74  
-  call s:syntax(a:query)
75  
-endfunction
76  
-
77  
-function! s:source.normalize(query)
78  
-  return substitute(substitute(a:query, '\_s\+', ' ', 'g'), '^ \| $', '', 'g')
79  
-endfunction
80  
-
81  
-
82  
-" misc. {{{1
83  
-function! s:syntax(query)
84  
-  syntax clear
85  
-  let str = escape(substitute(a:query, '\s\+', '\\_s\\+', 'g'), '"')
86  
-  if str =~# '^[[:print:][:space:]]\+$'
87  
-    let str = '\<' . str . '\>'
88  
-  endif
89  
-  execute 'syntax match refAlcKeyword "\c'.str.'"'
90  
-  highlight default link refAlcKeyword Special
91  
-endfunction
92  
-
93  
-" iconv() wrapper for safety.
94  
-function! s:iconv(expr, from, to)
95  
-  if a:from == '' || a:to == '' || a:from ==# a:to
96  
-    return a:expr
97  
-  endif
98  
-  let result = iconv(a:expr, a:from, a:to)
99  
-  return result != '' ? result : a:expr
100  
-endfunction
101  
-
102  
-function! ref#alc#define()
103  
-  return s:source
104  
-endfunction
105  
-
106  
-let &cpo = s:save_cpo
107  
-unlet s:save_cpo
92  doc/ref-alc.jax
... ...
@@ -1,92 +0,0 @@
1  
-*ref-alc.txt*  alc 用の ref ソース。
2  
-
3  
-Version: 0.2.1
4  
-Author : soh335 <sugarbabe335@gmail.com>
5  
-       : thinca <thinca+vim@gmail.com>
6  
-License: クリエイティブ・コモンズの表示 2.1 日本ライセンス
7  
-         <http://creativecommons.org/licenses/by/2.1/jp/>
8  
-
9  
-==============================================================================
10  
-目次            *ref-alc-contents*
11  
-
12  
-概要        |ref-alc-introduction|
13  
-カスタマイズ      |ref-alc-customizing|
14  
-更新履歴      |ref-alc-changelog|
15  
-
16  
-
17  
-==============================================================================
18  
-概要            *ref-alc-introduction*
19  
-
20  
-*ref-alc* は 株式会社スペースアルク社が提供する英辞郎 on the WEB (*) を利用する
21  
-ための |ref| ソースです。
22  
-
23  
-(*) http://www.alc.co.jp/
24  
-
25  
-要件:
26  
-- |ref| 0.3.2 以降
27  
-- 任意のテキストブラウザ
28  
-  - elinks
29  
-  - w3m
30  
-  - links
31  
-  - lynx
32  
-
33  
-
34  
-
35  
-==============================================================================
36  
-カスタマイズ          *ref-alc-customizing*
37  
-
38  
-g:ref_alc_cmd          *g:ref_alc_cmd*
39  
-      英辞郎 on the WEB を表示するためのコマンドです。%s は
40  
-      単語を引くための url に置き換えられます。コマンドとそ
41  
-      の引数を含む |List| も指定できます。
42  
-      デフォルト値は以下の物でコマンドが実行可能なものです。
43  
-      - 'elinks -dump -no-numbering -no-references %s'
44  
-      - 'w3m -dump %s'
45  
-      - 'links -dump %s'
46  
-      - 'lynx -dump -nonumbers %s'
47  
-
48  
-g:ref_alc_start_linenumber      *g:ref_alc_start_linenumber*
49  
-      英辞郎 on the WEB を使い単語を引いた後、画面表示を開始
50  
-      する行数です。
51  
-      デフォルト値は 33 になっています。
52  
-
53  
-g:ref_alc_encoding        *g:ref_alc_encoding*
54  
-      |g:ref_alc_cmd| で指定したコマンドの出力のエンコードを
55  
-      指定します。この変数が空の場合、出力は変換されません。
56  
-      デフォルト値は 'termencoding' です。
57  
-
58  
-g:ref_alc_use_cache        *g:ref_alc_use_cache*
59  
-      一度開いたページをキャッシュします。
60  
-      デフォルト値は 0 です。
61  
-
62  
-
63  
-
64  
-==============================================================================
65  
-更新履歴          *ref-alc-changelog*
66  
-
67  
-0.2.1  2010-05-07
68  
-  - |ref| 0.3.2 に対応。
69  
-
70  
-0.2.0  2010-04-12
71  
-  - |ref| 0.3.0 に対応。
72  
-  - |g:ref_alc_cmd| が機能していなかったバグを修正。
73  
-  - |g:ref_alc_use_cache| オプションを追加。
74  
-
75  
-0.1.1  2010-03-01
76  
-  - |g:ref_alc_encoding| を追加。
77  
-  - |g:ref_alc_cmd| が |List| だった場合動作しないバグを修正。
78  
-  - キーワードに " が含まれているとエラーが出るバグを修正。
79  
-
80  
-0.1.0  2010-02-28
81  
-  - |g:ref_alc_cmd| に |List| を指定できるようにした。
82  
-  - URL エンコードを行うように変更。
83  
-  - 複数の単語で検索した場合でも個々の単語をハイライトしないように変更。
84  
-
85  
-0.0.2  2010-01-28
86  
-  - バグ修正。
87  
-
88  
-0.0.1  2010-01-23
89  
-  - 初版。
90  
-
91  
-==============================================================================
92  
-vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl

0 notes on commit c4d9df1

Please sign in to comment.

Markdown Cheat Sheet

Format Text

Headers

# This is an <h1> tag
## This is an <h2> tag
###### This is an <h6> tag

Text styles

*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__

*You **can** combine them*

Lists

Unordered

* Item 1
* Item 2
  * Item 2a
  * Item 2b

Ordered

1. Item 1
2. Item 2
3. Item 3
   * Item 3a
   * Item 3b

Miscellaneous

Images

![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)

Links

http://github.com - automatic!
[GitHub](http://github.com)

Blockquotes

As Kanye West said:

> We're living the future so
> the present is our past.

Code Examples in Markdown

Syntax highlighting with GFM

```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```

Or, indent your code 4 spaces

Here is a Python code example
without syntax highlighting:

    def foo:
      if not bar:
        return true

Inline code for comments

I think you should use an
`<addr>` element here instead.
Something went wrong with that request. Please try again.

Looking for the GitHub logo?