diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..785dc102 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Amir Salihefendic + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4d78188f..41e9fc19 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ There are two versions: * **Basic**: If you want something small just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) into your ~/.vimrc and you will have a great basic setup * **Awesome**: This includes a ton of useful plugins, color schemes and configurations -I would of course recommend using the awesome version. +I would of course recommend using the awesome version.c ## How to install the Awesome version? The awesome version includes a lot of great plugins, configurations and color schemes that make Vim a lot better. To install it simply do following: @@ -15,8 +15,6 @@ The awesome version includes a lot of great plugins, configurations and color sc git clone https://github.com/amix/vimrc.git ~/.vim_runtime sh ~/.vim_runtime/install_awesome_vimrc.sh -The taglist.vim plugin will require ctags (http://ctags.sourceforge.net) (Debian: apt-get install ctags) - I also recommend using [Source Code Pro font from Adobe](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) (it's free and awesome font for writing and programming). The Awesome vimrc is already setup to try to use it ## How to install the Basic version? @@ -73,9 +71,7 @@ I recommend reading the docs of these plugins to understand them better. Each of * [ctrlp.vim](https://github.com/kien/ctrlp.vim): Fuzzy file, buffer, mru and tag finder. In my config it's mapped to ``, because `` is used by YankRing * [mru.vim](https://github.com/vim-scripts/mru.vim): Plugin to manage Most Recently Used (MRU) files. Includes my own fork which adds syntax highlighting to MRU. This plugin can be opened with `` * [open_file_under_cursor.vim](https://github.com/amix/open_file_under_cursor.vim): Open file under cursor when pressing `gf` -* [zencoding](https://github.com/mattn/emmet-vim): Expanding abbreviation like zen-coding, very useful for editing XML, HTML. * [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object): Defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts -* [taglist.vim](https://github.com/vim-scripts/taglist.vim): Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc) * [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors): Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing) * [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination. * [vim-airline](https://github.com/bling/vim-airline): Lean & mean status/tabline for vim that's light as air (replacing powerline) @@ -102,7 +98,7 @@ Remove all clutter and focus only on the essential. Similar to iA Writer or Writ * [vim-bundle-mako](https://github.com/sophacles/vim-bundle-mako) * [vim-markdown](https://github.com/tpope/vim-markdown) * [nginx.vim](https://github.com/vim-scripts/nginx.vim): Highlights configuration files for nginx -* [vim-golang](https://github.com/jnwhiteh/vim-golang) +* [vim-go](https://github.com/fatih/vim-go) ## How to include your own stuff? @@ -137,7 +133,7 @@ Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin: let g:ctrlp_map = '' -Open [PeepOpen](https://peepcode.com/products/peepopen) plugin: +Open [PeepOpen](http://topfunky.github.io/PeepOpen/) plugin: map j :PeepOpen @@ -327,3 +323,9 @@ Vimscript mappings: * [Folding in Vim](http://amix.dk/blog/post/19132#Folding-in-Vim) * [ Zen room for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) + +## How to uninstall +Do following: +* Remove `~/.vim_runtime` +* Remove any lines that refernce `.vim_runtime` in your `~/.vimrc` + diff --git a/sources_forked/zencoding/.gitmodules b/sources_forked/zencoding/.gitmodules deleted file mode 100755 index 8225cc06..00000000 --- a/sources_forked/zencoding/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "docs"] - path = docs - url = git@github.com:mattn/zencoding-vim.git - branch = gh-pages diff --git a/sources_forked/zencoding/Makefile b/sources_forked/zencoding/Makefile deleted file mode 100755 index 94c355a8..00000000 --- a/sources_forked/zencoding/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -all : zencoding-vim.zip - -remove-zip: - -rm doc/tags - -rm zencoding-vim.zip - -zencoding-vim.zip: remove-zip - zip -r zencoding-vim.zip autoload plugin doc - -release: zencoding-vim.zip - vimup update-script zencoding.vim diff --git a/sources_forked/zencoding/README.mkd b/sources_forked/zencoding/README.mkd deleted file mode 100755 index 36eead34..00000000 --- a/sources_forked/zencoding/README.mkd +++ /dev/null @@ -1,103 +0,0 @@ -# ZenCoding-vim - -[zencoding-vim](http://mattn.github.com/zencoding-vim) is vim script support for expanding abbreviation like zen-coding(emmet). - -## Installation - -[Download zip file](http://www.vim.org/scripts/script.php?script_id=2981): - - cd ~/.vim - unzip zencoding-vim.zip - -If you install pathogen.vim: - - cd ~/.vim/bundle # or make directory - unzip /path/to/zencoding-vim.zip - -If you get source from repository: - - cd ~/.vim/bundle # or make directory - git clone http://github.com/mattn/zencoding-vim.git - -or: - - git clone http://github.com/mattn/zencoding-vim.git - cd zencoding-vim - cp plugin/zencoding.vim ~/.vim/plugin/ - cp autoload/zencoding.vim ~/.vim/autoload/ - cp -a autoload/zencoding ~/.vim/autoload/ - - -## Quick Tutorial - -Open or create New File: - - vim index.html - -Type ("_" is the cursor position): - - html:5_ - -Then type "," (Ctrl + y + ','), you should see: - - - - - - - - - _ - - - -[More Tutorials](https://raw.github.com/mattn/zencoding-vim/master/TUTORIAL) - - -## Enable in different mode - -If you don't want enable zencoding in all mode, -you can use set a option in `vimrc`: - - let g:user_zen_mode='n' "only enable normal mode functions. - let g:user_zen_mode='inv' "enable all functions, which is equal to - let g:user_zen_mode='a' "enable all function in all mode. - -## Project Authors - -[Yasuhiro Matsumoto](http://mattn.kaoriya.net/) - -## Links - -### zen-coding official site: - -> - -### zencoding.vim: - -> - -### development repository: - -> - -### my blog posts about zencoding-vim: - -> - -> - -### japanese blog posts about zencoding-vim: - -> - -> - -> - -> - -### tutorial traslated in chinese: - -> - diff --git a/sources_forked/zencoding/TODO b/sources_forked/zencoding/TODO deleted file mode 100755 index e69de29b..00000000 diff --git a/sources_forked/zencoding/TUTORIAL b/sources_forked/zencoding/TUTORIAL deleted file mode 100755 index ad460418..00000000 --- a/sources_forked/zencoding/TUTORIAL +++ /dev/null @@ -1,212 +0,0 @@ -Tutorial of zencoding.vim - - mattn - -1. Expand Abbreviation - - Type abbreviation as 'div>p#foo$*3>a' and type ','. - --------------------- -
-

- -

-

- -

-

- -

-
- --------------------- - -2. Wrap with Abbreviation - - Write as below. - --------------------- - test1 - test2 - test3 - --------------------- - Then do visual select(line wize) and type ','. - If you request 'Tag:', then type 'ul>li*'. - --------------------- -
    -
  • test1
  • -
  • test2
  • -
  • test3
  • -
- --------------------- - - If you type tag as 'blockquote', then you'll see as following. - --------------------- -
- test1 - test2 - test3 -
- --------------------- - -3. Balance Tag Inward - - type 'd' in insert mode. - -4. Balance Tag Outward - - type 'D' in insert mode. - -5. Go to Next Edit Point - - type 'n' in insert mode. - -6. Go to Previous Edit Point - - type 'N' in insert mode. - -7. Update Size - - Move cursor to img tag. - --------------------- - - --------------------- - Type 'i' on img tag - --------------------- - - --------------------- - -8. Merge Lines - - select the lines included '
  • ' - --------------------- -
      -
    • -
    • -
    • -
    - --------------------- - and type 'm' - --------------------- -
      -
    • -
    - --------------------- - -9. Remove Tag - - Move cursor in block - --------------------- - - --------------------- - Type 'k' in insert mode. - --------------------- -
    - -
    - --------------------- - - And type 'k' in there again. - --------------------- - - --------------------- - -10. Split/Join Tag - - Move cursor in block - --------------------- -
    - cursor is here -
    - --------------------- - Type 'j' in insert mode. - --------------------- -
    - --------------------- - - And type 'j' in there again. - --------------------- -
    -
    - --------------------- - -11. Toggle Comment - - Move cursor to block - --------------------- -
    - hello world -
    - --------------------- - Type '/' in insert mode. - --------------------- - - --------------------- - Type '/' in there again. - --------------------- -
    - hello world -
    - --------------------- - -12. Make anchor from URL - - Move cursor to URL - --------------------- - http://www.google.com/ - --------------------- - Type 'a' - --------------------- - Google - --------------------- - -13. Make quoted text from URL - - Move cursor to URL - --------------------- - http://github.com/ - --------------------- - Type 'A' - --------------------- -
    - Secure source code hosting and collaborative development - GitHub
    -

    How does it work? Get up and running in seconds by forking a project, pushing an existing repository...

    - http://github.com/ -
    - --------------------- - -14. Installing zencoding.vim for language you using. - - # cd ~/.vim - # unzip zencoding-vim.zip - - or if you install pathogen.vim: - - # cd ~/.vim/bundle # or make directory - # unzip /path/to/zencoding-vim.zip - - if you get sources from repository: - - # cd ~/.vim/bundle # or make directory - # git clone http://github.com/mattn/zencoding-vim.git - -15. Enable zencoding.vim for language you using. - - You can customize the behavior of language you using. - - --------------------- - # cat >> ~/.vimrc - let g:user_zen_settings = { - \ 'php' : { - \ 'extends' : 'html', - \ 'filters' : 'c', - \ }, - \ 'xml' : { - \ 'extends' : 'html', - \ }, - \ 'haml' : { - \ 'extends' : 'html', - \ }, - \} - --------------------- diff --git a/sources_forked/zencoding/autoload/zencoding.vim b/sources_forked/zencoding/autoload/zencoding.vim deleted file mode 100755 index a6961439..00000000 --- a/sources_forked/zencoding/autoload/zencoding.vim +++ /dev/null @@ -1,1486 +0,0 @@ -"============================================================================= -" zencoding.vim -" Author: Yasuhiro Matsumoto -" Last Change: 09-Apr-2013. - -let s:save_cpo = &cpo -set cpo&vim - -function! zencoding#getExpandos(type, key) - let expandos = zencoding#getResource(a:type, 'expandos', {}) - if has_key(expandos, a:key) - return expandos[a:key] - endif - return a:key -endfunction - -function! zencoding#splitFilterArg(filters) - for f in a:filters - if f =~ '^/' - return f[1:] - endif - endfor - return '' -endfunction - -function! zencoding#useFilter(filters, filter) - for f in a:filters - if a:filter == '/' && f =~ '^/' - return 1 - elseif f == a:filter - return 1 - endif - endfor - return 0 -endfunction - -function! zencoding#getIndentation(...) - if a:0 > 0 - let type = a:1 - else - let type = zencoding#getFileType() - endif - if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'indentation') - let indent = s:zen_settings[type].indentation - elseif has_key(s:zen_settings, 'indentation') - let indent = s:zen_settings.indentation - else - let indent = (&l:expandtab || &l:tabstop != &l:shiftwidth) ? repeat(' ', &l:shiftwidth) : "\t" - endif - return indent -endfunction - -function! zencoding#getBaseType(type) - if !has_key(s:zen_settings, a:type) - return '' - endif - if !has_key(s:zen_settings[a:type], 'extends') - return a:type - endif - let extends = s:zen_settings[a:type].extends - if type(extends) == 1 - let tmp = split(extends, '\s*,\s*') - let ext = tmp[0] - else - let ext = extends[0] - endif - if a:type != ext - return zencoding#getBaseType(ext) - endif - return '' -endfunction - -function! zencoding#isExtends(type, extend) - if a:type == a:extend - return 1 - endif - if !has_key(s:zen_settings, a:type) - return 0 - endif - if !has_key(s:zen_settings[a:type], 'extends') - return 0 - endif - let extends = s:zen_settings[a:type].extends - if type(extends) == 1 - let tmp = split(extends, '\s*,\s*') - unlet! extends - let extends = tmp - endif - for ext in extends - if a:extend == ext - return 1 - endif - endfor - return 0 -endfunction - -function! zencoding#parseIntoTree(abbr, type) - let abbr = a:abbr - let type = a:type - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#parseIntoTree(abbr, type) -endfunction - -function! s:mergeConfig(lhs, rhs) - if type(a:lhs) == 3 && type(a:rhs) == 3 - let a:lhs += a:rhs - if len(a:lhs) - call remove(a:lhs, 0, len(a:lhs)-1) - endif - for rhi in a:rhs - call add(a:lhs, a:rhs[rhi]) - endfor - elseif type(a:lhs) == 4 && type(a:rhs) == 4 - for key in keys(a:rhs) - if type(a:rhs[key]) == 3 - if !has_key(a:lhs, key) - let a:lhs[key] = [] - endif - let a:lhs[key] += a:rhs[key] - elseif type(a:rhs[key]) == 4 - if has_key(a:lhs, key) - call s:mergeConfig(a:lhs[key], a:rhs[key]) - else - let a:lhs[key] = a:rhs[key] - endif - else - let a:lhs[key] = a:rhs[key] - endif - endfor - endif -endfunction - -function! zencoding#toString(...) - let current = a:1 - if a:0 > 1 - let type = a:2 - else - let type = &ft - endif - if len(type) == 0 | let type = 'html' | endif - if a:0 > 2 - let inline = a:3 - else - let inline = 0 - endif - if a:0 > 3 - if type(a:4) == 1 - let filters = split(a:4, '\s*,\s*') - else - let filters = a:4 - endif - else - let filters = ['html'] - endif - if a:0 > 4 - let group_itemno = a:5 - else - let group_itemno = 0 - endif - - let dollar_expr = zencoding#getResource(type, 'dollar_expr', 1) - let indent = zencoding#getIndentation(type) - let itemno = 0 - let str = '' - let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1) - let rtype = zencoding#lang#exists(type) ? type : 'html' - while itemno < current.multiplier - if len(current.name) - if group_itemno != 0 - let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, group_itemno, indent) - else - let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent) - endif - if current.multiplier > 1 - let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g') - endif - let str .= inner - else - let snippet = current.snippet - if len(current.snippet) == 0 - let snippets = zencoding#getResource(type, 'snippets', {}) - if !empty(snippets) && has_key(snippets, 'zensnippet') - let snippet = snippets['zensnippet'] - endif - endif - if len(snippet) > 0 - let tmp = snippet - if use_pipe_for_cursor - let tmp = substitute(tmp, '|', '${cursor}', 'g') - endif - let tmp = substitute(tmp, '\${zenname}', current.name, 'g') - let snippet_node = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 0, 'parent': {}, 'value': '{'.tmp.'}', 'pos': 0, 'important': current.important } - let str = zencoding#lang#{rtype}#toString(s:zen_settings, snippet_node, type, inline, filters, group_itemno, indent) - else - if len(current.name) - let str .= current.name - endif - if len(current.value) - let text = current.value[1:-2] - if dollar_expr - let text = substitute(text, '\%(\\\)\@\{$#}' - endif - if zencoding#useFilter(filters, '/') - let spl = zencoding#splitFilterArg(filters) - let fline = getline(a:firstline) - let query = substitute(query, '>\{0,1}{\$#}\s*$', '{\\$column\\$}*' . len(split(fline, spl)), '') - endif - let items = zencoding#parseIntoTree(query, type).child - for item in items - let expand .= zencoding#toString(item, type, 0, filters) - endfor - if zencoding#useFilter(filters, 'e') - let expand = substitute(expand, '&', '\&', 'g') - let expand = substitute(expand, '<', '\<', 'g') - let expand = substitute(expand, '>', '\>', 'g') - endif - let line = getline(a:firstline) - let part = substitute(line, '^\s*', '', '') - for n in range(a:firstline, a:lastline) - let lline = getline(n) - let lpart = substitute(lline, '^\s\+', '', '') - if zencoding#useFilter(filters, 't') - let lpart = substitute(lpart, '^[0-9.-]\+\s\+', '', '') - let lpart = substitute(lpart, '\s\+$', '', '') - endif - if zencoding#useFilter(filters, '/') - for column in split(lpart, spl) - let expand = substitute(expand, '\$column\$', '\=column', '') - endfor - else - let expand = substitute(expand, '\$line'.(n-a:firstline+1).'\$', '\=lpart', 'g') - endif - endfor - let expand = substitute(expand, '\$line\d*\$', '', 'g') - let expand = substitute(expand, '\$column\$', '', 'g') - let content = join(getline(a:firstline, a:lastline), "\n") - if stridx(expand, '$#') < len(expand)-2 - let expand = substitute(expand, '^\(.*\)\$#\s*$', '\1', '') - endif - let expand = substitute(expand, '\$#', '\=content', 'g') - else - let str = '' - if visualmode() ==# 'V' - let line = getline(a:firstline) - let part = substitute(line, '^\s*', '', '') - for n in range(a:firstline, a:lastline) - if len(leader) > 0 - let str .= getline(n) . "\n" - else - let lpart = substitute(getline(n), '^\s*', '', '') - let str .= lpart . "\n" - endif - endfor - let leader .= (str =~ "\n" ? ">{\n" : "{") . str . "}" - let items = zencoding#parseIntoTree(leader, type).child - else - let save_regcont = @" - let save_regtype = getregtype('"') - silent! normal! gvygv - let str = @" - call setreg('"', save_regcont, save_regtype) - let items = zencoding#parseIntoTree(leader . "{".str."}", type).child - endif - for item in items - let expand .= zencoding#toString(item, type, 0, filters) - endfor - if zencoding#useFilter(filters, 'e') - let expand = substitute(expand, '&', '\&', 'g') - let expand = substitute(expand, '<', '\<', 'g') - let expand = substitute(expand, '>', '\>', 'g') - endif - endif - elseif a:mode == 4 - let line = getline('.') - let spaces = matchstr(line, '^\s*') - if line !~ '^\s*$' - put =spaces.a:abbr - else - call setline('.', spaces.a:abbr) - endif - normal! $ - call zencoding#expandAbbr(0, "") - return - else - let line = getline('.') - if col('.') < len(line) - let line = matchstr(line, '^\(.*\%'.col('.').'c.\)') - endif - if a:mode == 1 - let part = matchstr(line, '\([a-zA-Z0-9:_\-\@|]\+\)$') - else - let part = matchstr(line, '\(\S.*\)$') - let ftype = zencoding#lang#exists(type) ? type : 'html' - let part = zencoding#lang#{ftype}#findTokens(part) - endif - let rest = getline('.')[len(line):] - let str = part - let mx = '|\(\%(html\|haml\|slim\|e\|c\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$' - if str =~ mx - let filters = split(matchstr(str, mx)[1:], '\s*,\s*') - let str = substitute(str, mx, '', '') - endif - let items = zencoding#parseIntoTree(str, rtype).child - for item in items - let expand .= zencoding#toString(item, rtype, 0, filters) - endfor - if zencoding#useFilter(filters, 'e') - let expand = substitute(expand, '&', '\&', 'g') - let expand = substitute(expand, '<', '\<', 'g') - let expand = substitute(expand, '>', '\>', 'g') - endif - let expand = substitute(expand, '\$line\([0-9]\+\)\$', '\=submatch(1)', 'g') - endif - if len(expand) - if expand !~ '\${cursor}' - if a:mode == 2 | - let expand = '${cursor}' . expand - else - let expand .= '${cursor}' - endif - endif - let expand = substitute(expand, '${lang}', s:zen_settings.lang, 'g') - let expand = substitute(expand, '${charset}', s:zen_settings.charset, 'g') - if has_key(s:zen_settings, 'timezone') && len(s:zen_settings.timezone) - let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S") . s:zen_settings.timezone, 'g') - else - " TODO: on windows, %z/%Z is 'Tokyo(Standard)' - let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g') - endif - if a:mode == 2 && visualmode() ==# 'v' - if a:firstline == a:lastline - let expand = substitute(expand, '\n\s*', '', 'g') - else - let expand = substitute(expand, '\n$', '', 'g') - endif - let expand = substitute(expand, '\${cursor}', '$cursor$', '') - let expand = substitute(expand, '\${cursor}', '', 'g') - silent! normal! gv - let col = col("'<") - silent! normal! c - let line = getline('.') - let lhs = matchstr(line, '.*\%<'.col.'c.') - let rhs = matchstr(line, '\%>'.(col-1).'c.*') - let expand = lhs.expand.rhs - let lines = split(expand, '\n') - call setline(line('.'), lines[0]) - if len(lines) > 1 - call append(line('.'), lines[1:]) - endif - else - let expand = substitute(expand, '\${cursor}', '$cursor$', '') - let expand = substitute(expand, '\${cursor}', '', 'g') - if line[:-len(part)-1] =~ '^\s\+$' - let indent = line[:-len(part)-1] - else - let indent = '' - endif - let expand = substitute(expand, '\n\s*$', '', 'g') - let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest - let lines = split(expand, '\n') - if a:mode == 2 - silent! exe "normal! gvc" - endif - call setline(line('.'), lines[0]) - if len(lines) > 1 - call append(line('.'), lines[1:]) - endif - endif - endif - if search('\$cursor\$', 'e') - let oldselection = &selection - let &selection = 'inclusive' - silent! foldopen - silent! exe "normal! v7h\"_s" - let &selection = oldselection - endif - if g:zencoding_debug > 1 - call getchar() - endif -endfunction - -function! zencoding#moveNextPrev(flag) - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#moveNextPrev(a:flag) -endfunction - -function! zencoding#imageSize() - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#imageSize() -endfunction - -function! zencoding#encodeImage() - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#encodeImage() -endfunction - -function! zencoding#toggleComment() - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#toggleComment() -endfunction - -function! zencoding#balanceTag(flag) range - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#balanceTag(a:flag) -endfunction - -function! zencoding#splitJoinTag() - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#splitJoinTag() -endfunction - -function! zencoding#mergeLines() range - let lines = join(map(getline(a:firstline, a:lastline), 'matchstr(v:val, "^\\s*\\zs.*\\ze\\s*$")'), '') - let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '') - silent! exe "normal! gvc" - call setline('.', indent . lines) -endfunction - -function! zencoding#removeTag() - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - return zencoding#lang#{rtype}#removeTag() -endfunction - -function! zencoding#anchorizeURL(flag) - let mx = 'https\=:\/\/[-!#$%&*+,./:;=?@0-9a-zA-Z_~]\+' - let pos1 = searchpos(mx, 'bcnW') - let url = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let block = [pos1, [pos1[0], pos1[1] + len(url) - 1]] - if !zencoding#util#cursorInRegion(block) - return - endif - - let mx = '.*]*>\s*\zs\([^<]\+\)\ze\s*<\/title[^>]*>.*' - let content = zencoding#util#getContentFromURL(url) - let content = substitute(content, '\r', '', 'g') - let content = substitute(content, '[ \n]\+', ' ', 'g') - let content = substitute(content, '', '', 'g') - let title = matchstr(content, mx) - - let type = zencoding#getFileType() - let rtype = zencoding#lang#exists(type) ? type : 'html' - if a:flag == 0 - let a = zencoding#lang#html#parseTag('') - let a.attr.href = url - let a.value = '{' . title . '}' - let expand = zencoding#toString(a, rtype, 0, []) - let expand = substitute(expand, '\${cursor}', '', 'g') - else - let body = zencoding#util#getTextFromHTML(content) - let body = '{' . substitute(body, '^\(.\{0,100}\).*', '\1', '') . '...}' - - let blockquote = zencoding#lang#html#parseTag('
    ') - let a = zencoding#lang#html#parseTag('') - let a.attr.href = url - let a.value = '{' . title . '}' - call add(blockquote.child, a) - call add(blockquote.child, zencoding#lang#html#parseTag('
    ')) - let p = zencoding#lang#html#parseTag('

    ') - let p.value = body - call add(blockquote.child, p) - let cite = zencoding#lang#html#parseTag('') - let cite.value = '{' . url . '}' - call add(blockquote.child, cite) - let expand = zencoding#toString(blockquote, rtype, 0, []) - let expand = substitute(expand, '\${cursor}', '', 'g') - endif - let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '') - let expand = substitute(expand, "\n", "\n" . indent, 'g') - call zencoding#util#setContent(block, expand) -endfunction - -function! zencoding#codePretty() range - let type = input('FileType: ', &ft, 'filetype') - if len(type) == 0 - return - endif - let block = zencoding#util#getVisualBlock() - let content = zencoding#util#getContent(block) - silent! 1new - let &l:filetype = type - call setline(1, split(content, "\n")) - let old_lazyredraw = &lazyredraw - set lazyredraw - silent! TOhtml - let &lazyredraw = old_lazyredraw - let content = join(getline(1, '$'), "\n") - silent! bw! - silent! bw! - let content = matchstr(content, ']*>[\s\n]*\zs.*\ze') - call zencoding#util#setContent(block, content) -endfunction - -function! zencoding#ExpandWord(abbr, type, orig) - let mx = '|\(\%(html\|haml\|slim\|e\|c\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$' - let str = a:abbr - let type = a:type - - if len(type) == 0 | let type = 'html' | endif - if str =~ mx - let filters = split(matchstr(str, mx)[1:], '\s*,\s*') - let str = substitute(str, mx, '', '') - elseif has_key(s:zen_settings[a:type], 'filters') - let filters = split(s:zen_settings[a:type].filters, '\s*,\s*') - else - let filters = ['html'] - endif - let items = zencoding#parseIntoTree(str, a:type).child - let expand = '' - for item in items - let expand .= zencoding#toString(item, a:type, 0, filters) - endfor - if zencoding#useFilter(filters, 'e') - let expand = substitute(expand, '&', '\&', 'g') - let expand = substitute(expand, '<', '\<', 'g') - let expand = substitute(expand, '>', '\>', 'g') - endif - if a:orig == 0 - let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g') - let expand = substitute(expand, '\${charset}', s:zen_settings.charset, 'g') - let expand = substitute(expand, '\${cursor}', '', 'g') - endif - return expand -endfunction - -function! zencoding#getSnippets(type) - let type = a:type - if len(type) == 0 || !has_key(s:zen_settings, type) - let type = 'html' - endif - return zencoding#getResource(type, 'snippets', {}) -endfunction - -function! zencoding#CompleteTag(findstart, base) - if a:findstart - let line = getline('.') - let start = col('.') - 1 - while start > 0 && line[start - 1] =~ '[a-zA-Z0-9:_\@\-]' - let start -= 1 - endwhile - return start - else - let type = zencoding#getFileType() - let res = [] - - let snippets = zencoding#getResource(type, 'snippets', {}) - for item in keys(snippets) - if stridx(item, a:base) != -1 - call add(res, substitute(item, '\${cursor}\||', '', 'g')) - endif - endfor - let aliases = zencoding#getResource(type, 'aliases', {}) - for item in values(aliases) - if stridx(item, a:base) != -1 - call add(res, substitute(item, '\${cursor}\||', '', 'g')) - endif - endfor - return res - endif -endfunction - -unlet! s:zen_settings -let s:zen_settings = { -\ 'lang': "en", -\ 'charset': "UTF-8", -\ 'css': { -\ 'snippets': { -\ '@i': '@import url(|);', -\ '@m': "@media print {\n\t|\n}", -\ '@f': "@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}", -\ '!': '!important', -\ 'pos': 'position:|;', -\ 'pos:s': 'position:static;', -\ 'pos:a': 'position:absolute;', -\ 'pos:r': 'position:relative;', -\ 'pos:f': 'position:fixed;', -\ 't': 'top:|;', -\ 't:a': 'top:auto;', -\ 'r': 'right:|;', -\ 'r:a': 'right:auto;', -\ 'b': 'bottom:|;', -\ 'b:a': 'bottom:auto;', -\ 'l': 'left:|;', -\ 'l:a': 'left:auto;', -\ 'z': 'z-index:|;', -\ 'z:a': 'z-index:auto;', -\ 'fl': 'float:|;', -\ 'fl:n': 'float:none;', -\ 'fl:l': 'float:left;', -\ 'fl:r': 'float:right;', -\ 'cl': 'clear:|;', -\ 'cl:n': 'clear:none;', -\ 'cl:l': 'clear:left;', -\ 'cl:r': 'clear:right;', -\ 'cl:b': 'clear:both;', -\ 'd': 'display:|;', -\ 'd:n': 'display:none;', -\ 'd:b': 'display:block;', -\ 'd:i': 'display:inline;', -\ 'd:ib': 'display:inline-block;', -\ 'd:li': 'display:list-item;', -\ 'd:ri': 'display:run-in;', -\ 'd:cp': 'display:compact;', -\ 'd:tb': 'display:table;', -\ 'd:itb': 'display:inline-table;', -\ 'd:tbcp': 'display:table-caption;', -\ 'd:tbcl': 'display:table-column;', -\ 'd:tbclg': 'display:table-column-group;', -\ 'd:tbhg': 'display:table-header-group;', -\ 'd:tbfg': 'display:table-footer-group;', -\ 'd:tbr': 'display:table-row;', -\ 'd:tbrg': 'display:table-row-group;', -\ 'd:tbc': 'display:table-cell;', -\ 'd:rb': 'display:ruby;', -\ 'd:rbb': 'display:ruby-base;', -\ 'd:rbbg': 'display:ruby-base-group;', -\ 'd:rbt': 'display:ruby-text;', -\ 'd:rbtg': 'display:ruby-text-group;', -\ 'v': 'visibility:|;', -\ 'v:v': 'visibility:visible;', -\ 'v:h': 'visibility:hidden;', -\ 'v:c': 'visibility:collapse;', -\ 'ov': 'overflow:|;', -\ 'ov:v': 'overflow:visible;', -\ 'ov:h': 'overflow:hidden;', -\ 'ov:s': 'overflow:scroll;', -\ 'ov:a': 'overflow:auto;', -\ 'ovx': 'overflow-x:|;', -\ 'ovx:v': 'overflow-x:visible;', -\ 'ovx:h': 'overflow-x:hidden;', -\ 'ovx:s': 'overflow-x:scroll;', -\ 'ovx:a': 'overflow-x:auto;', -\ 'ovy': 'overflow-y:|;', -\ 'ovy:v': 'overflow-y:visible;', -\ 'ovy:h': 'overflow-y:hidden;', -\ 'ovy:s': 'overflow-y:scroll;', -\ 'ovy:a': 'overflow-y:auto;', -\ 'ovs': 'overflow-style:|;', -\ 'ovs:a': 'overflow-style:auto;', -\ 'ovs:s': 'overflow-style:scrollbar;', -\ 'ovs:p': 'overflow-style:panner;', -\ 'ovs:m': 'overflow-style:move;', -\ 'ovs:mq': 'overflow-style:marquee;', -\ 'zoo': 'zoom:1;', -\ 'cp': 'clip:|;', -\ 'cp:a': 'clip:auto;', -\ 'cp:r': 'clip:rect(|);', -\ 'bxz': 'box-sizing:|;', -\ 'bxz:cb': 'box-sizing:content-box;', -\ 'bxz:bb': 'box-sizing:border-box;', -\ 'bxsh': 'box-shadow:|;', -\ 'bxsh:n': 'box-shadow:none;', -\ 'bxsh:w': '-webkit-box-shadow:0 0 0 #000;', -\ 'bxsh:m': '-moz-box-shadow:0 0 0 0 #000;', -\ 'm': 'margin:|;', -\ 'm:a': 'margin:auto;', -\ 'm:0': 'margin:0;', -\ 'm:2': 'margin:0 0;', -\ 'm:3': 'margin:0 0 0;', -\ 'm:4': 'margin:0 0 0 0;', -\ 'mt': 'margin-top:|;', -\ 'mt:a': 'margin-top:auto;', -\ 'mr': 'margin-right:|;', -\ 'mr:a': 'margin-right:auto;', -\ 'mb': 'margin-bottom:|;', -\ 'mb:a': 'margin-bottom:auto;', -\ 'ml': 'margin-left:|;', -\ 'ml:a': 'margin-left:auto;', -\ 'p': 'padding:|;', -\ 'p:0': 'padding:0;', -\ 'p:2': 'padding:0 0;', -\ 'p:3': 'padding:0 0 0;', -\ 'p:4': 'padding:0 0 0 0;', -\ 'pt': 'padding-top:|;', -\ 'pr': 'padding-right:|;', -\ 'pb': 'padding-bottom:|;', -\ 'pl': 'padding-left:|;', -\ 'w': 'width:|;', -\ 'w:a': 'width:auto;', -\ 'h': 'height:|;', -\ 'h:a': 'height:auto;', -\ 'maw': 'max-width:|;', -\ 'maw:n': 'max-width:none;', -\ 'mah': 'max-height:|;', -\ 'mah:n': 'max-height:none;', -\ 'miw': 'min-width:|;', -\ 'mih': 'min-height:|;', -\ 'o': 'outline:|;', -\ 'o:n': 'outline:none;', -\ 'oo': 'outline-offset:|;', -\ 'ow': 'outline-width:|;', -\ 'os': 'outline-style:|;', -\ 'oc': 'outline-color:#000;', -\ 'oc:i': 'outline-color:invert;', -\ 'bd': 'border:|;', -\ 'bd+': 'border:1px solid #000;', -\ 'bd:n': 'border:none;', -\ 'bdbk': 'border-break:|;', -\ 'bdbk:c': 'border-break:close;', -\ 'bdcl': 'border-collapse:|;', -\ 'bdcl:c': 'border-collapse:collapse;', -\ 'bdcl:s': 'border-collapse:separate;', -\ 'bdc': 'border-color:#000;', -\ 'bdi': 'border-image:url(|);', -\ 'bdi:n': 'border-image:none;', -\ 'bdi:w': '-webkit-border-image:url(|) 0 0 0 0 stretch stretch;', -\ 'bdi:m': '-moz-border-image:url(|) 0 0 0 0 stretch stretch;', -\ 'bdti': 'border-top-image:url(|);', -\ 'bdti:n': 'border-top-image:none;', -\ 'bdri': 'border-right-image:url(|);', -\ 'bdri:n': 'border-right-image:none;', -\ 'bdbi': 'border-bottom-image:url(|);', -\ 'bdbi:n': 'border-bottom-image:none;', -\ 'bdli': 'border-left-image:url(|);', -\ 'bdli:n': 'border-left-image:none;', -\ 'bdci': 'border-corner-image:url(|);', -\ 'bdci:n': 'border-corner-image:none;', -\ 'bdci:c': 'border-corner-image:continue;', -\ 'bdtli': 'border-top-left-image:url(|);', -\ 'bdtli:n': 'border-top-left-image:none;', -\ 'bdtli:c': 'border-top-left-image:continue;', -\ 'bdtri': 'border-top-right-image:url(|);', -\ 'bdtri:n': 'border-top-right-image:none;', -\ 'bdtri:c': 'border-top-right-image:continue;', -\ 'bdbri': 'border-bottom-right-image:url(|);', -\ 'bdbri:n': 'border-bottom-right-image:none;', -\ 'bdbri:c': 'border-bottom-right-image:continue;', -\ 'bdbli': 'border-bottom-left-image:url(|);', -\ 'bdbli:n': 'border-bottom-left-image:none;', -\ 'bdbli:c': 'border-bottom-left-image:continue;', -\ 'bdf': 'border-fit:|;', -\ 'bdf:c': 'border-fit:clip;', -\ 'bdf:r': 'border-fit:repeat;', -\ 'bdf:sc': 'border-fit:scale;', -\ 'bdf:st': 'border-fit:stretch;', -\ 'bdf:ow': 'border-fit:overwrite;', -\ 'bdf:of': 'border-fit:overflow;', -\ 'bdf:sp': 'border-fit:space;', -\ 'bdl': 'border-left:|;', -\ 'bdl:a': 'border-length:auto;', -\ 'bdsp': 'border-spacing:|;', -\ 'bds': 'border-style:|;', -\ 'bds:n': 'border-style:none;', -\ 'bds:h': 'border-style:hidden;', -\ 'bds:dt': 'border-style:dotted;', -\ 'bds:ds': 'border-style:dashed;', -\ 'bds:s': 'border-style:solid;', -\ 'bds:db': 'border-style:double;', -\ 'bds:dtds': 'border-style:dot-dash;', -\ 'bds:dtdtds': 'border-style:dot-dot-dash;', -\ 'bds:w': 'border-style:wave;', -\ 'bds:g': 'border-style:groove;', -\ 'bds:r': 'border-style:ridge;', -\ 'bds:i': 'border-style:inset;', -\ 'bds:o': 'border-style:outset;', -\ 'bdw': 'border-width:|;', -\ 'bdt': 'border-top:|;', -\ 'bdt+': 'border-top:1px solid #000;', -\ 'bdt:n': 'border-top:none;', -\ 'bdtw': 'border-top-width:|;', -\ 'bdts': 'border-top-style:|;', -\ 'bdts:n': 'border-top-style:none;', -\ 'bdtc': 'border-top-color:#000;', -\ 'bdr': 'border-right:|;', -\ 'bdr+': 'border-right:1px solid #000;', -\ 'bdr:n': 'border-right:none;', -\ 'bdrw': 'border-right-width:|;', -\ 'bdrt': 'border-right-style:|;', -\ 'bdrs:n': 'border-right-style:none;', -\ 'bdrc': 'border-right-color:#000;', -\ 'bdb': 'border-bottom:|;', -\ 'bdb+': 'border-bottom:1px solid #000;', -\ 'bdb:n': 'border-bottom:none;', -\ 'bdbw': 'border-bottom-width:|;', -\ 'bdbs': 'border-bottom-style:|;', -\ 'bdbs:n': 'border-bottom-style:none;', -\ 'bdbc': 'border-bottom-color:#000;', -\ 'bdln': 'border-length:|;', -\ 'bdl+': 'border-left:1px solid #000;', -\ 'bdl:n': 'border-left:none;', -\ 'bdlw': 'border-left-width:|;', -\ 'bdls': 'border-left-style:|;', -\ 'bdls:n': 'border-left-style:none;', -\ 'bdlc': 'border-left-color:#000;', -\ 'bdrs': 'border-radius:|;', -\ 'bdtrrz': 'border-top-right-radius:|;', -\ 'bdtlrz': 'border-top-left-radius:|;', -\ 'bdbrrz': 'border-bottom-right-radius:|;', -\ 'bdblrz': 'border-bottom-left-radius:|;', -\ 'bdrz:w': '-webkit-border-radius:|;', -\ 'bdrz:m': '-moz-border-radius:|;', -\ 'bg': 'background:|;', -\ 'bg+': 'background:#FFF url(|) 0 0 no-repeat;', -\ 'bg:n': 'background:none;', -\ 'bg:ie': 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''|x.png'');', -\ 'bgc': 'background-color:#FFF;', -\ 'bgi': 'background-image:url(|);', -\ 'bgi:n': 'background-image:none;', -\ 'bgr': 'background-repeat:|;', -\ 'bgr:n': 'background-repeat:no-repeat;', -\ 'bgr:x': 'background-repeat:repeat-x;', -\ 'bgr:y': 'background-repeat:repeat-y;', -\ 'bga': 'background-attachment:|;', -\ 'bga:f': 'background-attachment:fixed;', -\ 'bga:s': 'background-attachment:scroll;', -\ 'bgp': 'background-position:0 0;', -\ 'bgpx': 'background-position-x:|;', -\ 'bgpy': 'background-position-y:|;', -\ 'bgbk': 'background-break:|;', -\ 'bgbk:bb': 'background-break:bounding-box;', -\ 'bgbk:eb': 'background-break:each-box;', -\ 'bgbk:c': 'background-break:continuous;', -\ 'bgcp': 'background-clip:|;', -\ 'bgcp:bb': 'background-clip:border-box;', -\ 'bgcp:pb': 'background-clip:padding-box;', -\ 'bgcp:cb': 'background-clip:content-box;', -\ 'bgcp:nc': 'background-clip:no-clip;', -\ 'bgo': 'background-origin:|;', -\ 'bgo:pb': 'background-origin:padding-box;', -\ 'bgo:bb': 'background-origin:border-box;', -\ 'bgo:cb': 'background-origin:content-box;', -\ 'bgz': 'background-size:|;', -\ 'bgz:a': 'background-size:auto;', -\ 'bgz:ct': 'background-size:contain;', -\ 'bgz:cv': 'background-size:cover;', -\ 'c': 'color:#000;', -\ 'tbl': 'table-layout:|;', -\ 'tbl:a': 'table-layout:auto;', -\ 'tbl:f': 'table-layout:fixed;', -\ 'cps': 'caption-side:|;', -\ 'cps:t': 'caption-side:top;', -\ 'cps:b': 'caption-side:bottom;', -\ 'ec': 'empty-cells:|;', -\ 'ec:s': 'empty-cells:show;', -\ 'ec:h': 'empty-cells:hide;', -\ 'lis': 'list-style:|;', -\ 'lis:n': 'list-style:none;', -\ 'lisp': 'list-style-position:|;', -\ 'lisp:i': 'list-style-position:inside;', -\ 'lisp:o': 'list-style-position:outside;', -\ 'list': 'list-style-type:|;', -\ 'list:n': 'list-style-type:none;', -\ 'list:d': 'list-style-type:disc;', -\ 'list:c': 'list-style-type:circle;', -\ 'list:s': 'list-style-type:square;', -\ 'list:dc': 'list-style-type:decimal;', -\ 'list:dclz': 'list-style-type:decimal-leading-zero;', -\ 'list:lr': 'list-style-type:lower-roman;', -\ 'list:ur': 'list-style-type:upper-roman;', -\ 'lisi': 'list-style-image:|;', -\ 'lisi:n': 'list-style-image:none;', -\ 'q': 'quotes:|;', -\ 'q:n': 'quotes:none;', -\ 'q:ru': 'quotes:''\00AB'' ''\00BB'' ''\201E'' ''\201C'';', -\ 'q:en': 'quotes:''\201C'' ''\201D'' ''\2018'' ''\2019'';', -\ 'ct': 'content:|;', -\ 'ct:n': 'content:normal;', -\ 'ct:oq': 'content:open-quote;', -\ 'ct:noq': 'content:no-open-quote;', -\ 'ct:cq': 'content:close-quote;', -\ 'ct:ncq': 'content:no-close-quote;', -\ 'ct:a': 'content:attr(|);', -\ 'ct:c': 'content:counter(|);', -\ 'ct:cs': 'content:counters(|);', -\ 'coi': 'counter-increment:|;', -\ 'cor': 'counter-reset:|;', -\ 'va': 'vertical-align:|;', -\ 'va:sup': 'vertical-align:super;', -\ 'va:t': 'vertical-align:top;', -\ 'va:tt': 'vertical-align:text-top;', -\ 'va:m': 'vertical-align:middle;', -\ 'va:bl': 'vertical-align:baseline;', -\ 'va:b': 'vertical-align:bottom;', -\ 'va:tb': 'vertical-align:text-bottom;', -\ 'va:sub': 'vertical-align:sub;', -\ 'ta': 'text-align:|;', -\ 'ta:l': 'text-align:left;', -\ 'ta:c': 'text-align:center;', -\ 'ta:r': 'text-align:right;', -\ 'tal': 'text-align-last:|;', -\ 'tal:a': 'text-align-last:auto;', -\ 'tal:l': 'text-align-last:left;', -\ 'tal:c': 'text-align-last:center;', -\ 'tal:r': 'text-align-last:right;', -\ 'td': 'text-decoration:|;', -\ 'td:n': 'text-decoration:none;', -\ 'td:u': 'text-decoration:underline;', -\ 'td:o': 'text-decoration:overline;', -\ 'td:l': 'text-decoration:line-through;', -\ 'te': 'text-emphasis:|;', -\ 'te:n': 'text-emphasis:none;', -\ 'te:ac': 'text-emphasis:accent;', -\ 'te:dt': 'text-emphasis:dot;', -\ 'te:c': 'text-emphasis:circle;', -\ 'te:ds': 'text-emphasis:disc;', -\ 'te:b': 'text-emphasis:before;', -\ 'te:a': 'text-emphasis:after;', -\ 'th': 'text-height:|;', -\ 'th:a': 'text-height:auto;', -\ 'th:f': 'text-height:font-size;', -\ 'th:t': 'text-height:text-size;', -\ 'th:m': 'text-height:max-size;', -\ 'ti': 'text-indent:|;', -\ 'ti:-': 'text-indent:-9999px;', -\ 'tj': 'text-justify:|;', -\ 'tj:a': 'text-justify:auto;', -\ 'tj:iw': 'text-justify:inter-word;', -\ 'tj:ii': 'text-justify:inter-ideograph;', -\ 'tj:ic': 'text-justify:inter-cluster;', -\ 'tj:d': 'text-justify:distribute;', -\ 'tj:k': 'text-justify:kashida;', -\ 'tj:t': 'text-justify:tibetan;', -\ 'to': 'text-outline:|;', -\ 'to+': 'text-outline:0 0 #000;', -\ 'to:n': 'text-outline:none;', -\ 'tr': 'text-replace:|;', -\ 'tr:n': 'text-replace:none;', -\ 'tt': 'text-transform:|;', -\ 'tt:n': 'text-transform:none;', -\ 'tt:c': 'text-transform:capitalize;', -\ 'tt:u': 'text-transform:uppercase;', -\ 'tt:l': 'text-transform:lowercase;', -\ 'tw': 'text-wrap:|;', -\ 'tw:n': 'text-wrap:normal;', -\ 'tw:no': 'text-wrap:none;', -\ 'tw:u': 'text-wrap:unrestricted;', -\ 'tw:s': 'text-wrap:suppress;', -\ 'tsh': 'text-shadow:|;', -\ 'tsh+': 'text-shadow:0 0 0 #000;', -\ 'tsh:n': 'text-shadow:none;', -\ 'lh': 'line-height:|;', -\ 'whs': 'white-space:|;', -\ 'whs:n': 'white-space:normal;', -\ 'whs:p': 'white-space:pre;', -\ 'whs:nw': 'white-space:nowrap;', -\ 'whs:pw': 'white-space:pre-wrap;', -\ 'whs:pl': 'white-space:pre-line;', -\ 'whsc': 'white-space-collapse:|;', -\ 'whsc:n': 'white-space-collapse:normal;', -\ 'whsc:k': 'white-space-collapse:keep-all;', -\ 'whsc:l': 'white-space-collapse:loose;', -\ 'whsc:bs': 'white-space-collapse:break-strict;', -\ 'whsc:ba': 'white-space-collapse:break-all;', -\ 'wob': 'word-break:|;', -\ 'wob:n': 'word-break:normal;', -\ 'wob:k': 'word-break:keep-all;', -\ 'wob:l': 'word-break:loose;', -\ 'wob:bs': 'word-break:break-strict;', -\ 'wob:ba': 'word-break:break-all;', -\ 'wos': 'word-spacing:|;', -\ 'wow': 'word-wrap:|;', -\ 'wow:nm': 'word-wrap:normal;', -\ 'wow:n': 'word-wrap:none;', -\ 'wow:u': 'word-wrap:unrestricted;', -\ 'wow:s': 'word-wrap:suppress;', -\ 'lts': 'letter-spacing:|;', -\ 'f': 'font:|;', -\ 'f+': 'font:1em Arial,sans-serif;', -\ 'fw': 'font-weight:|;', -\ 'fw:n': 'font-weight:normal;', -\ 'fw:b': 'font-weight:bold;', -\ 'fw:br': 'font-weight:bolder;', -\ 'fw:lr': 'font-weight:lighter;', -\ 'fs': 'font-style:|;', -\ 'fs:n': 'font-style:normal;', -\ 'fs:i': 'font-style:italic;', -\ 'fs:o': 'font-style:oblique;', -\ 'fv': 'font-variant:|;', -\ 'fv:n': 'font-variant:normal;', -\ 'fv:sc': 'font-variant:small-caps;', -\ 'fz': 'font-size:|;', -\ 'fza': 'font-size-adjust:|;', -\ 'fza:n': 'font-size-adjust:none;', -\ 'ff': 'font-family:|;', -\ 'ff:s': 'font-family:serif;', -\ 'ff:ss': 'font-family:sans-serif;', -\ 'ff:c': 'font-family:cursive;', -\ 'ff:f': 'font-family:fantasy;', -\ 'ff:m': 'font-family:monospace;', -\ 'fef': 'font-effect:|;', -\ 'fef:n': 'font-effect:none;', -\ 'fef:eg': 'font-effect:engrave;', -\ 'fef:eb': 'font-effect:emboss;', -\ 'fef:o': 'font-effect:outline;', -\ 'fem': 'font-emphasize:|;', -\ 'femp': 'font-emphasize-position:|;', -\ 'femp:b': 'font-emphasize-position:before;', -\ 'femp:a': 'font-emphasize-position:after;', -\ 'fems': 'font-emphasize-style:|;', -\ 'fems:n': 'font-emphasize-style:none;', -\ 'fems:ac': 'font-emphasize-style:accent;', -\ 'fems:dt': 'font-emphasize-style:dot;', -\ 'fems:c': 'font-emphasize-style:circle;', -\ 'fems:ds': 'font-emphasize-style:disc;', -\ 'fsm': 'font-smooth:|;', -\ 'fsm:a': 'font-smooth:auto;', -\ 'fsm:n': 'font-smooth:never;', -\ 'fsm:aw': 'font-smooth:always;', -\ 'fst': 'font-stretch:|;', -\ 'fst:n': 'font-stretch:normal;', -\ 'fst:uc': 'font-stretch:ultra-condensed;', -\ 'fst:ec': 'font-stretch:extra-condensed;', -\ 'fst:c': 'font-stretch:condensed;', -\ 'fst:sc': 'font-stretch:semi-condensed;', -\ 'fst:se': 'font-stretch:semi-expanded;', -\ 'fst:e': 'font-stretch:expanded;', -\ 'fst:ee': 'font-stretch:extra-expanded;', -\ 'fst:ue': 'font-stretch:ultra-expanded;', -\ 'op': 'opacity:|;', -\ 'op:ie': 'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);', -\ 'op:ms': '-ms-filter:''progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'';', -\ 'rz': 'resize:|;', -\ 'rz:n': 'resize:none;', -\ 'rz:b': 'resize:both;', -\ 'rz:h': 'resize:horizontal;', -\ 'rz:v': 'resize:vertical;', -\ 'cur': 'cursor:|;', -\ 'cur:a': 'cursor:auto;', -\ 'cur:d': 'cursor:default;', -\ 'cur:c': 'cursor:crosshair;', -\ 'cur:ha': 'cursor:hand;', -\ 'cur:he': 'cursor:help;', -\ 'cur:m': 'cursor:move;', -\ 'cur:p': 'cursor:pointer;', -\ 'cur:t': 'cursor:text;', -\ 'pgbb': 'page-break-before:|;', -\ 'pgbb:au': 'page-break-before:auto;', -\ 'pgbb:al': 'page-break-before:always;', -\ 'pgbb:l': 'page-break-before:left;', -\ 'pgbb:r': 'page-break-before:right;', -\ 'pgbi': 'page-break-inside:|;', -\ 'pgbi:au': 'page-break-inside:auto;', -\ 'pgbi:av': 'page-break-inside:avoid;', -\ 'pgba': 'page-break-after:|;', -\ 'pgba:au': 'page-break-after:auto;', -\ 'pgba:al': 'page-break-after:always;', -\ 'pgba:l': 'page-break-after:left;', -\ 'pgba:r': 'page-break-after:right;', -\ 'orp': 'orphans:|;', -\ 'wid': 'widows:|;' -\ }, -\ 'filters': 'fc' -\ }, -\ 'sass': { -\ 'extends': 'css', -\ 'snippets': { -\ '@if': "@if {\n\t|\n}", -\ '@e': "@else {\n\t|\n}", -\ '@in': "@include |", -\ '@ex': "@extend |", -\ '@mx': "@mixin {\n\t|\n}", -\ '@fn': "@function {\n\t|\n}", -\ '@r': "@return |", -\ }, -\ }, -\ 'scss': { -\ 'extends': 'css', -\ }, -\ 'less': { -\ 'extends': 'css', -\ }, -\ 'css.drupal': { -\ 'extends': 'css', -\ }, -\ 'html': { -\ 'snippets': { -\ 'cc:ie6': "", -\ 'cc:ie': "", -\ 'cc:noie': "\n\t${child}|\n", -\ 'html:4t': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:4s': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xt': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xs': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:xxs': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."", -\ 'html:5': "\n" -\ ."\n" -\ ."\n" -\ ."\t\n" -\ ."\t\n" -\ ."\n" -\ ."\n\t${child}|\n\n" -\ ."" -\ }, -\ 'default_attributes': { -\ 'a': {'href': ''}, -\ 'a:link': {'href': 'http://|'}, -\ 'a:mail': {'href': 'mailto:|'}, -\ 'abbr': {'title': ''}, -\ 'acronym': {'title': ''}, -\ 'base': {'href': ''}, -\ 'bdo': {'dir': ''}, -\ 'bdo:r': {'dir': 'rtl'}, -\ 'bdo:l': {'dir': 'ltr'}, -\ 'del': {'datetime': '${datetime}'}, -\ 'ins': {'datetime': '${datetime}'}, -\ 'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}], -\ 'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}], -\ 'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}], -\ 'link:touch': [{'rel': 'apple-touch-icon'}, {'href': '|favicon.png'}], -\ 'link:rss': [{'rel': 'alternate'}, {'type': 'application/rss+xml'}, {'title': 'RSS'}, {'href': '|rss.xml'}], -\ 'link:atom': [{'rel': 'alternate'}, {'type': 'application/atom+xml'}, {'title': 'Atom'}, {'href': 'atom.xml'}], -\ 'meta:utf': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=UTF-8'}], -\ 'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}], -\ 'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}], -\ 'style': {'type': 'text/css'}, -\ 'script': {'type': 'text/javascript'}, -\ 'script:src': [{'type': 'text/javascript'}, {'src': ''}], -\ 'img': [{'src': ''}, {'alt': ''}], -\ 'iframe': [{'src': ''}, {'frameborder': '0'}], -\ 'embed': [{'src': ''}, {'type': ''}], -\ 'object': [{'data': ''}, {'type': ''}], -\ 'param': [{'name': ''}, {'value': ''}], -\ 'map': {'name': ''}, -\ 'area': [{'shape': ''}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:d': [{'shape': 'default'}, {'href': ''}, {'alt': ''}], -\ 'area:c': [{'shape': 'circle'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}], -\ 'link': [{'rel': 'stylesheet'}, {'href': ''}], -\ 'form': {'action': ''}, -\ 'form:get': {'action': '', 'method': 'get'}, -\ 'form:post': {'action': '', 'method': 'post'}, -\ 'form:upload': {'action': '', 'method': 'post', 'enctype': 'multipart/form-data'}, -\ 'label': {'for': ''}, -\ 'input': {'type': ''}, -\ 'input:hidden': [{'type': 'hidden'}, {'name': ''}], -\ 'input:h': [{'type': 'hidden'}, {'name': ''}], -\ 'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}], -\ 'input:t': [{'type': 'text'}, {'name': ''}, {'id': ''}], -\ 'input:search': [{'type': 'search'}, {'name': ''}, {'id': ''}], -\ 'input:email': [{'type': 'email'}, {'name': ''}, {'id': ''}], -\ 'input:url': [{'type': 'url'}, {'name': ''}, {'id': ''}], -\ 'input:password': [{'type': 'password'}, {'name': ''}, {'id': ''}], -\ 'input:p': [{'type': 'password'}, {'name': ''}, {'id': ''}], -\ 'input:datetime': [{'type': 'datetime'}, {'name': ''}, {'id': ''}], -\ 'input:date': [{'type': 'date'}, {'name': ''}, {'id': ''}], -\ 'input:datetime-local': [{'type': 'datetime-local'}, {'name': ''}, {'id': ''}], -\ 'input:month': [{'type': 'month'}, {'name': ''}, {'id': ''}], -\ 'input:week': [{'type': 'week'}, {'name': ''}, {'id': ''}], -\ 'input:time': [{'type': 'time'}, {'name': ''}, {'id': ''}], -\ 'input:number': [{'type': 'number'}, {'name': ''}, {'id': ''}], -\ 'input:color': [{'type': 'color'}, {'name': ''}, {'id': ''}], -\ 'input:checkbox': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}], -\ 'input:c': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}], -\ 'input:radio': [{'type': 'radio'}, {'name': ''}, {'id': ''}], -\ 'input:r': [{'type': 'radio'}, {'name': ''}, {'id': ''}], -\ 'input:range': [{'type': 'range'}, {'name': ''}, {'id': ''}], -\ 'input:file': [{'type': 'file'}, {'name': ''}, {'id': ''}], -\ 'input:f': [{'type': 'file'}, {'name': ''}, {'id': ''}], -\ 'input:submit': [{'type': 'submit'}, {'value': ''}], -\ 'input:s': [{'type': 'submit'}, {'value': ''}], -\ 'input:image': [{'type': 'image'}, {'src': ''}, {'alt': ''}], -\ 'input:i': [{'type': 'image'}, {'src': ''}, {'alt': ''}], -\ 'input:reset': [{'type': 'reset'}, {'value': ''}], -\ 'input:button': [{'type': 'button'}, {'value': ''}], -\ 'input:b': [{'type': 'button'}, {'value': ''}], -\ 'select': [{'name': ''}, {'id': ''}], -\ 'option': {'value': ''}, -\ 'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}], -\ 'menu:context': {'type': 'context'}, -\ 'menu:c': {'type': 'context'}, -\ 'menu:toolbar': {'type': 'toolbar'}, -\ 'menu:t': {'type': 'toolbar'}, -\ 'video': {'src': ''}, -\ 'audio': {'src': ''}, -\ 'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': '${lang}'}] -\ }, -\ 'aliases': { -\ 'link:*': 'link', -\ 'meta:*': 'meta', -\ 'area:*': 'area', -\ 'bdo:*': 'bdo', -\ 'form:*': 'form', -\ 'input:*': 'input', -\ 'script:*': 'script', -\ 'html:*': 'html', -\ 'a:*': 'a', -\ 'menu:*': 'menu', -\ 'bq': 'blockquote', -\ 'acr': 'acronym', -\ 'fig': 'figure', -\ 'ifr': 'iframe', -\ 'emb': 'embed', -\ 'obj': 'object', -\ 'src': 'source', -\ 'cap': 'caption', -\ 'colg': 'colgroup', -\ 'fst': 'fieldset', -\ 'btn': 'button', -\ 'optg': 'optgroup', -\ 'opt': 'option', -\ 'tarea': 'textarea', -\ 'leg': 'legend', -\ 'sect': 'section', -\ 'art': 'article', -\ 'hdr': 'header', -\ 'ftr': 'footer', -\ 'adr': 'address', -\ 'dlg': 'dialog', -\ 'str': 'strong', -\ 'sty': 'style', -\ 'prog': 'progress', -\ 'fset': 'fieldset', -\ 'datag': 'datagrid', -\ 'datal': 'datalist', -\ 'kg': 'keygen', -\ 'out': 'output', -\ 'det': 'details', -\ 'cmd': 'command' -\ }, -\ 'expandos': { -\ 'ol': 'ol>li', -\ 'ul': 'ul>li', -\ 'dl': 'dl>dt+dd', -\ 'map': 'map>area', -\ 'table': 'table>tr>td', -\ 'colgroup': 'colgroup>col', -\ 'colg': 'colgroup>col', -\ 'tr': 'tr>td', -\ 'select': 'select>option', -\ 'optgroup': 'optgroup>option', -\ 'optg': 'optgroup>option' -\ }, -\ 'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command', -\ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6', -\ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var', -\ 'empty_element_suffix': ' />' -\ }, -\ 'htmldjango': { -\ 'extends': 'html', -\ }, -\ 'html.django_template': { -\ 'extends': 'html', -\ }, -\ 'xsl': { -\ 'extends': 'html', -\ 'default_attributes': { -\ 'tmatch': [{'match': ''}, {'mode': ''}], -\ 'tname': [{'name': ''}], -\ 'xsl:when': {'test': ''}, -\ 'var': [{'name': ''}, {'select': ''}], -\ 'vari': {'name': ''}, -\ 'if': {'test': ''}, -\ 'call': {'name': ''}, -\ 'attr': {'name': ''}, -\ 'wp': [{'name': ''}, {'select': ''}], -\ 'par': [{'name': ''}, {'select': ''}], -\ 'val': {'select': ''}, -\ 'co': {'select': ''}, -\ 'each': {'select': ''}, -\ 'ap': [{'select': ''}, {'mode': ''}] -\ }, -\ 'aliases': { -\ 'tmatch': 'xsl:template', -\ 'tname': 'xsl:template', -\ 'var': 'xsl:variable', -\ 'vari': 'xsl:variable', -\ 'if': 'xsl:if', -\ 'choose': 'xsl:choose', -\ 'call': 'xsl:call-template', -\ 'wp': 'xsl:with-param', -\ 'par': 'xsl:param', -\ 'val': 'xsl:value-of', -\ 'attr': 'xsl:attribute', -\ 'co' : 'xsl:copy-of', -\ 'each' : 'xsl:for-each', -\ 'ap' : 'xsl:apply-templates' -\ }, -\ 'expandos': { -\ 'choose': 'xsl:choose>xsl:when+xsl:otherwise' -\ } -\ }, -\ 'xslt': { -\ 'extends': 'xsl', -\ }, -\ 'haml': { -\ 'indentation': ' ', -\ 'extends': 'html', -\ 'snippets': { -\ 'html:5': "!!! 5\n" -\ ."%html{:lang => \"${lang}\"}\n" -\ ."\t%head\n" -\ ."\t\t%meta{:charset => \"${charset}\"}\n" -\ ."\t\t%title\n" -\ ."\t%body\n" -\ ."\t\t${child}|\n" -\ }, -\ }, -\ 'slim': { -\ 'indentation': ' ', -\ 'extends': 'html', -\ 'snippets': { -\ 'html:5': "doctype 5\n" -\ ."html lang=\"${lang}\"\n" -\ ."\thead\n" -\ ."\t\tmeta charset=\"${charset}\"\n" -\ ."\t\ttitle\n" -\ ."\tbody\n" -\ ."\t\t${child}|\n" -\ }, -\ }, -\ 'xhtml': { -\ 'extends': 'html' -\ }, -\ 'mustache': { -\ 'extends': 'html' -\ }, -\ 'xsd': { -\ 'extends': 'html', -\ 'snippets': { -\ 'xsd:w3c': "\n" -\ ."\n" -\ ."\t\n" -\ ."\n" -\ } -\ } -\} - -if exists('g:user_zen_settings') - call s:mergeConfig(s:zen_settings, g:user_zen_settings) -endif - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et: diff --git a/sources_forked/zencoding/autoload/zencoding/lang.vim b/sources_forked/zencoding/autoload/zencoding/lang.vim deleted file mode 100755 index a9735991..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang.vim +++ /dev/null @@ -1,11 +0,0 @@ -let s:exists = {} -function zencoding#lang#exists(type) - if len(a:type) == 0 - return 0 - elseif has_key(s:exists, a:type) - return s:exists[a:type] - endif - let s:exists[a:type] = len(globpath(&rtp, 'autoload/zencoding/lang/'.a:type.'.vim')) > 0 - return s:exists[a:type] -endfunction - diff --git a/sources_forked/zencoding/autoload/zencoding/lang/css.vim b/sources_forked/zencoding/autoload/zencoding/lang/css.vim deleted file mode 100755 index 5b1c1182..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/css.vim +++ /dev/null @@ -1,228 +0,0 @@ -function! zencoding#lang#css#findTokens(str) - return substitute(a:str, '^.*[;{]\s*', '', '') -endfunction - -function! zencoding#lang#css#parseIntoTree(abbr, type) - let abbr = a:abbr - let type = a:type - let prefix = 0 - let value = '' - - let settings = zencoding#getSettings() - let indent = zencoding#getIndentation(type) - - let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': 0 } - - " emmet - let tokens = split(abbr, '+\ze[^)!]') - for n in range(len(tokens)) - let token = tokens[n] - let prop = matchlist(token, '^\(-\{0,1}[a-zA-Z]\+\|[a-zA-Z0-9]\++\{0,1}\|([a-zA-Z0-9]\++\{0,1})\)\(\%([0-9.-]\+[pe]\{0,1}-\{0,1}\|-auto\)*\)$') - if len(prop) - let token = substitute(prop[1], '^(\(.*\))', '\1', '') - if token =~ '^-' - let prefix = 1 - let token = token[1:] - endif - let value = '' - for v in split(prop[2], '\d\zs-') - if len(value) > 0 - let value .= ' ' - endif - if token =~ '^[z]' - " TODO - let value .= substitute(v, '[^0-9.]*$', '', '') - elseif v =~ 'p$' - let value .= substitute(v, 'p$', '%', '') - elseif v =~ 'e$' - let value .= substitute(v, 'e$', 'em', '') - elseif v =~ '\.' - let value .= v . 'em' - elseif v == 'auto' - let value .= v - else - let value .= v . 'px' - endif - endfor - endif - - let tag_name = token - if tag_name =~ '.!$' - let tag_name = tag_name[:-2] - let important = 1 - else - let important = 0 - endif - " make default node - let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': important } - let current.name = tag_name - - " aliases - let aliases = zencoding#getResource(type, 'aliases', {}) - if has_key(aliases, tag_name) - let current.name = aliases[tag_name] - endif - let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1) - - " snippets - let snippets = zencoding#getResource(type, 'snippets', {}) - if !empty(snippets) && has_key(snippets, tag_name) - let snippet = snippets[tag_name] - if use_pipe_for_cursor - let snippet = substitute(snippet, '|', '${cursor}', 'g') - endif - let lines = split(snippet, "\n") - call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")') - let current.snippet = join(lines, "\n") - let current.name = '' - let current.snippet = substitute(current.snippet, ';', value . ';', '') - if use_pipe_for_cursor && len(value) > 0 && stridx(value, '${cursor}') == -1 - let current.snippet = substitute(current.snippet, '${cursor}', '', 'g') . '${cursor}' - endif - if n < len(tokens) - 1 - let current.snippet .= "\n" - endif - endif - - let current.pos = 0 - let lg = matchlist(token, '^\%(linear-gradient\|lg\)(\s*\(\w\+\)\s*,\s*\([^,]\+\)\s*,\s*\([^)]\+\)\s*)$') - if len(lg) - let current.name = '' - let current.snippet = printf("background-image: -webkit-gradient(%s, 0 0, 0 100%, from(%s), to(%s));\n", lg[1], lg[2], lg[3]) - call add(root.child, deepcopy(current)) - let current.snippet = printf("background-image: -webkit-linear-gradient(%s, %s);\n", lg[2], lg[3]) - call add(root.child, deepcopy(current)) - let current.snippet = printf("background-image: -moz-linear-gradient(%s, %s);\n", lg[2], lg[3]) - call add(root.child, deepcopy(current)) - let current.snippet = printf("background-image: -o-linear-gradient(%s, %s);\n", lg[2], lg[3]) - call add(root.child, deepcopy(current)) - let current.snippet = printf("background-image: linear-gradient(%s, %s);\n", lg[2], lg[3]) - call add(root.child, deepcopy(current)) - elseif prefix - let snippet = current.snippet - let current.snippet = '-webkit-' . snippet . "\n" - call add(root.child, deepcopy(current)) - let current.snippet = '-moz-' . snippet . "\n" - call add(root.child, deepcopy(current)) - let current.snippet = snippet - call add(root.child, current) - else - call add(root.child, current) - endif - endfor - return root -endfunction - -function! zencoding#lang#css#toString(settings, current, type, inline, filters, itemno, indent) - let current = a:current - let value = current.value[1:-2] - if zencoding#useFilter(a:filters, 'fc') - let value = substitute(value, '\([^:]\+\):\([^;]*;\)', '\1: \2', 'g') - else - let value = substitute(value, '\([^:]\+\):\([^;]*;\)', '\1:\2', 'g') - endif - if current.important - let value = substitute(value, ';', ' !important;', '') - endif - return value -endfunction - -function! zencoding#lang#css#imageSize() -endfunction - -function! zencoding#lang#css#encodeImage() -endfunction - -function! zencoding#lang#css#parseTag(tag) - return {} -endfunction - -function! zencoding#lang#css#toggleComment() - let line = getline('.') - let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$' - if line =~ '{\s*$' - let block = zencoding#util#searchRegion('/\*', '\*/\zs') - if zencoding#util#regionIsValid(block) - let content = zencoding#util#getContent(block) - let content = substitute(content, '/\*\s\(.*\)\s\*/', '\1', '') - call zencoding#util#setContent(block, content) - else - let node = expand('') - if len(node) - exe "normal ciw\='/* '.node.' */'\" - endif - endif - else - if line =~ mx - let space = substitute(matchstr(line, mx), mx, '\1', '') - let line = substitute(matchstr(line, mx), mx, '\2', '') - let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g') - else - let mx = '^\(\s*\)\(.*\)\s*$' - let line = substitute(line, mx, '\1/* \2 */', '') - endif - call setline('.', line) - endif -endfunction - -function! zencoding#lang#css#balanceTag(flag) range - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - let block = zencoding#util#getVisualBlock() - if !zencoding#util#regionIsValid(block) - if a:flag > 0 - let block = zencoding#util#searchRegion('^', ';') - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endif - else - if a:flag > 0 - let content = zencoding#util#getContent(block) - if content !~ '^{.*}$' - let block = zencoding#util#searchRegion('{', '}') - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endif - else - let pos = searchpos('.*;', 'nW') - if pos[0] != 0 - call setpos('.', [0, pos[0], pos[1], 0]) - let block = zencoding#util#searchRegion('^', ';') - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endif - endif - endif - if a:flag == -2 || a:flag == 2 - silent! exe "normal! gv" - else - call setpos('.', curpos) - endif -endfunction - -function! zencoding#lang#css#moveNextPrev(flag) - let pos = search('""\|()\|\(:\s*\zs$\)', a:flag ? 'Wbp' : 'Wp') - if pos == 2 - startinsert! - else - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#lang#css#splitJoinTag() - " nothing to do -endfunction - -function! zencoding#lang#css#removeTag() - " nothing to do -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/lang/haml.vim b/sources_forked/zencoding/autoload/zencoding/lang/haml.vim deleted file mode 100755 index be421c1c..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/haml.vim +++ /dev/null @@ -1,310 +0,0 @@ -function! zencoding#lang#haml#findTokens(str) - return zencoding#lang#html#findTokens(a:str) -endfunction - -function! zencoding#lang#haml#parseIntoTree(abbr, type) - return zencoding#lang#html#parseIntoTree(a:abbr, a:type) -endfunction - -function! zencoding#lang#haml#toString(settings, current, type, inline, filters, itemno, indent) - let settings = a:settings - let current = a:current - let type = a:type - let inline = a:inline - let filters = a:filters - let itemno = a:itemno - let indent = a:indent - let dollar_expr = zencoding#getResource(type, 'dollar_expr', 1) - let str = "" - - let comment_indent = '' - let comment = '' - let current_name = current.name - if dollar_expr - let current_name = substitute(current.name, '\$$', itemno+1, '') - endif - if len(current.name) > 0 - let str .= '%' . current_name - let tmp = '' - for attr in current.attrs_order - if !has_key(current.attr, attr) - continue - endif - let val = current.attr[attr] - if dollar_expr - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - let attr = substitute(attr, '\$$', itemno+1, '') - endif - let valtmp = substitute(val, '\${cursor}', '', '') - if attr == 'id' && len(valtmp) > 0 - let str .= '#' . val - elseif attr == 'class' && len(valtmp) > 0 - let str .= '.' . substitute(val, ' ', '.', 'g') - else - if len(tmp) > 0 | let tmp .= ',' | endif - let val = substitute(val, '\${cursor}', '', '') - let tmp .= ' :' . attr . ' => "' . val . '"' - endif - endfor - if len(tmp) - let str .= '{' . tmp . ' }' - endif - if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 && len(current.value) == 0 - let str .= "/" - endif - - let inner = '' - if len(current.value) > 0 - let text = current.value[1:-2] - if dollar_expr - let text = substitute(text, '\%(\\\)\@\ 0 - for child in current.child - let inner .= zencoding#toString(child, type, inline, filters, itemno) - endfor - let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g') - let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g') - let str .= "\n" . indent . inner - endif - else - let str = current.value[1:-2] - if dollar_expr - let str = substitute(str, '\%(\\\)\@\\s*\%(\([^"'' \t]\+\)\|"\([^"]\{-}\)"\|''\([^'']\{-}\)''\)' - while len(attrs) > 0 - let match = matchstr(attrs, mx) - if len(match) == 0 - break - endif - let attr_match = matchlist(match, mx) - let name = attr_match[1] - let value = len(attr_match[2]) ? attr_match[2] : attr_match[3] - let current.attr[name] = value - let current.attrs_order += [name] - let attrs = attrs[stridx(attrs, match) + len(match):] - endwhile - return current -endfunction - -function! zencoding#lang#haml#toggleComment() - let line = getline('.') - let space = matchstr(line, '^\s*') - if line =~ '^\s*-#' - call setline('.', space . matchstr(line[len(space)+2:], '^\s*\zs.*')) - elseif line =~ '^\s*%[a-z]' - call setline('.', space . '-# ' . line[len(space):]) - endif -endfunction - -function! zencoding#lang#haml#balanceTag(flag) range - let block = zencoding#util#getVisualBlock() - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - let n = curpos[1] - let ml = len(matchstr(getline(n), '^\s*')) - - if a:flag > 0 - if a:flag == 1 || !zencoding#util#regionIsValid(block) - let n = line('.') - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze%[a-z]')) - if l > 0 && l < ml - let ml = l - break - endif - let n -= 1 - endwhile - endif - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*%[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze[a-z]')) - if l > 0 && l > ml - let ml = l - break - endif - let n += 1 - endwhile - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*%[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - endif -endfunction - -function! zencoding#lang#haml#moveNextPrev(flag) - let pos = search('""', a:flag ? 'Wb' : 'W') - if pos != 0 - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#lang#haml#splitJoinTag() - let n = line('.') - let sml = len(matchstr(getline(n), '^\s*%[a-z]')) - while n > 0 - if getline(n) =~ '^\s*\ze%[a-z]' - if len(matchstr(getline(n), '^\s*%[a-z]')) < sml - break - endif - let line = getline(n) - call setline(n, substitute(line, '^\s*%\w\+\%(\s*{[^}]*}\|\s\)\zs.*', '', '')) - let sn = n - let n += 1 - let ml = len(matchstr(getline(n), '^\s*%[a-z]')) - if len(matchstr(getline(n), '^\s*')) > ml - while n <= line('$') - let l = len(matchstr(getline(n), '^\s*')) - if l <= ml - break - endif - exe n "delete" - endwhile - call setpos('.', [0, sn, 1, 0]) - else - let tag = matchstr(getline(sn), '^\s*%\zs\(\w\+\)') - let spaces = matchstr(getline(sn), '^\s*') - let settings = zencoding#getSettings() - if stridx(','.settings.html.inline_elements.',', ','.tag.',') == -1 - call append(sn, spaces . ' ') - call setpos('.', [0, sn+1, 1, 0]) - else - call setpos('.', [0, sn, 1, 0]) - endif - startinsert! - endif - break - endif - let n -= 1 - endwhile -endfunction - -function! zencoding#lang#haml#removeTag() - let n = line('.') - let ml = 0 - while n > 0 - if getline(n) =~ '^\s*\ze[a-z]' - let ml = len(matchstr(getline(n), '^\s*%[a-z]')) - break - endif - let n -= 1 - endwhile - let sn = n - while n < line('$') - let l = len(matchstr(getline(n), '^\s*%[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - if sn == n - exe "delete" - else - exe sn "," (n-1) "delete" - endif -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/lang/html.vim b/sources_forked/zencoding/autoload/zencoding/lang/html.vim deleted file mode 100755 index d7a1e634..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/html.vim +++ /dev/null @@ -1,692 +0,0 @@ -let s:mx = '\([+>]\|[<^]\+\)\{-}\s*' -\ .'\((*\)\{-}\s*' -\ .'\([@#.]\{-}[a-zA-Z\!][a-zA-Z0-9:_\!\-$]*\|{\%([^$}]\+\|\$#\|\${\w\+}\|\$\+\)*}[ \t\r\n}]*\)' -\ .'\(' -\ .'\%(' -\ .'\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)' -\ .'\|\%(\[[^\]]\+\]\)' -\ .'\|\%(\.{[{}a-zA-Z0-9_\-\$]\+\|\.[a-zA-Z0-9_\-\$]\+\)' -\ .'\)*' -\ .'\)' -\ .'\%(\({\%([^$}]\+\|\$#\|\${\w\+}\|\$\+\)*}\)\)\{0,1}' -\ .'\%(\*\([0-9]\+\)\)\{0,1}' -\ .'\(\%()\%(\*[0-9]\+\)\{0,1}\)*\)' - -function! zencoding#lang#html#findTokens(str) - let str = a:str - let [pos, last_pos] = [0, 0] - while 1 - let tag = matchstr(str, '<[a-zA-Z].\{-}>', pos) - if len(tag) == 0 - break - endif - let pos = stridx(str, tag, pos) + len(tag) - endwhile - let last_pos = pos - while len(str) > 0 - let token = matchstr(str, s:mx, pos) - if token == '' - break - endif - if token =~ '^\s' - let token = matchstr(token, '^\s*\zs.*') - let last_pos = stridx(str, token, pos) - endif - let pos = stridx(str, token, pos) + len(token) - endwhile - return a:str[last_pos :-1] -endfunction - -function! zencoding#lang#html#parseIntoTree(abbr, type) - let abbr = a:abbr - let type = a:type - - let settings = zencoding#getSettings() - if !has_key(settings, type) - let type = 'html' - endif - if len(type) == 0 | let type = 'html' | endif - - let settings = zencoding#getSettings() - let indent = zencoding#getIndentation(type) - - " try 'foo' to (foo-x) - let rabbr = zencoding#getExpandos(type, abbr) - if rabbr == abbr - " try 'foo+(' to (foo-x) - let rabbr = substitute(abbr, '\%(+\|^\)\([a-zA-Z][a-zA-Z0-9+]\+\)+\([(){}>]\|$\)', '\="(".zencoding#getExpandos(type, submatch(1)).")".submatch(2)', 'i') - endif - let abbr = rabbr - - let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': 0, 'attrs_order': ['id', 'class'] } - let parent = root - let last = root - let pos = [] - while len(abbr) - " parse line - let match = matchstr(abbr, s:mx) - let str = substitute(match, s:mx, '\0', 'ig') - let operator = substitute(match, s:mx, '\1', 'ig') - let block_start = substitute(match, s:mx, '\2', 'ig') - let tag_name = substitute(match, s:mx, '\3', 'ig') - let attributes = substitute(match, s:mx, '\4', 'ig') - let value = substitute(match, s:mx, '\5', 'ig') - let multiplier = 0 + substitute(match, s:mx, '\6', 'ig') - let block_end = substitute(match, s:mx, '\7', 'ig') - let important = 0 - if len(str) == 0 - break - endif - if tag_name =~ '^#' - let attributes = tag_name . attributes - let tag_name = 'div' - endif - if tag_name =~ '.!$' - let tag_name = tag_name[:-2] - let important = 1 - endif - if tag_name =~ '^\.' - let attributes = tag_name . attributes - let tag_name = 'div' - endif - if multiplier <= 0 | let multiplier = 1 | endif - - " make default node - let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': 0, 'attrs_order': ['id', 'class'] } - let current.name = tag_name - - let current.important = important - - " aliases - let aliases = zencoding#getResource(type, 'aliases', {}) - if has_key(aliases, tag_name) - let current.name = aliases[tag_name] - endif - - let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1) - - " snippets - let snippets = zencoding#getResource(type, 'snippets', {}) - if !empty(snippets) && has_key(snippets, tag_name) - let snippet = snippets[tag_name] - if use_pipe_for_cursor - let snippet = substitute(snippet, '|', '${cursor}', 'g') - endif - let lines = split(snippet, "\n") - call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")') - let current.snippet = join(lines, "\n") - let current.name = '' - endif - - " default_attributes - let default_attributes = zencoding#getResource(type, 'default_attributes', {}) - if !empty(default_attributes) - for pat in [current.name, tag_name] - if has_key(default_attributes, pat) - if type(default_attributes[pat]) == 4 - let a = default_attributes[pat] - let current.attrs_order += keys(a) - if use_pipe_for_cursor - for k in keys(a) - let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}' - endfor - else - for k in keys(a) - let current.attr[k] = a[k] - endfor - endif - else - for a in default_attributes[pat] - let current.attrs_order += keys(a) - if use_pipe_for_cursor - for k in keys(a) - let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}' - endfor - else - for k in keys(a) - let current.attr[k] = a[k] - endfor - endif - endfor - endif - if has_key(settings.html.default_attributes, current.name) - let current.name = substitute(current.name, ':.*$', '', '') - endif - break - endif - endfor - endif - - " parse attributes - if len(attributes) - let attr = attributes - while len(attr) - let item = matchstr(attr, '\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)*\)\)') - if len(item) == 0 - break - endif - if item[0] == '#' - let current.attr.id = item[1:] - endif - if item[0] == '.' - let current.attr.class = substitute(item[1:], '\.', ' ', 'g') - endif - if item[0] == '[' - let atts = item[1:-2] - while len(atts) - let amat = matchstr(atts, '\(\w\+\%(="[^"]*"\|=''[^'']*''\|[^ ''"\]]*\)\{0,1}\)') - if len(amat) == 0 - break - endif - let key = split(amat, '=')[0] - let val = amat[len(key)+1:] - if val =~ '^["'']' - let val = val[1:-2] - endif - let current.attr[key] = val - if index(current.attrs_order, key) == -1 - let current.attrs_order += [key] - endif - let atts = atts[stridx(atts, amat) + len(amat):] - endwhile - endif - let attr = substitute(strpart(attr, len(item)), '^\s*', '', '') - endwhile - endif - - " parse text - if tag_name =~ '^{.*}$' - let current.name = '' - let current.value = tag_name - else - let current.value = value - endif - let current.multiplier = multiplier - - " parse step inside/outside - if !empty(last) - if operator =~ '>' - unlet! parent - let parent = last - let current.parent = last - let current.pos = last.pos + 1 - else - let current.parent = parent - let current.pos = last.pos - endif - else - let current.parent = parent - let current.pos = 1 - endif - if operator =~ '[<^]' - for c in range(len(operator)) - let tmp = parent.parent - if empty(tmp) - break - endif - let parent = tmp - let current.parent = tmp - endfor - endif - - call add(parent.child, current) - let last = current - - " parse block - if block_start =~ '(' - if operator =~ '>' - let last.pos += 1 - endif - for n in range(len(block_start)) - let pos += [last.pos] - endfor - endif - if block_end =~ ')' - for n in split(substitute(substitute(block_end, ' ', '', 'g'), ')', ',),', 'g'), ',') - if n == ')' - if len(pos) > 0 && last.pos >= pos[-1] - for c in range(last.pos - pos[-1]) - let tmp = parent.parent - if !has_key(tmp, 'parent') - break - endif - let parent = tmp - endfor - if len(pos) > 0 - call remove(pos, -1) - endif - let last = parent - let last.pos += 1 - endif - elseif len(n) - let cl = last.child - let cls = [] - for c in range(n[1:]) - let cls += cl - endfor - let last.child = cls - endif - endfor - endif - let abbr = abbr[stridx(abbr, match) + len(match):] - - if g:zencoding_debug > 1 - echomsg "str=".str - echomsg "block_start=".block_start - echomsg "tag_name=".tag_name - echomsg "operator=".operator - echomsg "attributes=".attributes - echomsg "value=".value - echomsg "multiplier=".multiplier - echomsg "block_end=".block_end - echomsg "abbr=".abbr - echomsg "pos=".string(pos) - echomsg "---" - endif - endwhile - return root -endfunction - -function! zencoding#lang#html#toString(settings, current, type, inline, filters, itemno, indent) - let settings = a:settings - let current = a:current - let type = a:type - let inline = a:inline - let filters = a:filters - let itemno = a:itemno - let indent = a:indent - let dollar_expr = zencoding#getResource(type, 'dollar_expr', 1) - - if zencoding#useFilter(filters, 'haml') - return zencoding#lang#haml#toString(settings, current, type, inline, filters, itemno, indent) - endif - if zencoding#useFilter(filters, 'slim') - return zencoding#lang#slim#toString(settings, current, type, inline, filters, itemno, indent) - endif - - let comment = '' - let current_name = current.name - if dollar_expr - let current_name = substitute(current_name, '\$$', itemno+1, '') - endif - - let str = '' - if len(current_name) == 0 - let text = current.value[1:-2] - if dollar_expr - let text = substitute(text, '\%(\\\)\@\ 0 - let str .= '<' . current_name - for attr in current.attrs_order - if !has_key(current.attr, attr) - continue - endif - let val = current.attr[attr] - if dollar_expr - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - let attr = substitute(attr, '\$$', itemno+1, '') - endif - let str .= ' ' . attr . '="' . val . '"' - if zencoding#useFilter(filters, 'c') - if attr == 'id' | let comment .= '#' . val | endif - if attr == 'class' | let comment .= '.' . val | endif - endif - endfor - if len(comment) > 0 - let str = "\n" . str - endif - if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1 - let str .= settings.html.empty_element_suffix - else - let str .= ">" - let text = current.value[1:-2] - if dollar_expr - let text = substitute(text, '\%(\\\)\@\ 0 - for n in range(nc) - let child = current.child[n] - if child.multiplier > 1 - let str .= "\n" . indent - let dr = 1 - elseif len(current_name) > 0 && stridx(','.settings.html.inline_elements.',', ','.current_name.',') == -1 - if nc > 1 || (len(child.name) > 0 && stridx(','.settings.html.inline_elements.',', ','.child.name.',') == -1) - let str .= "\n" . indent - let dr = 1 - elseif current.multiplier == 1 && nc == 1 && len(child.name) == 0 - let str .= "\n" . indent - let dr = 1 - endif - endif - let inner = zencoding#toString(child, type, 0, filters, itemno) - let inner = substitute(inner, "^\n", "", 'g') - let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g') - let inner = substitute(inner, "\n" . escape(indent, '\') . '$', '', 'g') - let str .= inner - endfor - else - let str .= '${cursor}' - endif - if dr - let str .= "\n" - endif - let str .= "" - endif - if len(comment) > 0 - let str .= "\n" - endif - if len(current_name) > 0 && current.multiplier > 0 || stridx(','.settings.html.block_elements.',', ','.current_name.',') != -1 - let str .= "\n" - endif - return str -endfunction - -function! zencoding#lang#html#imageSize() - let img_region = zencoding#util#searchRegion('') - if !zencoding#util#regionIsValid(img_region) || !zencoding#util#cursorInRegion(img_region) - return - endif - let content = zencoding#util#getContent(img_region) - if content !~ '^<]\+>$' - return - endif - let current = zencoding#lang#html#parseTag(content) - if empty(current) || !has_key(current.attr, 'src') - return - endif - let fn = current.attr.src - if fn =~ '^\s*$' - return - elseif fn !~ '^\(/\|http\)' - let fn = simplify(expand('%:h') . '/' . fn) - endif - - let [width, height] = zencoding#util#getImageSize(fn) - if width == -1 && height == -1 - return - endif - let current.attr.width = width - let current.attr.height = height - let current.attrs_order += ['width', 'height'] - let html = substitute(zencoding#toString(current, 'html', 1), '\n', '', '') - let html = substitute(html, '\${cursor}', '', '') - call zencoding#util#setContent(img_region, html) -endfunction - -function! zencoding#lang#html#encodeImage() - let img_region = zencoding#util#searchRegion('') - if !zencoding#util#regionIsValid(img_region) || !zencoding#util#cursorInRegion(img_region) - return - endif - let content = zencoding#util#getContent(img_region) - if content !~ '^<]\+>$' - return - endif - let current = zencoding#lang#html#parseTag(content) - if empty(current) || !has_key(current.attr, 'src') - return - endif - let fn = current.attr.src - if fn !~ '^\(/\|http\)' - let fn = simplify(expand('%:h') . '/' . fn) - endif - - let [width, height] = zencoding#util#getImageSize(fn) - if width == -1 && height == -1 - return - endif - let current.attr.width = width - let current.attr.height = height - let html = zencoding#toString(current, 'html', 1) - call zencoding#util#setContent(img_region, html) -endfunction - -function! zencoding#lang#html#parseTag(tag) - let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'attrs_order': [] } - let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\(/\{0,1}\)>' - let match = matchstr(a:tag, mx) - let current.name = substitute(match, mx, '\1', 'i') - let attrs = substitute(match, mx, '\2', 'i') - let mx = '\([a-zA-Z0-9]\+\)=\%(\([^"'' \t]\+\)\|"\([^"]\{-}\)"\|''\([^'']\{-}\)''\)' - while len(attrs) > 0 - let match = matchstr(attrs, mx) - if len(match) == 0 - break - endif - let attr_match = matchlist(match, mx) - let name = attr_match[1] - let value = len(attr_match[2]) ? attr_match[2] : attr_match[3] - let current.attr[name] = value - let current.attrs_order += [name] - let attrs = attrs[stridx(attrs, match) + len(match):] - endwhile - return current -endfunction - -function! zencoding#lang#html#toggleComment() - let orgpos = getpos('.') - let curpos = getpos('.') - let mx = '<\%#[^>]*>' - while 1 - let block = zencoding#util#searchRegion('') - if zencoding#util#regionIsValid(block) - let block[1][1] += 2 - let content = zencoding#util#getContent(block) - let content = substitute(content, '^$', '\1', '') - call zencoding#util#setContent(block, content) - silent! call setpos('.', orgpos) - return - endif - let block = zencoding#util#searchRegion('<[^>]', '>') - if !zencoding#util#regionIsValid(block) - let pos1 = searchpos('<', 'bcW') - if pos1[0] == 0 && pos1[1] == 0 - return - endif - let curpos = getpos('.') - continue - endif - let pos1 = block[0] - let pos2 = block[1] - let content = zencoding#util#getContent(block) - let tag_name = matchstr(content, '^<\zs/\{0,1}[^ \r\n>]\+') - if tag_name[0] == '/' - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpairpos('<'. tag_name[1:] . '>', '', '', 'bnW') - let pos1 = searchpos('>', 'cneW') - let block = [pos2, pos1] - elseif tag_name =~ '/$' - if !zencoding#util#pointInRegion(orgpos[1:2], block) - " it's broken tree - call setpos('.', orgpos) - let block = zencoding#util#searchRegion('>', '<') - let content = '><' - call zencoding#util#setContent(block, content) - silent! call setpos('.', orgpos) - return - endif - else - call setpos('.', [0, pos2[0], pos2[1], 0]) - let pos2 = searchpairpos('<'. tag_name . '>', '', '', 'nW') - call setpos('.', [0, pos2[0], pos2[1], 0]) - let pos2 = searchpos('>', 'neW') - let block = [pos1, pos2] - endif - if !zencoding#util#regionIsValid(block) - silent! call setpos('.', orgpos) - return - endif - if zencoding#util#pointInRegion(curpos[1:2], block) - let content = '' - call zencoding#util#setContent(block, content) - silent! call setpos('.', orgpos) - return - endif - endwhile -endfunction - -function! zencoding#lang#html#balanceTag(flag) range - let vblock = zencoding#util#getVisualBlock() - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - let settings = zencoding#getSettings() - - if a:flag > 0 - let mx = '<\([a-zA-Z][a-zA-Z0-9:_\-]*\)[^>]*>' - while 1 - let pos1 = searchpos(mx, 'bW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = matchstr(content, '^<\zs[a-zA-Z0-9:_\-]*\ze') - if stridx(','.settings.html.empty_elements.',', ','.tag_name.',') != -1 - let pos2 = searchpos('>', 'nW') - else - let pos2 = searchpairpos('<' . tag_name . '[^>]*>', '', '\zs', 'nW') - endif - let block = [pos1, pos2] - if pos1[0] == 0 && pos1[1] == 0 - break - endif - if zencoding#util#pointInRegion(curpos[1:2], block) && zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endwhile - else - let mx = '<\([a-zA-Z][a-zA-Z0-9:_\-]*\)[^>]*>' - while 1 - let pos1 = searchpos(mx, 'W') - if pos1 == curpos[1:2] - let pos1 = searchpos(mx . '\zs', 'W') - let pos2 = searchpos('.\ze<', 'W') - let block = [pos1, pos2] - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endif - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = matchstr(content, '^<\zs[a-zA-Z0-9:_\-]*\ze') - if stridx(','.settings.html.empty_elements.',', ','.tag_name.',') != -1 - let pos2 = searchpos('>', 'nW') - else - let pos2 = searchpairpos('<' . tag_name . '[^>]*>', '', '\zs', 'nW') - endif - let block = [pos1, pos2] - if pos1[0] == 0 && pos1[1] == 0 - break - endif - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endwhile - endif - call setpos('.', curpos) - if a:flag == -2 || a:flag == 2 - silent! exe "normal! gv" - endif -endfunction - -function! zencoding#lang#html#moveNextPrev(flag) - let pos = search('\%(<\/\|\(""\)\|^\(\s*\)$', a:flag ? 'Wpb' : 'Wp') - if pos == 3 - startinsert! - elseif pos != 0 - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#lang#html#splitJoinTag() - let curpos = getpos('.') - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:_\-]*\)[^>]*>' - let pos1 = searchpos(mx, 'bcnW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:_\-]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if content[-2:] == '/>' && zencoding#util#cursorInRegion(block) - let content = content[:-3] . ">' - call zencoding#util#setContent(block, content) - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW') - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - let content = zencoding#util#getContent(block) - if zencoding#util#pointInRegion(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - let content = matchstr(content, mx)[:-2] . '/>' - call zencoding#util#setContent(block, content) - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if block[0][0] > 0 - call setpos('.', [0, block[0][0]-1, block[0][1], 0]) - else - call setpos('.', curpos) - return - endif - endif - endif - endwhile -endfunction - -function! zencoding#lang#html#removeTag() - let curpos = getpos('.') - while 1 - let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:_\-]*\)[^>]*>' - let pos1 = searchpos(mx, 'bcnW') - let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx) - let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9:_\-]*\).*$', '\1', '') - let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]] - if content[-2:] == '/>' && zencoding#util#cursorInRegion(block) - call zencoding#util#setContent(block, '') - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if tag_name[0] == '/' - let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW') - call setpos('.', [0, pos1[0], pos1[1], 0]) - let pos2 = searchpos('', 'cneW') - else - let pos2 = searchpos('', 'cneW') - endif - let block = [pos1, pos2] - let content = zencoding#util#getContent(block) - if zencoding#util#pointInRegion(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>' - call zencoding#util#setContent(block, '') - call setpos('.', [0, block[0][0], block[0][1], 0]) - return - else - if block[0][0] > 0 - call setpos('.', [0, block[0][0]-1, block[0][1], 0]) - else - call setpos('.', curpos) - return - endif - endif - endif - endwhile -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/lang/sass.vim b/sources_forked/zencoding/autoload/zencoding/lang/sass.vim deleted file mode 100755 index 6b89b893..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/sass.vim +++ /dev/null @@ -1,158 +0,0 @@ -function! zencoding#lang#sass#findTokens(str) - return zencoding#lang#html#findTokens(a:str) -endfunction - -function! zencoding#lang#sass#parseIntoTree(abbr, type) - if a:abbr =~ '>' - return zencoding#lang#html#parseIntoTree(a:abbr, a:type) - else - return zencoding#lang#css#parseIntoTree(a:abbr, a:type) - endif -endfunction - -function! zencoding#lang#sass#toString(settings, current, type, inline, filters, itemno, indent) - let settings = a:settings - let current = a:current - let type = a:type - let inline = a:inline - let filters = a:filters - let itemno = a:itemno - let indent = a:indent - let str = "" - - let current_name = current.name - let current_name = substitute(current.name, '\$$', itemno+1, '') - if len(current.name) > 0 - let str .= current_name - let tmp = '' - for attr in keys(current.attr) - let val = current.attr[attr] - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - let attr = substitute(attr, '\$$', itemno+1, '') - if attr == 'id' - let str .= '#' . val - elseif attr == 'class' - let str .= '.' . val - else - let tmp .= attr . ': ' . val - endif - endfor - if len(tmp) > 0 - let str .= "\n" - for line in split(tmp, "\n") - let str .= indent . line . "\n" - endfor - else - let str .= "\n" - endif - - let inner = '' - for child in current.child - let inner .= zencoding#toString(child, type, inline, filters, itemno) - endfor - let inner = substitute(inner, "\n", "\n" . indent, 'g') - let inner = substitute(inner, "\n" . indent . "$", "", 'g') - let str .= indent . inner - else - let text = zencoding#lang#css#toString(settings, current, type, inline, filters, itemno, indent) - let text = substitute(text, '\${cursor}', '', 'g') - let text = substitute(text, '\s*;$', '', '') - return text - endif - return str -endfunction - -function! zencoding#lang#sass#imageSize() -endfunction - -function! zencoding#lang#sass#encodeImage() -endfunction - -function! zencoding#lang#sass#parseTag(tag) -endfunction - -function! zencoding#lang#sass#toggleComment() -endfunction - -function! zencoding#lang#sass#balanceTag(flag) range - let block = zencoding#util#getVisualBlock() - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - let n = curpos[1] - let ml = len(matchstr(getline(n), '^\s*')) - - if a:flag > 0 - if a:flag == 1 || !zencoding#util#regionIsValid(block) - let n = line('.') - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze[a-z]')) - if l > 0 && l < ml - let ml = l - break - endif - let n -= 1 - endwhile - endif - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze[a-z]')) - if l > 0 && l > ml - let ml = l - break - endif - let n += 1 - endwhile - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - endif -endfunction - -function! zencoding#lang#sass#moveNextPrev(flag) - let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp') - if pos == 2 - startinsert! - elseif pos != 0 - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#lang#sass#splitJoinTag() -endfunction - -function! zencoding#lang#sass#removeTag() -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/lang/scss.vim b/sources_forked/zencoding/autoload/zencoding/lang/scss.vim deleted file mode 100755 index 39890af2..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/scss.vim +++ /dev/null @@ -1,121 +0,0 @@ -function! zencoding#lang#scss#findTokens(str) - return zencoding#lang#html#findTokens(a:str) -endfunction - -function! zencoding#lang#scss#parseIntoTree(abbr, type) - if a:abbr =~ '>' - return zencoding#lang#html#parseIntoTree(a:abbr, a:type) - else - return zencoding#lang#css#parseIntoTree(a:abbr, a:type) - endif -endfunction - -function! zencoding#lang#scss#toString(settings, current, type, inline, filters, itemno, indent) - let settings = a:settings - let current = a:current - let type = a:type - let inline = a:inline - let filters = a:filters - let itemno = a:itemno - let indent = a:indent - let str = "" - - let current_name = substitute(current.name, '\$$', itemno+1, '') - if len(current.name) > 0 - let str .= current_name - let tmp = '' - for attr in keys(current.attr) - let val = current.attr[attr] - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - let attr = substitute(attr, '\$$', itemno+1, '') - if attr == 'id' - let str .= '#' . val - elseif attr == 'class' - let str .= '.' . val - else - let tmp .= attr . ': ' . val . ';' - endif - endfor - if len(tmp) > 0 - let str .= " {\n" - for line in split(tmp, "\n") - let str .= indent . line . "\n" - endfor - else - let str .= " {\n" - endif - - let inner = '' - for child in current.child - let inner .= zencoding#toString(child, type, inline, filters, itemno) - endfor - let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g') - let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g') - let str .= indent . inner . "\n}\n" - else - return zencoding#lang#css#toString(settings, current, type, inline, filters, itemno, indent) - endif - return str -endfunction - -function! zencoding#lang#scss#imageSize() - call zencoding#lang#css#imageSize() -endfunction - -function! zencoding#lang#scss#encodeImage() - return zencoding#lang#css#encodeImage() -endfunction - -function! zencoding#lang#scss#parseTag(tag) - return zencoding#lang#css#parseTag(a:tag) -endfunction - -function! zencoding#lang#scss#toggleComment() - call zencoding#lang#css#toggleComment() -endfunction - -function! zencoding#lang#scss#balanceTag(flag) range - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - call setpos('.', curpos) - else - let curpos = getpos('.') - endif - if a:flag < 0 - let ret = searchpair('}', '', '.\zs{') - else - let ret = searchpair('{', '', '}', 'bW') - endif - if ret > 0 - let pos1 = getpos('.')[1:2] - if a:flag < 0 - let pos2 = searchpairpos('{', '', '}') - else - let pos2 = searchpairpos('{', '', '}') - endif - let block = [pos1, pos2] - if zencoding#util#regionIsValid(block) - call zencoding#util#selectRegion(block) - return - endif - endif - if a:flag == -2 || a:flag == 2 - silent! exe "normal! gv" - else - call setpos('.', curpos) - endif -endfunction - -function! zencoding#lang#scss#moveNextPrev(flag) - call zencoding#lang#css#moveNextPrev(a:flag) -endfunction - -function! zencoding#lang#scss#splitJoinTag() - call zencoding#lang#css#splitJoinTag() -endfunction - -function! zencoding#lang#scss#removeTag() - call zencoding#lang#ss#removeTag() -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/lang/slim.vim b/sources_forked/zencoding/autoload/zencoding/lang/slim.vim deleted file mode 100755 index 15bc968c..00000000 --- a/sources_forked/zencoding/autoload/zencoding/lang/slim.vim +++ /dev/null @@ -1,276 +0,0 @@ -function! zencoding#lang#slim#findTokens(str) - return zencoding#lang#html#findTokens(a:str) -endfunction - -function! zencoding#lang#slim#parseIntoTree(abbr, type) - return zencoding#lang#html#parseIntoTree(a:abbr, a:type) -endfunction - -function! zencoding#lang#slim#toString(settings, current, type, inline, filters, itemno, indent) - let settings = a:settings - let current = a:current - let type = a:type - let inline = a:inline - let filters = a:filters - let itemno = a:itemno - let indent = a:indent - let dollar_expr = zencoding#getResource(type, 'dollar_expr', 1) - let str = "" - - let comment_indent = '' - let comment = '' - let current_name = current.name - if dollar_expr - let current_name = substitute(current.name, '\$$', itemno+1, '') - endif - if len(current.name) > 0 - let str .= current_name - for attr in current.attrs_order - if !has_key(current.attr, attr) - continue - endif - let val = current.attr[attr] - if dollar_expr - while val =~ '\$\([^#{]\|$\)' - let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g') - endwhile - endif - let attr = substitute(attr, '\$$', itemno+1, '') - let str .= ' ' . attr . '="' . val . '"' - endfor - - let inner = '' - if len(current.value) > 0 - let str .= "\n" - let text = current.value[1:-2] - if dollar_expr - let text = substitute(text, '\%(\\\)\@\ 0 - for child in current.child - let inner .= zencoding#toString(child, type, inline, filters, itemno) - endfor - let inner = substitute(inner, "\n", "\n" . escape(indent, '\'), 'g') - let inner = substitute(inner, "\n" . escape(indent, '\') . "$", "", 'g') - let str .= "\n" . indent . inner - endif - else - let str = current.value[1:-2] - if dollar_expr - let str = substitute(str, '\%(\\\)\@\ 0 - let match = matchstr(attrs, mx) - if len(match) == 0 - break - endif - let attr_match = matchlist(match, mx) - let name = attr_match[1] - let value = len(attr_match[2]) ? attr_match[2] : attr_match[3] - let current.attr[name] = value - let current.attrs_order += [name] - let attrs = attrs[stridx(attrs, match) + len(match):] - endwhile - return current -endfunction - -function! zencoding#lang#slim#toggleComment() - let line = getline('.') - let space = matchstr(line, '^\s*') - if line =~ '^\s*/' - call setline('.', space . line[len(space)+1:]) - elseif line =~ '^\s*[a-z]' - call setline('.', space . '/' . line[len(space):]) - endif -endfunction - -function! zencoding#lang#slim#balanceTag(flag) range - let block = zencoding#util#getVisualBlock() - if a:flag == -2 || a:flag == 2 - let curpos = [0, line("'<"), col("'<"), 0] - else - let curpos = getpos('.') - endif - let n = curpos[1] - let ml = len(matchstr(getline(n), '^\s*')) - - if a:flag > 0 - if a:flag == 1 || !zencoding#util#regionIsValid(block) - let n = line('.') - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze[a-z]')) - if l > 0 && l < ml - let ml = l - break - endif - let n -= 1 - endwhile - endif - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - else - while n > 0 - let l = len(matchstr(getline(n), '^\s*\ze[a-z]')) - if l > 0 && l > ml - let ml = l - break - endif - let n += 1 - endwhile - let sn = n - if n == 0 - let ml = 0 - endif - while n < line('$') - let l = len(matchstr(getline(n), '^\s*[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - call setpos('.', [0, n, 1, 0]) - normal! V - call setpos('.', [0, sn, 1, 0]) - endif -endfunction - -function! zencoding#lang#slim#moveNextPrev(flag) - let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp') - if pos == 2 - startinsert! - elseif pos != 0 - silent! normal! l - startinsert - endif -endfunction - -function! zencoding#lang#slim#splitJoinTag() - let n = line('.') - while n > 0 - if getline(n) =~ '^\s*\ze[a-z]' - let sn = n - let n += 1 - if getline(n) =~ '^\s*|' - while n <= line('$') - if getline(n) !~ '^\s*|' - break - endif - exe n "delete" - endwhile - call setpos('.', [0, sn, 1, 0]) - else - let spaces = matchstr(getline(sn), '^\s*') - call append(sn, spaces . ' | ') - call setpos('.', [0, sn+1, 1, 0]) - startinsert! - endif - break - endif - let n -= 1 - endwhile -endfunction - -function! zencoding#lang#slim#removeTag() - let n = line('.') - let ml = 0 - while n > 0 - if getline(n) =~ '^\s*\ze[a-z]' - let ml = len(matchstr(getline(n), '^\s*[a-z]')) - break - endif - let n -= 1 - endwhile - let sn = n - while n < line('$') - let l = len(matchstr(getline(n), '^\s*[a-z]')) - if l > 0 && l <= ml - let n -= 1 - break - endif - let n += 1 - endwhile - if sn == n - exe "delete" - else - exe sn "," (n-1) "delete" - endif -endfunction diff --git a/sources_forked/zencoding/autoload/zencoding/util.vim b/sources_forked/zencoding/autoload/zencoding/util.vim deleted file mode 100755 index 5a028c97..00000000 --- a/sources_forked/zencoding/autoload/zencoding/util.vim +++ /dev/null @@ -1,249 +0,0 @@ -"============================================================================== -" region utils -"============================================================================== -" deleteContent : delete content in region -" if region make from between '' and '' -" -------------------- -" begin: -" :end -" -------------------- -" this function make the content as following -" -------------------- -" begin::end -" -------------------- -function! zencoding#util#deleteContent(region) - let lines = getline(a:region[0][0], a:region[1][0]) - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) - silent! exe "delete ".(a:region[1][0] - a:region[0][0]) - call setline(line('.'), lines[0][:a:region[0][1]-2] . lines[-1][a:region[1][1]]) -endfunction - -" change_content : change content in region -" if region make from between '' and '' -" -------------------- -" begin: -" :end -" -------------------- -" and content is -" -------------------- -" foo -" bar -" baz -" -------------------- -" this function make the content as following -" -------------------- -" begin:foo -" bar -" baz:end -" -------------------- -function! zencoding#util#setContent(region, content) - let newlines = split(a:content, '\n', 1) - let oldlines = getline(a:region[0][0], a:region[1][0]) - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) - silent! exe "delete ".(a:region[1][0] - a:region[0][0]) - if len(newlines) == 0 - let tmp = '' - if a:region[0][1] > 1 - let tmp = oldlines[0][:a:region[0][1]-2] - endif - if a:region[1][1] >= 1 - let tmp .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), tmp) - elseif len(newlines) == 1 - if a:region[0][1] > 1 - let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0] - endif - if a:region[1][1] >= 1 - let newlines[0] .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), newlines[0]) - else - if a:region[0][1] > 1 - let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0] - endif - if a:region[1][1] >= 1 - let newlines[-1] .= oldlines[-1][a:region[1][1]:] - endif - call setline(line('.'), newlines[0]) - call append(line('.'), newlines[1:]) - endif -endfunction - -" select_region : select region -" this function make a selection of region -function! zencoding#util#selectRegion(region) - call setpos('.', [0, a:region[1][0], a:region[1][1], 0]) - normal! v - call setpos('.', [0, a:region[0][0], a:region[0][1], 0]) -endfunction - -" point_in_region : check point is in the region -" this function return 0 or 1 -function! zencoding#util#pointInRegion(point, region) - if !zencoding#util#regionIsValid(a:region) | return 0 | endif - if a:region[0][0] > a:point[0] | return 0 | endif - if a:region[1][0] < a:point[0] | return 0 | endif - if a:region[0][0] == a:point[0] && a:region[0][1] > a:point[1] | return 0 | endif - if a:region[1][0] == a:point[0] && a:region[1][1] < a:point[1] | return 0 | endif - return 1 -endfunction - -" cursor_in_region : check cursor is in the region -" this function return 0 or 1 -function! zencoding#util#cursorInRegion(region) - if !zencoding#util#regionIsValid(a:region) | return 0 | endif - let cur = getpos('.')[1:2] - return zencoding#util#pointInRegion(cur, a:region) -endfunction - -" region_is_valid : check region is valid -" this function return 0 or 1 -function! zencoding#util#regionIsValid(region) - if a:region[0][0] == 0 || a:region[1][0] == 0 | return 0 | endif - return 1 -endfunction - -" search_region : make region from pattern which is composing start/end -" this function return array of position -function! zencoding#util#searchRegion(start, end) - return [searchpairpos(a:start, '', a:end, 'bcnW'), searchpairpos(a:start, '\%#', a:end, 'nW')] -endfunction - -" get_content : get content in region -" this function return string in region -function! zencoding#util#getContent(region) - if !zencoding#util#regionIsValid(a:region) - return '' - endif - let lines = getline(a:region[0][0], a:region[1][0]) - if a:region[0][0] == a:region[1][0] - let lines[0] = lines[0][a:region[0][1]-1:a:region[1][1]-1] - else - let lines[0] = lines[0][a:region[0][1]-1:] - let lines[-1] = lines[-1][:a:region[1][1]-1] - endif - return join(lines, "\n") -endfunction - -" region_in_region : check region is in the region -" this function return 0 or 1 -function! zencoding#util#regionInRegion(outer, inner) - if !zencoding#util#regionIsValid(a:inner) || !zencoding#util#regionIsValid(a:outer) - return 0 - endif - return zencoding#util#pointInRegion(a:inner[0], a:outer) && zencoding#util#pointInRegion(a:inner[1], a:outer) -endfunction - -" get_visualblock : get region of visual block -" this function return region of visual block -function! zencoding#util#getVisualBlock() - return [[line("'<"), col("'<")], [line("'>"), col("'>")]] -endfunction - -"============================================================================== -" html utils -"============================================================================== -function! zencoding#util#getContentFromURL(url) - let res = system(printf("%s %s", g:zencoding_curl_command, shellescape(substitute(a:url, '#.*', '', '')))) - let s1 = len(split(res, '?')) - let utf8 = iconv(res, 'utf-8', &encoding) - let s2 = len(split(utf8, '?')) - return (s2 == s1 || s2 >= s1 * 2) ? utf8 : res -endfunction - -function! zencoding#util#getTextFromHTML(buf) - let threshold_len = 100 - let threshold_per = 0.1 - let buf = a:buf - - let buf = strpart(buf, stridx(buf, '')) - let buf = substitute(buf, ']*>.\{-}', '', 'g') - let buf = substitute(buf, ']*>.\{-}', '', 'g') - let res = '' - let max = 0 - let mx = '\(]\{-}>\)\|\(<\/td>\)\|\(]\{-}>\)\|\(<\/div>\)' - let m = split(buf, mx) - for str in m - let c = split(str, '<[^>]*?>') - let str = substitute(str, '<[^>]\{-}>', ' ', 'g') - let str = substitute(str, '>', '>', 'g') - let str = substitute(str, '<', '<', 'g') - let str = substitute(str, '"', '"', 'g') - let str = substitute(str, ''', "'", 'g') - let str = substitute(str, ' ', ' ', 'g') - let str = substitute(str, '¥', '\¥', 'g') - let str = substitute(str, '&', '\&', 'g') - let str = substitute(str, '^\s*\(.*\)\s*$', '\1', '') - let str = substitute(str, '\s\+', ' ', 'g') - let l = len(str) - if l > threshold_len - let per = (l+0.0) / len(c) - if max < l && per > threshold_per - let max = l - let res = str - endif - endif - endfor - let res = substitute(res, '^\s*\(.*\)\s*$', '\1', 'g') - return res -endfunction - -function! zencoding#util#getImageSize(fn) - let fn = a:fn - - if zencoding#util#isImageMagickInstalled() - return zencoding#util#imageSizeWithImageMagick(fn) - endif - - if filereadable(fn) - let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g') - else - let hex = substitute(system(g:zencoding_curl_command.' "'.fn.'" | xxd -p'), '\n', '', 'g') - endif - - let [width, height] = [-1, -1] - if hex =~ '^89504e470d0a1a0a' - let width = eval('0x'.hex[32:39]) - let height = eval('0x'.hex[40:47]) - endif - if hex =~ '^ffd8' - let pos = 4 - while pos < len(hex) - let bs = hex[pos+0:pos+3] - let pos += 4 - if bs == 'ffc0' || bs == 'ffc2' - let pos += 6 - let height = eval('0x'.hex[pos+0:pos+1])*256 + eval('0x'.hex[pos+2:pos+3]) - let pos += 4 - let width = eval('0x'.hex[pos+0:pos+1])*256 + eval('0x'.hex[pos+2:pos+3]) - break - elseif bs =~ 'ffd[9a]' - break - elseif bs =~ 'ff\(e[0-9a-e]\|fe\|db\|dd\|c4\)' - let pos += (eval('0x'.hex[pos+0:pos+1])*256 + eval('0x'.hex[pos+2:pos+3])) * 2 - endif - endwhile - endif - if hex =~ '^47494638' - let width = eval('0x'.hex[14:15].hex[12:13]) - let height = eval('0x'.hex[18:19].hex[16:17]) - endif - - return [width, height] -endfunction - -function! zencoding#util#imageSizeWithImageMagick(fn) - let img_info = system('identify -format "%wx%h" "'.a:fn.'"') - let img_size = split(substitute(img_info, '\n', '', ''), 'x') - let width = img_size[0] - let height = img_size[1] - return [width, height] -endfunction - -function! zencoding#util#isImageMagickInstalled() - if !get(s:, 'zencoding_use_identify', 1) - return 0 - endif - return executable('identify') -endfunction diff --git a/sources_forked/zencoding/doc/zencoding.txt b/sources_forked/zencoding/doc/zencoding.txt deleted file mode 100755 index ee453283..00000000 --- a/sources_forked/zencoding/doc/zencoding.txt +++ /dev/null @@ -1,438 +0,0 @@ -*zencoding.txt* ZenCoding for Vim - - ------------------------------------------------------- - ZenCoding: vim plugins for HTML and CSS hi-speed coding - ------------------------------------------------------- - -Author: Yasuhiro Matsumoto -WebSite: http://mattn.kaoriya.net/ -Repository: http://github.com/mattn/zencoding-vim -Site: http://mattn.github.com/zencoding-vim -License: BSD style license - -============================================================================== -CONTENTS *zencoding-contents* - -Introduction |zencoding-introduction| -Install |zencoding-install| -Tutorial |zencoding-tutorial| - 1. Expand Abbreviation |zencoding-expandabbr| - 2. Wrap with Abbreviation |zencoding-wrap-wtih-abbreviation| - 3. Balance Tag Inward |zencoding-balance-tag-inward| - 4. Balance Tag Outward |zencoding-balance-tag-outward| - 5. Go to Next Edit Point |zencoding-goto-next-point| |n| - 6. Go to Previous Edit Point |zencoding-goto-previous-point| - 7. Update Size |zencoding-update-image-size| - 8. Merge Lines |zencoding-merge-lines| - 9. Remove Tag |zencoding-remove-tag| - 10. Split/Join Tag |zencoding-split-join-tag| - 11. Toggle Comment |zencoding-toggle-comment| - 12. Make anchor from URL |zencoding-make-anchor-url| - 13. Make quoted text from URL |zencoding-quoted-text-url| - 14. Code Pretty |zencoding-code-pretty| -Customize |zencoding-customize| - 1. Key Mappings |zencoding-customize-keymappings| - 2. Indent Size |zencoding-indent-size| - 3. Define Tag's Behavior |zencoding-define-tags-behavior| - 4. Complete Tag |zencoding-complete-tag| -Links |zencoding-links| -ToDo |zencoding-todo| - -============================================================================== -INTRODUCTION *zencoding-introduction* *zencoding* - -|ZenCoding| is an editor plugin for high-speed HTML, XML, XSL (or any other -structured code format) coding and editing. The core of this plugin is a -powerful abbreviation engine which allows you to expand expressions?similar to -CSS selectors?into HTML code: -> - div#page>div.logo+ul#navigation>li*5>a -< -...can be expanded into: -> -

    - - -
    -< -Read more about current Zen Coding syntax - http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn - -Abbreviation engine has a modular structure which allows you to expand -abbreviations into different languages. Zen Coding currently supports CSS, -HTML, XML/XSL and HAML, Slim languages via filters. - -============================================================================== -INSTALL *zencoding-install* - -Install the distributed files into Vim runtime directory which is usually -~/.vim/, or $HOME/vimfiles on Windows. - -If you install pathogen that provided from Tim Pope, you should extract the -file into 'bundle' directory. - -============================================================================== -TUTORIAL *zencoding-tutorial* - -If you are seeing this file as :help, then you can't edit this file. -You should copy this section and create new buffer, paste and write as -'zencoding-tutor.txt'. Formally, open the file to start tutorial. - -1. Expand Abbreviation *zencoding-expandabbr* *,* - - Type abbreviation as 'div>p#foo$*3>a' and type |,|. -> -
    -

    - -

    -

    - -

    -

    - -

    -
    -< -2. Wrap with Abbreviation *zencoding-wrap-wtih-abbreviation* *v_,* - - Write as below. -> - test1 - test2 - test3 -< - Then do visual select(line wize) and type |,|. - If you request 'Tag:', then type 'ul>li*'. -> -
      -
    • test1
    • -
    • test2
    • -
    • test3
    • -
    -< - If you type tag as 'blockquote', then you'll see as following. -> -
    - test1 - test2 - test3 -
    -< -3. Balance Tag Inward *zencoding-balance-tag-inward* *d* - - To select inward of ul tag, type |d| in insert mode. -> -
      - *
    • -
    • -
    • -
    -< - If cursor is at '*', |d| select from begin of
      to end of
    . - If cursor is at first of
  • , it select
  • . - -4. Balance Tag Outward *zencoding-balance-tag-outward* *D* - - To select outward of ul tag, insert mode, type D in insert mode. -> -
      - *
    • -
    • -
    • -
    -< - If cursor is at '*', |D| select from next letter of
      to previous - letter of
    . - If cursor is at first of
  • , it select
  • . - -5. Go to Next Edit Point *zencoding-goto-next-point* *n* - - To jump next point that need to edit, type |n| in insert mode. -> - *
    foo
    -
  • -< - If cursor is at '*', |n| move a cursor into attribute value of div - specified id as 'foo'. And type again |n| move a cursor into inner of - div specified id as 'bar'. - -6. Go to Previous Edit Point *zencoding-goto-previous-point* *N* - - To jump previous point that need to edit, type |N| in insert mode. -> -
    foo
    -
    * -< - If cursor is at '*', |N| move a cursor into div specified id as 'bar'. - And type again |N| move a cursor into attribute value of 'foo'. - -7. Update Size *zencoding-update-image-size* *i* - - To expand or update size of image, type |i| on img tag -> - -< - Type 'i' on img tag -> - -< - If you change image, then type it again. it will be following. -> - -< -8. Merge Lines *zencoding-merge-lines* - - To join multi line text like following, type |J|. -> -
      -
    • -
    • -
    • -
    -< - If you select part of line include
  • and type |m|, it will be - following. -> -
      -
    • -
    -< -9. Remove Tag *zencoding-remove-tag* *k* - - To remove tag in the block, type |k|. -> - -< - Type |k| in insert mode, then -> -
    - -
    -< - And type |k| in there again, then div will be removed. - -10. Split/Join Tag *zencoding-split-join-tag* *j* - - To join block, type |j|. -> -
    - cursor is here -
    -< - Type |j| in insert mode. then, -> -
    -< - And type |j| in there again. -> -
    -
    -< -11. Toggle Comment *zencoding-toggle-comment* */* - - Move cursor to block -> -
    - hello world -
    -< - Type '/' in insert mode. -> - -< - Type '/' in there again. -> -
    - hello world -
    -< -12. Make anchor from URL *zencoding-make-anchor-url* *a* - - Move cursor to URL -> - http://www.google.com/ -< - Type |a| -> - Google -< -13. Make quoted text from URL *zencoding-quoted-text-url* *A* - - Move cursor to URL -> - http://github.com/ -< - Type |A| -> -
    - Secure source code hosting and collaborative development - GitHub
    -

    How does it work? Get up and running in seconds by forking a project, pushing an existing repository...

    - http://github.com/ -
    -< -14. Code Pretty *zencoding-code-pretty* *c* - - Select code block, for example select following code from "int main()". -> -

    Writing in C language

    - - int main() { - puts("hello world"); - } -< - Type |c| -> -

    Writing in C language

    - - int main() {
    -   puts("hello world");
    - }
    -< -============================================================================== -CUSTOMIZE *zencoding-customize* - -1. Key Mapping *zencoding-customize-keymappings* - - To specify leading key for expanding or balance tag, or for all, - Add this line in your vimrc: > -> - let g:user_zen_leader_key = '' -< - Or if you prefer to map for each actions, then you set each variables. - - 'user_zen_expandabbr_key' - 'user_zen_expandword_key' - 'user_zen_balancetaginward_key' - 'user_zen_balancetagoutward_key' - 'user_zen_next_key' - 'user_zen_prev_key' - 'user_zen_imagesize_key' - 'user_zen_togglecomment_key' - 'user_zen_splitjointag_key' - 'user_zen_removetag_key' - 'user_zen_anchorizeurl_key' - 'user_zen_anchorizesummary_key' - -2. Indent Size *zencoding-indent-size* - - To change indent size of html, add this code in your vimrc. -> - let g:user_zen_settings = { - \ 'html' : { - \ 'indentation' : ' ' - \ }, - \} -< - If you prefer to change global indent size then add this. -> - let g:user_zen_settings = { - \ 'indentation' : ' ' - \} -< -3. Define Tag's Behavior *zencoding-define-tags-behavior* - - zencoding.vim can change behavior of expanding abbreviation for each - filetypes as |Dictionary|. for details, see official site of zencoding. - for example, vimmer can add following. -> - let g:user_zen_settings = { - \ 'lang' : 'ja', - \ 'html' : { - \ 'filters' : 'html', - \ 'indentation' : ' ' - \ }, - \ 'perl' : { - \ 'indentation' : ' ', - \ 'aliases' : { - \ 'req' : "require '|'" - \ }, - \ 'snippets' : { - \ 'use' : "use strict\nuse warnings\n\n", - \ 'w' : "warn \"${cursor}\";", - \ }, - \ }, - \ 'php' : { - \ 'extends' : 'html', - \ 'filters' : 'html,c', - \ }, - \ 'css' : { - \ 'filters' : 'fc', - \ }, - \ 'javascript' : { - \ 'snippets' : { - \ 'jq' : "$(function() {\n\t${cursor}${child}\n});", - \ 'jq:each' : "$.each(arr, function(index, item)\n\t${child}\n});", - \ 'fn' : "(function() {\n\t${cursor}\n})();", - \ 'tm' : "setTimeout(function() {\n\t${cursor}\n}, 100);", - \ }, - \ }, - \ 'java' : { - \ 'indentation' : ' ', - \ 'snippets' : { - \ 'main': "public static void main(String[] args) {\n\t|\n}", - \ 'println': "System.out.println(\"|\");", - \ 'class': "public class | {\n}\n", - \ }, - \ }, - \} -< -4. Complete Tag *zencoding-complete-tag* - - If you want to complete tags using |omnifunc| then add this. -> - let g:use_zen_complete_tag = 1 -< - -5. Enable functions in different mode - - If you want to use zencoding only in some modes, set an mode option: - - let g:user_zen_mode='n' "only enable normal mode functions, or - let g:user_zen_mode='inv' "enable all functions, which is equal to - let g:user_zen_mode='a' "enable all function in all mode. - -============================================================================== -LINKS *zencoding-links* - -zen-coding official site: - http://code.google.com/p/zen-coding/ - -zencoding.vim: - http://mattn.github.com/zencoding-vim - -development repository: - https://github.com/mattn/zencoding-vim - -my blog posts about zencoding-vim: - http://mattn.kaoriya.net/software/vim/20100222103327.htm - http://mattn.kaoriya.net/software/vim/20100306021632.htm - -japanese blog posts about zencoding-vim: - http://d.hatena.ne.jp/idesaku/20100424/1272092255 - http://d.hatena.ne.jp/griefworker/20110118/vim_zen_coding - http://d.hatena.ne.jp/sakurako_s/20110126/1295988873 - http://looxu.blogspot.jp/2010/02/zencodingvimhtml.html - -tutorial traslated in chinese: - http://www.zfanw.com/blog/zencoding-vim-tutorial-chinese.html - -============================================================================== -TODO *zencoding-todo* - * wrapping inline selected. - * more documents. - * more contributor. - * more time to improve zencodig.vim. - -============================================================================== -vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: diff --git a/sources_forked/zencoding/plugin/zencoding.vim b/sources_forked/zencoding/plugin/zencoding.vim deleted file mode 100755 index e627653d..00000000 --- a/sources_forked/zencoding/plugin/zencoding.vim +++ /dev/null @@ -1,215 +0,0 @@ -"============================================================================= -" File: zencoding.vim -" Author: Yasuhiro Matsumoto -" Last Change: 13-Feb-2013. -" Version: 0.75 -" WebPage: http://github.com/mattn/zencoding-vim -" Description: vim plugins for HTML and CSS hi-speed coding. -" SeeAlso: http://code.google.com/p/zen-coding/ -" Usage: -" -" This is vim script support expanding abbreviation like zen-coding. -" ref: http://code.google.com/p/zen-coding/ -" -" Type abbreviation -" +------------------------------------- -" | html:5_ -" +------------------------------------- -" "_" is a cursor position. and type "," (Ctrl+y and Comma) -" NOTE: Don't worry about key map. you can change it easily. -" +------------------------------------- -" | -" | -" | -" | -" | -" | -" | -" | _ -" | -" | -" +------------------------------------- -" Type following -" +------------------------------------- -" | div#foo$*2>div.bar -" +------------------------------------- -" And type "," -" +------------------------------------- -" |
    -" |
    _
    -" |
    -" |
    -" |
    -" |
    -" +------------------------------------- -" -" Tips: -" -" You can customize behavior of expanding with overriding config. -" This configuration will be marged at loading plugin. -" -" let g:user_zen_settings = { -" \ 'indentation' : ' ', -" \ 'perl' : { -" \ 'aliases' : { -" \ 'req' : 'require ' -" \ }, -" \ 'snippets' : { -" \ 'use' : "use strict\nuse warnings\n\n", -" \ 'warn' : "warn \"|\";", -" \ } -" \ } -" \} -" -" You can set language attribute in html using 'zen_settings.lang'. -" -" GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim -" script type: plugin - -if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim) - finish -endif -let g:loaded_zencoding_vim = 1 - -let s:save_cpo = &cpo -set cpo&vim - -if !exists('g:zencoding_debug') - let g:zencoding_debug = 0 -endif - -if !exists('g:zencoding_curl_command') - let g:zencoding_curl_command = 'curl -s -L -A Mozilla/5.0' -endif - -if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag - setlocal omnifunc=zencoding#CompleteTag -endif - -if !exists('g:user_zen_leader_key') - let g:user_zen_leader_key = '' -endif - -function! s:install_plugin_i() - for item in [ - \ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': 'u:call zencoding#expandAbbr(0,"")a'}, - \ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': ';', 'plug': 'ZenCodingExpandWord', 'func': 'u:call zencoding#expandAbbr(1,"")a'}, - \ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardInsert', 'func': ':call zencoding#balanceTag(1)'}, - \ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardInsert', 'func': ':call zencoding#balanceTag(-1)'}, - \ {'mode': 'i', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call zencoding#moveNextPrev(0)'}, - \ {'mode': 'i', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call zencoding#moveNextPrev(1)'}, - \ {'mode': 'i', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call zencoding#imageSize()a'}, - \ {'mode': 'i', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call zencoding#toggleComment()a'}, - \ {'mode': 'i', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagInsert', 'func': ':call zencoding#splitJoinTag()'}, - \ {'mode': 'i', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call zencoding#removeTag()a'}, - \ {'mode': 'i', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call zencoding#anchorizeURL(0)a'}, - \ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call zencoding#anchorizeURL(1)a'}, - \] - - if !hasmapto(''.item.plug, item.mode) - exe item.mode . 'noremap ' . item.plug . ' ' . item.func - endif - if !exists('g:' . item.var) - endif - if exists('g:' . item.var) - let key = eval('g:' . item.var) - else - let key = g:user_zen_leader_key . item.key - endif - if len(maparg(key, item.mode)) == 0 - exe item.mode . 'map ' . key . ' ' . item.plug - endif - endfor -endfunction - -function! s:install_plugin_n() - for item in [ - \ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zencoding#expandAbbr(3,"")'}, - \ {'mode': 'n', 'var': 'user_zen_expandword_key', 'key': ',', 'plug': 'ZenCodingExpandWord', 'func': ':call zencoding#expandAbbr(1,"")'}, - \ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardNormal', 'func': ':call zencoding#balanceTag(1)'}, - \ {'mode': 'n', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardNormal', 'func': ':call zencoding#balanceTag(-1)'}, - \ {'mode': 'n', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call zencoding#moveNextPrev(0)'}, - \ {'mode': 'n', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call zencoding#moveNextPrev(1)'}, - \ {'mode': 'n', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call zencoding#imageSize()'}, - \ {'mode': 'n', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call zencoding#toggleComment()'}, - \ {'mode': 'n', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagNormal', 'func': ':call zencoding#splitJoinTag()'}, - \ {'mode': 'n', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call zencoding#removeTag()'}, - \ {'mode': 'n', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call zencoding#anchorizeURL(0)'}, - \ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call zencoding#anchorizeURL(1)'}, - \] - - if !hasmapto(''.item.plug, item.mode) - exe item.mode . 'noremap ' . item.plug . ' ' . item.func - endif - if !exists('g:' . item.var) - endif - if exists('g:' . item.var) - let key = eval('g:' . item.var) - else - let key = g:user_zen_leader_key . item.key - endif - if len(maparg(key, item.mode)) == 0 - exe item.mode . 'map ' . key . ' ' . item.plug - endif - endfor -endfunction - -function! s:install_plugin_v() - for item in [ - \ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2,"")'}, - \ {'mode': 'v', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardVisual', 'func': ':call zencoding#balanceTag(2)'}, - \ {'mode': 'v', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardVisual', 'func': ':call zencoding#balanceTag(-2)'}, - \ {'mode': 'v', 'var': 'user_zen_mergelines_key', 'key': 'm', 'plug': 'ZenCodingMergeLines', 'func': ':call zencoding#mergeLines()'}, - \ {'mode': 'v', 'var': 'user_zen_codepretty_key', 'key': 'c', 'plug': 'ZenCodingCodePretty', 'func': ':call zencoding#codePretty()'}, - \] - - if !hasmapto(''.item.plug, item.mode) - exe item.mode . 'noremap ' . item.plug . ' ' . item.func - endif - if !exists('g:' . item.var) - endif - if exists('g:' . item.var) - let key = eval('g:' . item.var) - else - let key = g:user_zen_leader_key . item.key - endif - if len(maparg(key, item.mode)) == 0 - exe item.mode . 'map ' . key . ' ' . item.plug - endif - endfor -endfunction - - -if exists('g:user_zen_mode') - let imode = matchstr(g:user_zen_mode, '[ai]') - let nmode = matchstr(g:user_zen_mode, '[an]') - let vmode = matchstr(g:user_zen_mode, '[av]') - - if !empty(imode) - call s:install_plugin_i() - endif - - if !empty(nmode) - call s:install_plugin_n() - endif - - if !empty(vmode) - call s:install_plugin_v() - endif -else - call s:install_plugin_i() - call s:install_plugin_n() - call s:install_plugin_v() -endif - - -delfunction s:install_plugin_i -delfunction s:install_plugin_n -delfunction s:install_plugin_v - -command! -nargs=1 Zen call zencoding#expandAbbr(4, ) - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et: diff --git a/sources_forked/zencoding/unittest.vim b/sources_forked/zencoding/unittest.vim deleted file mode 100755 index c4fcc3d2..00000000 --- a/sources_forked/zencoding/unittest.vim +++ /dev/null @@ -1,794 +0,0 @@ -let s:sfile = expand('') - -function! s:reload(d) - exe "so" a:d."/plugin/zencoding.vim" - for f in split(globpath(a:d, 'autoload/**/*.vim'), "\n") - silent! exe "so" f - endfor -endfunction - -function! s:show_type(type) - echohl Search | echon "[" a:type "]\n" | echohl None - echo "\r" -endfunction - -function! s:show_category(category) - echohl MatchParen | echon "[" a:category "]\n" | echohl None - echo "\r" -endfunction - -function! s:show_pass(pass) - echohl Title | echo "pass".a:pass."\n" | echohl None -endfunction - -function! s:show_done() - echohl IncSearch | echo "done" | echohl None -endfunction - -function! s:escape(str) - let str = a:str - let str = substitute(str, "\n", '\\n', 'g') - let str = substitute(str, "\t", '\\t', 'g') - return str -endfunction - -function! s:show_title(no, title) - let title = s:escape(a:title) - let width = &columns - 23 - echohl MoreMsg | echon "\rtesting #".printf("%03d", a:no) - echohl None | echon ": " . (len(title) < width ? (title.repeat(' ', width-len(title))) : strpart(title, 0, width)) . ' ... ' -endfunction - -function! s:show_skip(no, title) - let title = s:escape(a:title) - let width = &columns - 23 - echohl WarningMsg | echon "\rskipped #".printf("%03d", a:no) - echohl None | echon ": " . (len(title) < width ? (title.repeat(' ', width-len(title))) : strpart(title, 0, width)) . ' ... ' - echo "" -endfunction - -function! s:show_ok() - echohl Title | echon "ok\n" | echohl None - echo "" -endfunction - -function! s:show_ng(no, expect, got) - echohl WarningMsg | echon "ng\n" | echohl None - echohl ErrorMsg | echo "failed test #".a:no | echohl None - set more - echohl WarningMsg | echo printf("expect(%d):", len(a:expect)) | echohl None - echo join(split(a:expect, "\n", 1), "|\n") - echohl WarningMsg | echo printf("got(%d):", len(a:got)) | echohl None - echo join(split(a:got, "\n", 1), "|\n") - let cs = split(a:expect, '\zs') - for c in range(len(cs)) - if c < len(a:got) - if a:expect[c] != a:got[c] - echohl WarningMsg | echo "differ at:" | echohl None - echo a:expect[c :-1] - break - endif - endif - endfor - echo "" - throw "stop" -endfunction - -function! s:test(...) - let type = get(a:000, 0, '') - let name = get(a:000, 1, '') - let index = get(a:000, 2, '') - - let testgroups = eval(join(filter(split(substitute(join(readfile(s:sfile), "\n"), '.*\nfinish\n', '', ''), '\n', 1), "v:val !~ '^\"'"))) - for testgroup in testgroups - if len(type) > 0 && testgroup.type != type | continue | endif - call s:show_type(testgroup.type) - for category in testgroup.categories - if len(name) > 0 && substitute(category.name,' ','_','g') != name | continue | endif - call s:show_category(category.name) - let tests = category.tests - let start = reltime() - for n in range(len(tests)) - if len(index) > 0 && n != index | continue | endif - let query = tests[n].query - let result = tests[n].result - if has_key(tests[n], 'skip') && tests[n].skip != 0 - call s:show_skip(n+1, query) - continue - endif - if stridx(query, '$$$$') != -1 - silent! 1new - silent! exe "setlocal ft=".testgroup.type - silent! let key = matchstr(query, '.*\$\$\$\$\zs.*\ze\$\$\$\$') - if len(key) > 0 - exe printf('let key = "%s"', key) - else - let key = "\," - endif - silent! let query = substitute(query, '\$\$\$\$.*\$\$\$\$', '$$$$', '') - silent! call setline(1, split(query, "\n")) - let cmd = "normal gg0/\\$\\$\\$\\$\ri\\\\".key - if stridx(result, '$$$$') != -1 - let cmd .= '$$$$' - endif - silent! exe cmd - unlet! res | let res = join(getline(1, line('$')), "\n") - silent! bw! - call s:show_title(n+1, query) - else - call s:show_title(n+1, query) - unlet! res | let res = zencoding#ExpandWord(query, testgroup.type, 0) - endif - if stridx(result, '$$$$') != -1 - if res ==# result - call s:show_ok() - else - call s:show_ng(n+1, result, res) - endif - else - if res ==# result - call s:show_ok() - else - call s:show_ng(n+1, result, res) - endif - endif - endfor - call s:show_pass(reltimestr(reltime(start))) - endfor - endfor -endfunction - -function! s:do_tests(...) - try - if exists('g:user_zen_settings') - let s:old_user_zen_settings = g:user_zen_settings - let g:user_zen_settings = { 'indentation': "\t" } - endif - let oldmore = &more - call s:reload(fnamemodify(s:sfile, ':h')) - let &more = 0 - call call('s:test', a:000) - call s:show_done() - catch - echohl ErrorMsg | echomsg v:exception | echohl None - finally - let &more=oldmore - if exists('g:user_zen_settings') - let g:user_zen_settings = s:old_user_zen_settings - endif - endtry -endfunction - -function! g:zencoding_unittest_complete(arglead, cmdline, cmdpos) - let args = split(a:cmdline, '\s\+', 1) - let testgroups = eval(join(filter(split(substitute(join(readfile(s:sfile), "\n"), '.*\nfinish\n', '', ''), '\n', 1), "v:val !~ '^\"'"))) - try - if len(args) == 2 - return filter(map(testgroups, 'v:val.type'), 'stridx(v:val,args[1])!=-1') - elseif len(args) == 3 - return map(filter(testgroups, 'v:val.type==args[1]')[0].categories, 'substitute(v:val.name," ","_","g")') - endif - catch - endtry - return [] -endfunction - -command! -nargs=* -complete=customlist,g:zencoding_unittest_complete ZenCodingUnitTest call s:do_tests() -if s:sfile == expand('%:p') - ZenCodingUnitTest -endif - -finish -[ -{ - 'type': "html", - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "div", - 'result': "
    \n", - }, - { - 'query': "div#wrapper", - 'result': "
    \n", - }, - { - 'query': "div.box", - 'result': "
    \n", - }, - { - 'query': "a[title=TITLE]", - 'result': "\n", - }, - { - 'query': "div#wrapper.box", - 'result': "
    \n", - }, - { - 'query': "div#wrapper.box.current", - 'result': "
    \n", - }, - { - 'query': "div#wrapper.box.current[title=TITLE rel]", - 'result': "
    \n", - }, - { - 'query': "div#main+div#sub", - 'result': "
    \n
    \n", - }, - { - 'query': "div#main>div#sub", - 'result': "
    \n\t
    \n
    \n", - }, - { - 'query': "html:xt>div#header>div#logo+ul#nav>li.item-$*5>a", - 'result': "\n\n\n\t\n\t\n\n\n\t
    \n\t\t
    \n\t\t
      \n\t\t\t
    • \n\t\t\t
    • \n\t\t\t
    • \n\t\t\t
    • \n\t\t\t
    • \n\t\t
    \n\t
    \n\t\n\n", - }, - { - 'query': "ol>li*2", - 'result': "
      \n\t
    1. \n\t
    2. \n
    \n", - }, - { - 'query': "a", - 'result': "\n", - }, - { - 'query': "obj", - 'result': "\n", - }, - { - 'query': "cc:ie6>p+blockquote#sample$.so.many.classes*2", - 'result': "", - }, - { - 'query': "html:4t>div#wrapper>div#header+div#contents+div#footer", - 'result': "\n\n\n\t\n\t\n\n\n\t
    \n\t\t
    \n\t\t
    \n\t\t
    \n\t
    \n\t\n\n", - }, - { - 'query': "a[href=http://www.google.com/].foo#hoge", - 'result': "\n", - }, - { - 'query': "a[href=http://www.google.com/]{Google}", - 'result': "Google\n", - }, - { - 'query': "{ZenCoding}", - 'result': "ZenCoding", - }, - { - 'query': "a+b", - 'result': "\n\n", - }, - { - 'query': "a>b>i\n", - }, - { - 'query': "a>b>i^b", - 'result': "\n", - }, - { - 'query': "a>b>i<\n\n", - }, - { - 'query': "a>b>i^^b", - 'result': "\n\n", - }, - { - 'query': "blockquote>b>i<\n\n", - }, - { - 'query': "blockquote>b>i^^b", - 'result': "
    \n\n", - }, - { - 'query': "a[href=foo][class=bar]", - 'result': "\n", - }, - { - 'query': "a[a=b][b=c=d][e]{foo}*2", - 'result': "foo\nfoo\n", - }, - { - 'query': "a[a=b][b=c=d][e]*2{foo}", - 'result': "\n\nfoo", - }, - { - 'query': "a*2{foo}a", - 'result': "\n\nfoo\n", - }, - { - 'query': "a{foo}*2>b", - 'result': "foo\nfoo\n", - }, - { - 'query': "a*2{foo}>b", - 'result': "\n\nfoo", - }, - { - 'query': "table>tr>td.name#foo+td*3", - 'result': "\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n
    \n", - }, - { - 'query': "div#header + div#footer", - 'result': "
    \n
    \n", - }, - { - 'query': "#header + div#footer", - 'result': "
    \n
    \n", - }, - { - 'query': "#header > ul > li < p{Footer}", - 'result': "
    \n\t
      \n\t\t
    • \n\t
    \n\t

    Footer

    \n
    \n", - }, - { - 'query': "#header > ul > li ^ p{Footer}", - 'result': "
    \n\t
      \n\t\t
    • \n\t
    \n\t

    Footer

    \n
    \n", - }, - { - 'query': "a#foo$$$*3", - 'result': "\n\n\n", - }, - { - 'query': "ul+", - 'result': "
      \n\t
    • \n
    \n", - }, - { - 'query': "table+", - 'result': "\n\t\n\t\t\n\t\n
    \n", - }, - { - 'query': "#header>li<#content", - 'result': "
    \n\t
  • \n
    \n
    \n", - }, - { - 'query': "#header>li^#content", - 'result': "
    \n\t
  • \n
    \n
    \n", - }, - { - 'query': "(#header>li)<#content", - 'result': "
    \n\t
  • \n
    \n
    \n", - }, - { - 'query': "(#header>li)^#content", - 'result': "
    \n\t
  • \n
    \n
    \n", - }, - { - 'query': "a>b>i<\n
    \n", - }, - { - 'query': "a>b>i^^div", - 'result': "\n
    \n", - }, - { - 'query': "(#header>h1)+#content+#footer", - 'result': "
    \n\t

    \n
    \n
    \n
    \n", - }, - { - 'query': "(#header>h1)+(#content>(#main>h2+div#entry$.section*5>(h3>a)+div>p*3+ul+)+(#utilities))+(#footer>address)", - 'result': "
    \n\t

    \n
    \n
    \n\t
    \n\t\t

    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t
      \n\t\t\t\t\t
    • \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t
      \n\t\t\t\t\t
    • \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t
      \n\t\t\t\t\t
    • \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t
      \n\t\t\t\t\t
    • \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t

    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t

    \n\t\t\t\t
      \n\t\t\t\t\t
    • \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t
    \n
    \n
    \n\t
    \n
    \n", - }, - { - 'query': "(div>(ul*2)*2)+(#utilities)", - 'result': "
    \n\t
      \n\t
        \n\t
          \n\t
            \n
            \n
            \n", - }, - { - 'query': "table>(tr>td*3)*4", - 'result': "\n\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\t\n\t\n
            \n", - }, - { - 'query': "(((a#foo+a#bar)*2)*3)", - 'result': "\n\n\n\n\n\n\n\n\n\n\n\n", - }, - { - 'query': "div#box$*3>h3+p*2", - 'result': "
            \n\t

            \n\t

            \n\t

            \n
            \n
            \n\t

            \n\t

            \n\t

            \n
            \n
            \n\t

            \n\t

            \n\t

            \n
            \n" - }, - { - 'query': "div#box.foo$$$.bar$$$*3", - 'result': "
            \n
            \n
            \n", - }, - { - 'query': "div#box$*3>h3+p.bar*2|e", - 'result': "<div id=\"box1\">\n\t<h3></h3>\n\t<p class=\"bar\"></p>\n\t<p class=\"bar\"></p>\n</div>\n<div id=\"box2\">\n\t<h3></h3>\n\t<p class=\"bar\"></p>\n\t<p class=\"bar\"></p>\n</div>\n<div id=\"box3\">\n\t<h3></h3>\n\t<p class=\"bar\"></p>\n\t<p class=\"bar\"></p>\n</div>\n", - }, - { - 'query': "div>div#page>p.title+p|c", - 'result': "
            \n\t\n\t
            \n\t\t\n\t\t

            \n\t\t\n\t\t

            \n\t
            \n\t\n
            \n", - }, - { - 'query': "link:css", - 'result': "\n", - }, - { - 'query': "a[title=\"Hello', world\" rel]", - 'result': "\n", - }, - { - 'query': "div>a#foo{bar}", - 'result': "\n", - }, - { - 'query': ".content{Hello!}", - 'result': "
            Hello!
            \n", - }, - { - 'query': "div.logo+(div#navigation)+(div#links)", - 'result': "
            \n
            \n
            \n", - }, - { - 'query': "h1{header}+{Text}+a[href=http://link.org]{linktext}+{again some text}+a[href=http://anoterlink.org]{click me!}+{some final text}", - 'result': "

            header

            \nTextlinktext\nagain some textclick me!\nsome final text", - }, - { - 'query': "a{&}+div{&&}", - 'result': "&\n
            &&
            \n", - }, - { - 'query': "span$$$$\\,$$$$", - 'result': "", - }, - { - 'query': "foo span$$$$\\,$$$$", - 'result': "foo ", - }, - { - 'query': "foo span$$$$\\,$$$$ bar", - 'result': "foo bar", - }, - { - 'query': "foo $$$$\\ve\\,p\\$$$$bar baz", - 'result': "foo

            bar

            baz", - }, - { - 'query': "foo $$$$\\vee\\,p\\$$$$bar baz", - 'result': "foo

            bar baz

            ", - }, - { - 'query': "f div.boxes>article.box2>header>(hgroup>h2{aaa}+h3{bbb})+p{ccc}$$$$", - 'result': "f
            \n\t
            \n\t\t
            \n\t\t\t
            \n\t\t\t\t

            aaa

            \n\t\t\t\t

            bbb

            \n\t\t\t
            \n\t\t\t

            ccc

            \n\t\t
            \n\t
            \n
            ", - }, - { - 'query': "div.boxes>(div.box2>section>h2{a}+p{b})+(div.box1>section>h2{c}+p{d}+p{e}+(bq>h2{f}+h3{g})+p{h})", - 'result': "
            \n\t
            \n\t\t
            \n\t\t\t

            a

            \n\t\t\t

            b

            \n\t\t
            \n\t
            \n\t
            \n\t\t
            \n\t\t\t

            c

            \n\t\t\t

            d

            \n\t\t\t

            e

            \n\t\t\t
            \n\t\t\t\t

            f

            \n\t\t\t\t

            g

            \n\t\t\t
            \n\t\t\t

            h

            \n\t\t
            \n\t
            \n
            \n", - }, - { - 'query': "(div>(label+input))+div", - 'result': "
            \n\t\n\t\n
            \n
            \n", - }, - { - 'query': "test1\ntest2\ntest3$$$$\\ggVG\\,ul>li>span*>a\\$$$$", - 'result': "", - }, - { - 'query': "test1\ntest2\ntest3$$$$\\ggVG\\,input[type=input value=$#]*\\$$$$", - 'result': "\n\n", - }, - { - 'query': "div#id-$*5>div#id2-$", - 'result': "
            \n\t
            \n
            \n
            \n\t
            \n
            \n
            \n\t
            \n
            \n
            \n\t
            \n
            \n
            \n\t
            \n
            \n", - }, - { - 'query': "{test case $ }*3", - 'result': "test case 1 test case 2 test case 3 ", - }, - { - 'query': "{test case $${nr}}*3", - 'result': "test case 1\ntest case 2\ntest case 3\n", - }, - { - 'query': "{test case \\$ }*3", - 'result': "test case $ test case $ test case $ ", - }, - { - 'query': "{test case $$$ }*3", - 'result': "test case 001 test case 002 test case 003 ", - }, - { - 'query': "a[title=$#]{foo}", - 'result': "foo\n", - }, - ], - }, - { - 'name': 'split join tag', - 'tests': [ - { - 'query': "
            \n\t$$$$\\j$$$$\n
            ", - 'result': "
            \n\t\n
            ", - }, - { - 'query': "
            \n\tj$$$$/>\n
            ", - 'result': "
            \n\t\n
            ", - }, - ], - }, - { - 'name': 'toggle comment', - 'tests': [ - { - 'query': "
            \n\t$$$$\\/$$$$\n
            ", - 'result': "
            \n\t\n
            ", - }, - { - 'query': "
            \n\t\n
            ", - 'result': "
            \n\t\n
            ", - }, - ], - }, - { - 'name': 'image size', - 'tests': [ - { - 'query': "img[src=http://mattn.kaoriya.net/images/logo.png]$$$$\\,\\i$$$$", - 'result': "\"\"", - }, - { - 'query': "img[src=/logo.png]$$$$\\,\\i$$$$", - 'result': "\"\"", - }, - ], - }, - { - 'name': 'move next prev', - 'tests': [ - { - 'query': "foo+bar+baz[dankogai=\"\"]$$$$\\,\\gg0\\n\\n\\n\\Byw:%d _\\p$$$$", - 'result': "dankogai", - }, - ], - }, - ], -}, -{ - 'type': 'css', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "@i", - 'result': "@import url();", - }, - { - 'query': "fs:n", - 'result': "font-style: normal;", - }, - { - 'query': "fl:l|fc", - 'result': "float: left;", - }, - { - 'query': "bg+$$$$", - 'result': "background: #FFF url($$$$) 0 0 no-repeat;", - }, - { - 'query': "bg+!$$$$", - 'result': "background: #FFF url($$$$) 0 0 no-repeat !important;", - }, - { - 'query': "m$$$$", - 'result': "margin: $$$$;", - }, - { - 'query': "m0.1p$$$$", - 'result': "margin: 0.1%;", - }, - { - 'query': "m1.0$$$$", - 'result': "margin: 1.0em;", - }, - { - 'query': "m2$$$$", - 'result': "margin: 2px;", - }, - { - 'query': "bdrs10$$$$", - 'result': "border-radius: 10px;", - }, - { - 'query': "-bdrs20$$$$", - 'result': "-webkit-border-radius: 20px;\n-moz-border-radius: 20px;\nborder-radius: 20px;", - }, - { - 'query': "lg(top,#fff,#000)$$$$", - 'result': "background-image: -webkit-gradient(top, 0 0, 0 100, from(#fff), to(#000));\nbackground-image: -webkit-linear-gradient(#fff, #000);\nbackground-image: -moz-linear-gradient(#fff, #000);\nbackground-image: -o-linear-gradient(#fff, #000);\nbackground-image: linear-gradient(#fff, #000);\n", - }, - { - 'query': "m10-5-0$$$$", - 'result': "margin: 10px 5px 0px;", - }, - { - 'query': "m-10--5$$$$", - 'result': "margin: -10px -5px;", - }, - { - 'query': "m10-auto$$$$", - 'result': "margin: 10px auto;", - }, - { - 'query': "w100p$$$$", - 'result': "width: 100%;", - }, - { - 'query': "h50e$$$$", - 'result': "height: 50em;", - }, - { - 'query': "(bg+)+c$$$$", - 'result': "background: #FFF url($$$$) 0 0 no-repeat;\ncolor: #000;", - }, - ], - }, - ], -}, -{ - 'type': 'haml', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "div>p+ul#foo>li.bar$[foo=bar][bar=baz]*3>{baz}", - 'result': "%div\n %p\n %ul#foo\n %li.bar1{ :foo => \"bar\", :bar => \"baz\" } baz\n %li.bar2{ :foo => \"bar\", :bar => \"baz\" } baz\n %li.bar3{ :foo => \"bar\", :bar => \"baz\" } baz\n", - }, - { - 'query': "div>p+ul#foo>li.bar$[foo=bar][bar=baz]*3>{baz}|haml", - 'result': "%div\n %p\n %ul#foo\n %li.bar1{ :foo => \"bar\", :bar => \"baz\" } baz\n %li.bar2{ :foo => \"bar\", :bar => \"baz\" } baz\n %li.bar3{ :foo => \"bar\", :bar => \"baz\" } baz\n", - }, - { - 'query': "a*3|haml", - 'result': "%a{ :href => \"\" }\n%a{ :href => \"\" }\n%a{ :href => \"\" }\n", - }, - { - 'query': ".content{Hello!}|haml", - 'result': "%div.content Hello!\n", - }, - { - 'query': "a[title=$#]{foo}", - 'result': "%a{ :href => \"\", :title => \"foo\" } foo\n", - }, - ], - }, - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "%a foo\n bar$$$$\\j$$$$", - 'result': "%a ", - }, - { - 'query': "$$$$\\j$$$$%a ", - 'result': "%a $$$$", - }, - ], - }, - { - 'name': 'toggle comment', - 'tests': [ - { - 'query': "%a{ :href => \"http://www.google.com\"$$$$\\/$$$$ } hello", - 'result': "-# %a{ :href => \"http://www.google.com\" } hello", - }, - { - 'query': "-# %a{ :href => \"http://www.google.com\"$$$$\\/$$$$ } hello", - 'result': "%a{ :href => \"http://www.google.com\" } hello", - }, - ], - }, - ], -}, -{ - 'type': 'slim', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "div>p+ul#foo>li.bar$[foo=bar][bar=baz]*3>{baz}", - 'result': "div\n p\n ul id=\"foo\"\n li class=\"bar1\" foo=\"bar\" bar=\"baz\"\n | baz\n li class=\"bar2\" foo=\"bar\" bar=\"baz\"\n | baz\n li class=\"bar3\" foo=\"bar\" bar=\"baz\"\n | baz\n", - }, - { - 'query': "div>p+ul#foo>li.bar$[foo=bar][bar=baz]*3>{baz}|slim", - 'result': "div\n p\n ul id=\"foo\"\n li class=\"bar1\" foo=\"bar\" bar=\"baz\"\n | baz\n li class=\"bar2\" foo=\"bar\" bar=\"baz\"\n | baz\n li class=\"bar3\" foo=\"bar\" bar=\"baz\"\n | baz\n", - }, - { - 'query': "a*3|slim", - 'result': "a href=\"\"\na href=\"\"\na href=\"\"\n", - }, - { - 'query': ".content{Hello!}|slim", - 'result': "div class=\"content\"\n | Hello!\n", - }, - { - 'query': "a[title=$#]{foo}", - 'result': "a href=\"\" title=\"foo\"\n | foo\n", - }, - ], - }, - { - 'name': 'split join tag', - 'tests': [ - { - 'query': "a\n | foo$$$$\\j$$$$", - 'result': "a", - }, - { - 'query': "a$$$$\\j$$$$", - 'result': "a\n | $$$$", - }, - ], - }, - { - 'name': 'toggle comment', - 'tests': [ - { - 'query': "a href=\"http://www.google.com\"$$$$\\/$$$$\n | hello", - 'result': "/a href=\"http://www.google.com\"\n | hello", - }, - { - 'query': "/a href=\"http://www.google.com\"$$$$\\/$$$$\n | hello", - 'result': "a href=\"http://www.google.com\"\n | hello", - }, - ], - }, - ], -}, -{ - 'type': 'xsl', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "vari", - 'result': "\n", - }, - { - 'query': "ap>wp", - 'result': "\n\t\n\n", - }, - ], - }, - ], -}, -{ - 'type': 'xsd', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "xsd:w3c", - 'result': "\n\n\t\n", - }, - ], - }, - ], -}, -{ - 'type': 'mustache', - 'categories': [ - { - 'name': 'expand abbreviation', - 'tests': [ - { - 'query': "div#{{foo}}", - 'result': "
            \n", - }, - { - 'query': "div.{{foo}}", - 'result': "
            \n", - }, - ], - }, - ], -}, -] -" vim:set et: diff --git a/sources_forked/zencoding/zencoding.vim.vimup b/sources_forked/zencoding/zencoding.vim.vimup deleted file mode 100755 index 72608e48..00000000 --- a/sources_forked/zencoding/zencoding.vim.vimup +++ /dev/null @@ -1,265 +0,0 @@ -script_name: ZenCoding.vim -script_id: '2981' -script_type: utility -script_package: zencoding-vim.zip -script_version: '0.80' -required_vim_version: '7.0' -summary: vim plugins for HTML and CSS hi-speed coding. - -detailed_description: | - - This is vim script support expanding abbreviation like zen-coding. - ref: http://code.google.com/p/zen-coding/ - - There is a movie using zencoding.vim - ref: http://mattn.github.com/zencoding-vim - - Source Repository. - ref: http://github.com/mattn/zencoding-vim - - Type abbreviation - +------------------------------------- - | html:5_ - +------------------------------------- - "_" is a cursor position. and type "," (Ctrl + y and Comma) - NOTE: Don't worry about key map. you can change it easily. - +------------------------------------- - | - | - | - | - | - | - | - | _ - | - | - +------------------------------------- - Type following - +------------------------------------- - | div#foo$*2>div.bar - +------------------------------------- - And type "," - +------------------------------------- - |
            - |
            _
            - |
            - |
            - |
            - |
            - | _ - +------------------------------------- - - Tutorial: - - http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL - - How work this: - - http://mattn.github.com/zencoding-vim - - Tips: - - You can customize behavior of expanding with overriding config. - This configuration will be marged at loading plugin. - - let g:user_zen_settings = { - \ 'indentation' : ' ', - \ 'perl' : { - \ 'aliases' : { - \ 'req' : 'require ' - \ }, - \ 'snippets' : { - \ 'use' : "use strict\nuse warnings\n\n", - \ 'warn' : "warn \"|\";", - \ } - \ } - \} - - let g:user_zen_expandabbr_key = '' - - let g:use_zen_complete_tag = 1 - - You can set language attribute in html using zen_settings['lang']. - -install_details: | - - # cd ~/.vim - # unzip zencoding-vim.zip - - or if you install pathogen.vim: - - # cd ~/.vim/bundle # or make directory - # unzip /path/to/zencoding-vim.zip - - if you get sources from repository: - - # cd ~/.vim/bundle # or make directory - # git clone http://github.com/mattn/zencoding-vim.git - -versions: -- '0.80': | - This is an upgrade for ZenCoding.vim: add emmet features. -- '0.74': | - This is an upgrade for ZenCoding.vim: many bug fixes. -- '0.73': | - This is an upgrade for ZenCoding.vim: many bug fixes. and support slim format (experimental). -- '0.72': | - This is an upgrade for ZenCoding.vim: - [fix] fix finding tokens. -- '0.71': | - This is an upgrade for ZenCoding.vim: - [fix] fix finding begin of tokens. -- '0.70': | - This is an upgrade for ZenCoding.vim: - [mod] Changed behavior of expanding. "div div>a|" should keep first div element. - [add] Supported slim formatter. -- '0.60': | - This is an upgrade for ZenCoding.vim: - [fix] fixed expanding {{}}. -- '0.59': | - This is an upgrade for ZenCoding.vim: - [fix] fixed toggleComment and mny bugs. -- '0.58': | - This is an upgrade for ZenCoding.vim: - [fix] fixed 'foo+' style expandos. -- '0.57': | - This is an upgrade for ZenCoding.vim: - [fix] fixed expandos that don't work 'choose' in xsl. -- '0.56': | - This is an upgrade for ZenCoding.vim: - [fix] fixed contents parser. -- '0.55': | - uploaded again: sorry, files was old. -- '0.54': | - [add] support sass, xsd. - [fix] expanding with html tag. - uploaded again: sorry, fileformat was DOS. -- '0.53': | - [fix] gif width/height was swapped. -- '0.52': | - [fix] broken wrap expanding. -- '0.51': | - This is an upgrade for ZenCoding.vim: - [fix] wrap expanding with '&'. - [fix] expand .content to class="content". - [fix] haml expanding. - [fix] bg+ snippet -- '0.50': | - This is an upgrade for ZenCoding.vim: - [fix] fixed parsing '#{{foo}}' and '.{{bar}}'. -- '0.49': | - This is an upgrade for ZenCoding.vim: - [doc] add help manual. -- '0.48': | - This is an upgrade for ZenCoding.vim: - [fix] install mappings to global. -- '0.47': | - This is an upgrade for ZenCoding.vim: - [drastic changes] enable autoload. you should whole replace older files. - package was empty. upload again. -- '0.46': | - This is an upgrade for ZenCoding.vim: - [drastic changes] enable autoload. you should whole replace older files. -- '0.45': | - This is an upgrade for ZenCoding.vim: - fixed attribute parsing like: a[href="hello', world" rel]. -- '0.44': | - This is an upgrade for ZenCoding.vim: - fixed checking whether have mapping using maparg() / hasmapto(). -- '0.43': | - This is an upgrade for ZenCoding.vim: - fixed behavior for nested block. like "html:5>#page>(header#globalHeader>(hgroup>h1+h2)+(nav>ul>li*3>a)+(form>p.siteSearch>input+input[type=button]))+(#contents>(#main>(section>h2+p*5)+p.pagetop>a[href=#page])+(#sub>p+(nav>ul>li>a)))+(footer#globalFoooter>(ul>li>a)+(p.copyright>small))" -- '0.42': | - This is an upgrade for ZenCoding.vim: - fixed select/option indent. -- '0.41': | - This is an upgrade for ZenCoding.vim: - fixed default filter. when using 'e' filter, output become empty. -- '0.40': | - This is an upgrade for ZenCoding.vim: - add the pure vimscript code for 'get image size'. you can use it without perl interface just now. - change key assign of ZenCodingExpandWord from ',' to ';'. it don't effect to most users. -- '0.39': | - This is an upgrade for ZenCoding.vim: fixed problem about 'selection'. see http://github.com/mattn/zencoding-vim/issues/#issue/2 -- '0.38': | - This is an upgrade for ZenCoding.vim: use v7h"_s instead of v7hs for backspace. -- '0.37': | - This is an upgrade for ZenCoding.vim: fixed problem that won't working with some 'backspace' options. -- '0.36': | - This is an upgrade for ZenCoding.vim: fixed problem that filter does not work. -- '0.35': | - This is an upgrade for ZenCoding.vim: enable zencoding for other languages. (meaning php also) -- '0.34': | - This is an upgrade for ZenCoding.vim: enable zencoding for xsl. (you should add ~/.vim/ftplugin/xslt/zencoding.vim) -- '0.33': | - This is an upgrade for ZenCoding.vim: fixed problem breaking multibyte when cursor is in a part of line. enabled zencoding for javascript in html. -- '0.32': | - This is an upgrade for ZenCoding.vim: fixed indentation. supported extends so that you can enable zencoding for php/xhtml/haml other's section 14 in http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL -- '0.31': | - This is an upgrade for ZenCoding.vim: fixed indentation and $$$ problem. fixed about missing support multiple classes. -- '0.30': | - This is an upgrade for ZenCoding.vim: Fixed key assign. -- '0.29': | - This is an upgrade for ZenCoding.vim: Changed leading key to '' from ''. -- '0.28': | - This is an upgrade for ZenCoding.vim: supported 'Balance Tag Inward/Outward', 'Go to Next/Previous Edit Point', 'Update Size', 'Remove Tag', 'Split/Join Tag', 'Toggle Comment' -- '0.27': | - This is an upgrade for ZenCoding.vim: fixed problem that can't work on the part of multibyte characters. fixed inline elements behavior. -- '0.26': | - This is an upgrade for ZenCoding.vim: The count of '(((a#foo + a#bar)*2)*3)' should be 12. -- '0.25': | - This is an upgrade for ZenCoding.vim: store undo before working. good luck about 'table>(tr>td*3)*4'. -- '0.24': | - This is an upgrade for ZenCoding.vim: fixed behavior of parsing area of visual selection. -- '0.23': | - This is an upgrade for ZenCoding.vim: pre-expand '#header>li<#content' to 'div#header>lili'. fix undo ring. support visual selection. when type trigger key on visual select, it request you leader like 'ul>li'. if you give 'ul>li*' as leader, you'll get each separate 'ul>li' tags. and when you give 'blockquote' as leader, you'll get blocked text. -- '0.21': | - This is an upgrade for ZenCoding.vim: treat xhtml as html. -- '0.20': | - This is an upgrade for ZenCoding.vim: add option use_zen_complete_tag for complete abbr. -- '0.19': | - This is an upgrade for ZenCoding.vim: fixed problem that couldn't expand 'link:css' correctly. -- '0.18': | - This is an upgrade for ZenCoding.vim: ignore duplicate key map. -- '0.17': | - This is an upgrade for ZenCoding.vim: fixed key map. -- '0.16': | - This is an upgrade for ZenCoding.vim: fixed problem 'endless loop'. -- '0.15': | - This is an upgrade for ZenCoding.vim: set default filetype to 'html'. -- '0.14': | - This is an upgrade for ZenCoding.vim: fixed tag name like 'fs:n' in 'css'. -- '0.14': | - This is an upgrade for ZenCoding.vim: indentation for each languages. -- '0.13': | - This is an upgrade for ZenCoding.vim: user key map. -- '0.12': | - This is an upgrade for ZenCoding.vim: few extensive notation. -- '0.11': | - This is an upgrade for ZenCoding.vim: fixed indent. -- '0.10': | - This is an upgrade for ZenCoding.vim: fixed behavior of '+' operator -- '0.9': | - This is an upgrade for ZenCoding.vim: fixed single line behavior -- '0.8': | - This is an upgrade for ZenCoding.vim: support 'a[href=http://www.google.com]{Google}' -- '0.7': | - This is an upgrade for ZenCoding.vim: fixed behavior in 'a+b'. -- '0.6': | - This is an upgrade for ZenCoding.vim: fixed strange behavior about 'b_'. -- '0.5': | - This is an upgrade for ZenCoding.vim: recover rest part in line. -- '0.4': | - This is an upgrade for ZenCoding.vim: fixed cursor position. fixed ${lang} replacement. -- '0.3': | - This is an upgrade for ZenCoding.vim: fixed line expanding. -- '0.2': | - This is an upgrade for ZenCoding.vim: fixed problem that moving cursor with expanding. -- '0.1': | - Initial upload - -# __END__ -# vim: filetype=yaml diff --git a/sources_non_forked/ack.vim/LICENSE b/sources_non_forked/ack.vim/LICENSE new file mode 100644 index 00000000..056ea36c --- /dev/null +++ b/sources_non_forked/ack.vim/LICENSE @@ -0,0 +1,89 @@ +ack.vim is distributed under the same license terms as Vim itself, which you +can find in full with `:help license` within Vim, or copied in full herein. + +Copyright (c) 2007-2015 Antoine Imbert + and contributors. + +Maintainers may be contacted via GitHub Issues at: + + https://github.com/mileszs/ack.vim/issues + + +VIM LICENSE + +I) There are no restrictions on distributing unmodified copies of Vim except + that they must include this license text. You can also distribute + unmodified parts of Vim, likewise unrestricted except that they must + include this license text. You are also allowed to include executables + that you made from the unmodified Vim sources, plus your own usage + examples and Vim scripts. + +II) It is allowed to distribute a modified (or extended) version of Vim, + including executables and/or source code, when the following four + conditions are met: + 1) This license text must be included unmodified. + 2) The modified Vim must be distributed in one of the following five ways: + a) If you make changes to Vim yourself, you must clearly describe in + the distribution how to contact you. When the maintainer asks you + (in any way) for a copy of the modified Vim you distributed, you + must make your changes, including source code, available to the + maintainer without fee. The maintainer reserves the right to + include your changes in the official version of Vim. What the + maintainer will do with your changes and under what license they + will be distributed is negotiable. If there has been no negotiation + then this license, or a later version, also applies to your changes. + The current maintainer is Bram Moolenaar . If this + changes it will be announced in appropriate places (most likely + vim.sf.net, www.vim.org and/or comp.editors). When it is completely + impossible to contact the maintainer, the obligation to send him + your changes ceases. Once the maintainer has confirmed that he has + received your changes they will not have to be sent again. + b) If you have received a modified Vim that was distributed as + mentioned under a) you are allowed to further distribute it + unmodified, as mentioned at I). If you make additional changes the + text under a) applies to those changes. + c) Provide all the changes, including source code, with every copy of + the modified Vim you distribute. This may be done in the form of a + context diff. You can choose what license to use for new code you + add. The changes and their license must not restrict others from + making their own changes to the official version of Vim. + d) When you have a modified Vim which includes changes as mentioned + under c), you can distribute it without the source code for the + changes if the following three conditions are met: + - The license that applies to the changes permits you to distribute + the changes to the Vim maintainer without fee or restriction, and + permits the Vim maintainer to include the changes in the official + version of Vim without fee or restriction. + - You keep the changes for at least three years after last + distributing the corresponding modified Vim. When the maintainer + or someone who you distributed the modified Vim to asks you (in + any way) for the changes within this period, you must make them + available to him. + - You clearly describe in the distribution how to contact you. This + contact information must remain valid for at least three years + after last distributing the corresponding modified Vim, or as long + as possible. + e) When the GNU General Public License (GPL) applies to the changes, + you can distribute the modified Vim under the GNU GPL version 2 or + any later version. + 3) A message must be added, at least in the output of the ":version" + command and in the intro screen, such that the user of the modified Vim + is able to see that it was modified. When distributing as mentioned + under 2)e) adding the message is only required for as far as this does + not conflict with the license used for the changes. + 4) The contact information as required under 2)a) and 2)d) must not be + removed or changed, except that the person himself can make + corrections. + +III) If you distribute a modified version of Vim, you are encouraged to use + the Vim license for your changes and make them available to the + maintainer, including the source code. The preferred way to do this is + by e-mail or by uploading the files to a server and e-mailing the URL. + If the number of changes is small (e.g., a modified Makefile) e-mailing a + context diff will do. The e-mail address to be used is + + +IV) It is not allowed to remove this license from the distribution of the Vim + sources, parts of it or from a modified version. You may use this + license for previous Vim releases instead of the license that they came + with, at your option. diff --git a/sources_non_forked/ack.vim/README.md b/sources_non_forked/ack.vim/README.md index c2e87067..a82bb804 100644 --- a/sources_non_forked/ack.vim/README.md +++ b/sources_non_forked/ack.vim/README.md @@ -129,15 +129,6 @@ optional background search execution with [vim-dispatch], and auto-previewing. Please see [the Github releases page][releases]. -### 1.0.9 (unreleased) - -* Fix location list and layout of quickfix when using Dispatch (#154) -* Fix the quick help overlay clobbering the list mappings -* Fix `:AckFile` when using Dispatch -* Restore original `'makeprg'` and `'errorformat'` when using Dispatch -* Arrow keys also work for auto-preview (#158) -* Internal refactoring and clean-up - ## Credits This plugin is derived from Antoine Imbert's blog post [Ack and Vim diff --git a/sources_non_forked/ack.vim/doc/ack_quick_help.txt b/sources_non_forked/ack.vim/doc/ack_quick_help.txt index bcdf5160..94306a0e 100644 --- a/sources_non_forked/ack.vim/doc/ack_quick_help.txt +++ b/sources_non_forked/ack.vim/doc/ack_quick_help.txt @@ -1,14 +1,15 @@ ==== ack.vim quick help =============== - *?:* Show/quit this help - *t:* Open in a new tab - *T:* Open in a new tab silently - *o:* Open - *O:* Open and close result window - *go:* Preview - *h:* Horizontal open - *H:* Horizontal open silently - *v:* Vertical open - *gv:* Vertical open silently + *?:* a quick summary of these keys, repeat to close + *o:* to open (same as Enter) + *O:* to open and close the quickfix window + *go:* to preview file, open but maintain focus on ack.vim results + *t:* to open in new tab + *T:* to open in new tab without moving to it + *h:* to open in horizontal split + *H:* to open in horizontal split, keeping focus on the results + *v:* to open in vertical split + *gv:* to open in vertical split, keeping focus on the results + *q:* to close the quickfix window ======================================== diff --git a/sources_non_forked/ag.vim/README.md b/sources_non_forked/ag.vim/README.md index 21ea504b..9e43262a 100644 --- a/sources_non_forked/ag.vim/README.md +++ b/sources_non_forked/ag.vim/README.md @@ -67,6 +67,9 @@ In the quickfix window, you can use: gv to open in vertical split silently q to close the quickfix window +### Related Plugin ### +[vim-ag-anything](https://github.com/Chun-Yang/vim-ag-anything) adds an 'ga' action to search any text object. + ### Acknowledgements ### This Vim plugin is derived (and by derived, I mean copied, almost entirely) diff --git a/sources_non_forked/goyo.vim/autoload/goyo.vim b/sources_non_forked/goyo.vim/autoload/goyo.vim index e66c5c14..3e014667 100644 --- a/sources_non_forked/goyo.vim/autoload/goyo.vim +++ b/sources_non_forked/goyo.vim/autoload/goyo.vim @@ -33,8 +33,8 @@ function! s:get_color(group, attr) endfunction function! s:set_color(group, attr, color) - let gui = has('gui_running') - execute printf("hi %s %s%s=%s", a:group, gui ? 'gui' : 'cterm', a:attr, a:color) + let gui = a:color =~ '^#' + execute printf('hi %s %s%s=%s', a:group, gui ? 'gui' : 'cterm', a:attr, a:color) endfunction function! s:blank(repel) @@ -106,7 +106,7 @@ function! s:resize_pads() endfunction function! s:tranquilize() - let bg = s:get_color('Normal', 'bg') + let bg = s:get_color('Normal', 'bg#') for grp in ['NonText', 'FoldColumn', 'ColorColumn', 'VertSplit', \ 'StatusLine', 'StatusLineNC', 'SignColumn'] " -1 on Vim / '' on GVim @@ -161,6 +161,8 @@ function! s:maps_resize() return mapped endfunction +nnoremap (goyo-resize) :call resize_pads() + function! s:goyo_on(dim) let dim = s:parse_arg(a:dim) if empty(dim) @@ -207,13 +209,13 @@ function! s:goyo_on(dim) endif " vim-airline - let t:goyo_disabled_airline = exists("#airline") + let t:goyo_disabled_airline = exists('#airline') if t:goyo_disabled_airline AirlineToggle endif " vim-powerline - let t:goyo_disabled_powerline = exists("#PowerlineMain") + let t:goyo_disabled_powerline = exists('#PowerlineMain') if t:goyo_disabled_powerline augroup PowerlineMain autocmd! @@ -222,7 +224,7 @@ function! s:goyo_on(dim) endif " lightline.vim - let t:goyo_disabled_lightline = exists('#LightLine') + let t:goyo_disabled_lightline = exists('#lightline') if t:goyo_disabled_lightline silent! call lightline#disable() endif @@ -263,6 +265,9 @@ function! s:goyo_on(dim) autocmd ColorScheme * call s:tranquilize() autocmd BufWinEnter * call s:hide_linenr() | call s:hide_statusline() autocmd WinEnter,WinLeave * call s:hide_statusline() + if has('nvim') + autocmd TermClose * call feedkeys("\(goyo-resize)") + endif augroup END call s:hide_statusline() @@ -330,7 +335,7 @@ function! s:goyo_off() let &winheight = wh for [k, v] in items(goyo_revert) - execute printf("let &%s = %s", k, string(v)) + execute printf('let &%s = %s', k, string(v)) endfor execute 'colo '. get(g:, 'colors_name', 'default') @@ -344,7 +349,7 @@ function! s:goyo_off() endif endif - if goyo_disabled_airline && !exists("#airline") + if goyo_disabled_airline && !exists('#airline') AirlineToggle " For some reason, Airline requires two refreshes to avoid display " artifacts @@ -352,7 +357,7 @@ function! s:goyo_off() silent! AirlineRefresh endif - if goyo_disabled_powerline && !exists("#PowerlineMain") + if goyo_disabled_powerline && !exists('#PowerlineMain') doautocmd PowerlineStartup VimEnter silent! PowerlineReloadColorscheme endif diff --git a/sources_non_forked/nginx-vim-syntax/README.md b/sources_non_forked/nginx-vim-syntax/README.md new file mode 100644 index 00000000..2893faf6 --- /dev/null +++ b/sources_non_forked/nginx-vim-syntax/README.md @@ -0,0 +1,10 @@ +# nginx syntax files for Vim. + +*NOTE*: As of Dec. 2013, these scripts are maintained in the "contrib" directory of the Nginx source: + +* http://hg.nginx.org/nginx/rev/f38043bd15f5 + +You can see the original vim.org version here: + +* http://www.vim.org/scripts/script.php?script_id=1886 + diff --git a/sources_non_forked/nginx-vim-syntax/ftdetect/nginx.vim b/sources_non_forked/nginx-vim-syntax/ftdetect/nginx.vim new file mode 100644 index 00000000..3ae470d2 --- /dev/null +++ b/sources_non_forked/nginx-vim-syntax/ftdetect/nginx.vim @@ -0,0 +1,4 @@ +au BufRead,BufNewFile *.nginx set ft=nginx +au BufRead,BufNewFile */etc/nginx/* set ft=nginx +au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx +au BufRead,BufNewFile nginx.conf set ft=nginx diff --git a/sources_non_forked/nginx-vim/indent/nginx.vim b/sources_non_forked/nginx-vim-syntax/indent/nginx.vim old mode 100755 new mode 100644 similarity index 91% rename from sources_non_forked/nginx-vim/indent/nginx.vim rename to sources_non_forked/nginx-vim-syntax/indent/nginx.vim index 51115e91..86013668 --- a/sources_non_forked/nginx-vim/indent/nginx.vim +++ b/sources_non_forked/nginx-vim-syntax/indent/nginx.vim @@ -3,6 +3,8 @@ if exists("b:did_indent") endif let b:did_indent = 1 +setlocal indentexpr= + " cindent actually works for nginx' simple file structure setlocal cindent " Just make sure that the comments are not reset as defs would be. diff --git a/sources_non_forked/nginx.vim/syntax/nginx.vim b/sources_non_forked/nginx-vim-syntax/syntax/nginx.vim similarity index 92% rename from sources_non_forked/nginx.vim/syntax/nginx.vim rename to sources_non_forked/nginx-vim-syntax/syntax/nginx.vim index ccd47680..50d809bc 100644 --- a/sources_non_forked/nginx.vim/syntax/nginx.vim +++ b/sources_non_forked/nginx-vim-syntax/syntax/nginx.vim @@ -9,12 +9,11 @@ setlocal iskeyword+=. setlocal iskeyword+=/ setlocal iskeyword+=: -syn match ngxVariable '\$\w\w*' -syn match ngxVariableBlock '\$\w\w*' contained -syn match ngxVariableString '\$\w\w*' contained -syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline -syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline -syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline +syn match ngxVariable '\$\(\w\+\|{\w\+}\)' +syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained +syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained +syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline +syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString syn match ngxComment ' *#.*$' syn keyword ngxBoolean on @@ -643,6 +642,46 @@ syn keyword ngxDirectiveThirdParty xss_get syn keyword ngxDirectiveThirdParty xss_input_types syn keyword ngxDirectiveThirdParty xss_output_type +" uWSGI Module +" Allows Nginx to interact with uWSGI processes and control what parameters are passed to the process. +syn keyword ngxDirectiveThirdParty uwsgi_bind +syn keyword ngxDirectiveThirdParty uwsgi_buffer_size +syn keyword ngxDirectiveThirdParty uwsgi_buffering +syn keyword ngxDirectiveThirdParty uwsgi_buffers +syn keyword ngxDirectiveThirdParty uwsgi_busy_buffers_size +syn keyword ngxDirectiveThirdParty uwsgi_cache +syn keyword ngxDirectiveThirdParty uwsgi_cache_bypass +syn keyword ngxDirectiveThirdParty uwsgi_cache_key +syn keyword ngxDirectiveThirdParty uwsgi_cache_lock +syn keyword ngxDirectiveThirdParty uwsgi_cache_lock_timeout +syn keyword ngxDirectiveThirdParty uwsgi_cache_methods +syn keyword ngxDirectiveThirdParty uwsgi_cache_min_uses +syn keyword ngxDirectiveThirdParty uwsgi_cache_path +syn keyword ngxDirectiveThirdParty uwsgi_cache_use_stale +syn keyword ngxDirectiveThirdParty uwsgi_cache_valid +syn keyword ngxDirectiveThirdParty uwsgi_connect_timeout +syn keyword ngxDirectiveThirdParty uwsgi_hide_header +syn keyword ngxDirectiveThirdParty uwsgi_ignore_client_abort +syn keyword ngxDirectiveThirdParty uwsgi_ignore_headers +syn keyword ngxDirectiveThirdParty uwsgi_intercept_errors +syn keyword ngxDirectiveThirdParty uwsgi_max_temp_file_size +syn keyword ngxDirectiveThirdParty uwsgi_modifier1 +syn keyword ngxDirectiveThirdParty uwsgi_modifier2 +syn keyword ngxDirectiveThirdParty uwsgi_next_upstream +syn keyword ngxDirectiveThirdParty uwsgi_no_cache +syn keyword ngxDirectiveThirdParty uwsgi_param +syn keyword ngxDirectiveThirdParty uwsgi_pass +syn keyword ngxDirectiveThirdParty uwsgi_pass_header +syn keyword ngxDirectiveThirdParty uwsgi_pass_request_body +syn keyword ngxDirectiveThirdParty uwsgi_pass_request_headers +syn keyword ngxDirectiveThirdParty uwsgi_read_timeout +syn keyword ngxDirectiveThirdParty uwsgi_send_timeout +syn keyword ngxDirectiveThirdParty uwsgi_store +syn keyword ngxDirectiveThirdParty uwsgi_store_access +syn keyword ngxDirectiveThirdParty uwsgi_string +syn keyword ngxDirectiveThirdParty uwsgi_temp_file_write_size +syn keyword ngxDirectiveThirdParty uwsgi_temp_path + " highlight hi link ngxComment Comment diff --git a/sources_non_forked/nginx-vim/README.md b/sources_non_forked/nginx-vim/README.md deleted file mode 100755 index 8124452e..00000000 --- a/sources_non_forked/nginx-vim/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# nginx syntax files for Vim. - -Copied into a directory to play well with pathogen. - -* Original: http://www.vim.org/scripts/script.php?script_id=1886 - - diff --git a/sources_non_forked/nginx-vim/ftdetect/nginx.vim b/sources_non_forked/nginx-vim/ftdetect/nginx.vim deleted file mode 100755 index d12c2bf1..00000000 --- a/sources_non_forked/nginx-vim/ftdetect/nginx.vim +++ /dev/null @@ -1,2 +0,0 @@ -au BufRead,BufNewFile /etc/nginx/* set ft=nginx -au BufRead,BufNewFile /usr/local/nginx/conf/* set ft=nginx diff --git a/sources_non_forked/nginx-vim/syntax/nginx.vim b/sources_non_forked/nginx-vim/syntax/nginx.vim deleted file mode 100755 index ccd47680..00000000 --- a/sources_non_forked/nginx-vim/syntax/nginx.vim +++ /dev/null @@ -1,664 +0,0 @@ -" Vim syntax file -" Language: nginx.conf - -if exists("b:current_syntax") - finish -end - -setlocal iskeyword+=. -setlocal iskeyword+=/ -setlocal iskeyword+=: - -syn match ngxVariable '\$\w\w*' -syn match ngxVariableBlock '\$\w\w*' contained -syn match ngxVariableString '\$\w\w*' contained -syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline -syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline -syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline -syn match ngxComment ' *#.*$' - -syn keyword ngxBoolean on -syn keyword ngxBoolean off - -syn keyword ngxDirectiveBlock http contained -syn keyword ngxDirectiveBlock mail contained -syn keyword ngxDirectiveBlock events contained -syn keyword ngxDirectiveBlock server contained -syn keyword ngxDirectiveBlock types contained -syn keyword ngxDirectiveBlock location contained -syn keyword ngxDirectiveBlock upstream contained -syn keyword ngxDirectiveBlock charset_map contained -syn keyword ngxDirectiveBlock limit_except contained -syn keyword ngxDirectiveBlock if contained -syn keyword ngxDirectiveBlock geo contained -syn keyword ngxDirectiveBlock map contained - -syn keyword ngxDirectiveImportant include -syn keyword ngxDirectiveImportant root -syn keyword ngxDirectiveImportant server -syn keyword ngxDirectiveImportant server_name -syn keyword ngxDirectiveImportant listen -syn keyword ngxDirectiveImportant internal -syn keyword ngxDirectiveImportant proxy_pass -syn keyword ngxDirectiveImportant memcached_pass -syn keyword ngxDirectiveImportant fastcgi_pass -syn keyword ngxDirectiveImportant try_files - -syn keyword ngxDirectiveControl break -syn keyword ngxDirectiveControl return -syn keyword ngxDirectiveControl rewrite -syn keyword ngxDirectiveControl set - -syn keyword ngxDirectiveError error_page -syn keyword ngxDirectiveError post_action - -syn keyword ngxDirectiveDeprecated connections -syn keyword ngxDirectiveDeprecated imap -syn keyword ngxDirectiveDeprecated open_file_cache_retest -syn keyword ngxDirectiveDeprecated optimize_server_names -syn keyword ngxDirectiveDeprecated satisfy_any - -syn keyword ngxDirective accept_mutex -syn keyword ngxDirective accept_mutex_delay -syn keyword ngxDirective access_log -syn keyword ngxDirective add_after_body -syn keyword ngxDirective add_before_body -syn keyword ngxDirective add_header -syn keyword ngxDirective addition_types -syn keyword ngxDirective aio -syn keyword ngxDirective alias -syn keyword ngxDirective allow -syn keyword ngxDirective ancient_browser -syn keyword ngxDirective ancient_browser_value -syn keyword ngxDirective auth_basic -syn keyword ngxDirective auth_basic_user_file -syn keyword ngxDirective auth_http -syn keyword ngxDirective auth_http_header -syn keyword ngxDirective auth_http_timeout -syn keyword ngxDirective autoindex -syn keyword ngxDirective autoindex_exact_size -syn keyword ngxDirective autoindex_localtime -syn keyword ngxDirective charset -syn keyword ngxDirective charset_types -syn keyword ngxDirective client_body_buffer_size -syn keyword ngxDirective client_body_in_file_only -syn keyword ngxDirective client_body_in_single_buffer -syn keyword ngxDirective client_body_temp_path -syn keyword ngxDirective client_body_timeout -syn keyword ngxDirective client_header_buffer_size -syn keyword ngxDirective client_header_timeout -syn keyword ngxDirective client_max_body_size -syn keyword ngxDirective connection_pool_size -syn keyword ngxDirective create_full_put_path -syn keyword ngxDirective daemon -syn keyword ngxDirective dav_access -syn keyword ngxDirective dav_methods -syn keyword ngxDirective debug_connection -syn keyword ngxDirective debug_points -syn keyword ngxDirective default_type -syn keyword ngxDirective degradation -syn keyword ngxDirective degrade -syn keyword ngxDirective deny -syn keyword ngxDirective devpoll_changes -syn keyword ngxDirective devpoll_events -syn keyword ngxDirective directio -syn keyword ngxDirective directio_alignment -syn keyword ngxDirective empty_gif -syn keyword ngxDirective env -syn keyword ngxDirective epoll_events -syn keyword ngxDirective error_log -syn keyword ngxDirective eventport_events -syn keyword ngxDirective expires -syn keyword ngxDirective fastcgi_bind -syn keyword ngxDirective fastcgi_buffer_size -syn keyword ngxDirective fastcgi_buffers -syn keyword ngxDirective fastcgi_busy_buffers_size -syn keyword ngxDirective fastcgi_cache -syn keyword ngxDirective fastcgi_cache_key -syn keyword ngxDirective fastcgi_cache_methods -syn keyword ngxDirective fastcgi_cache_min_uses -syn keyword ngxDirective fastcgi_cache_path -syn keyword ngxDirective fastcgi_cache_use_stale -syn keyword ngxDirective fastcgi_cache_valid -syn keyword ngxDirective fastcgi_catch_stderr -syn keyword ngxDirective fastcgi_connect_timeout -syn keyword ngxDirective fastcgi_hide_header -syn keyword ngxDirective fastcgi_ignore_client_abort -syn keyword ngxDirective fastcgi_ignore_headers -syn keyword ngxDirective fastcgi_index -syn keyword ngxDirective fastcgi_intercept_errors -syn keyword ngxDirective fastcgi_max_temp_file_size -syn keyword ngxDirective fastcgi_next_upstream -syn keyword ngxDirective fastcgi_param -syn keyword ngxDirective fastcgi_pass_header -syn keyword ngxDirective fastcgi_pass_request_body -syn keyword ngxDirective fastcgi_pass_request_headers -syn keyword ngxDirective fastcgi_read_timeout -syn keyword ngxDirective fastcgi_send_lowat -syn keyword ngxDirective fastcgi_send_timeout -syn keyword ngxDirective fastcgi_split_path_info -syn keyword ngxDirective fastcgi_store -syn keyword ngxDirective fastcgi_store_access -syn keyword ngxDirective fastcgi_temp_file_write_size -syn keyword ngxDirective fastcgi_temp_path -syn keyword ngxDirective fastcgi_upstream_fail_timeout -syn keyword ngxDirective fastcgi_upstream_max_fails -syn keyword ngxDirective flv -syn keyword ngxDirective geoip_city -syn keyword ngxDirective geoip_country -syn keyword ngxDirective google_perftools_profiles -syn keyword ngxDirective gzip -syn keyword ngxDirective gzip_buffers -syn keyword ngxDirective gzip_comp_level -syn keyword ngxDirective gzip_disable -syn keyword ngxDirective gzip_hash -syn keyword ngxDirective gzip_http_version -syn keyword ngxDirective gzip_min_length -syn keyword ngxDirective gzip_no_buffer -syn keyword ngxDirective gzip_proxied -syn keyword ngxDirective gzip_static -syn keyword ngxDirective gzip_types -syn keyword ngxDirective gzip_vary -syn keyword ngxDirective gzip_window -syn keyword ngxDirective if_modified_since -syn keyword ngxDirective ignore_invalid_headers -syn keyword ngxDirective image_filter -syn keyword ngxDirective image_filter_buffer -syn keyword ngxDirective image_filter_jpeg_quality -syn keyword ngxDirective image_filter_transparency -syn keyword ngxDirective imap_auth -syn keyword ngxDirective imap_capabilities -syn keyword ngxDirective imap_client_buffer -syn keyword ngxDirective index -syn keyword ngxDirective ip_hash -syn keyword ngxDirective keepalive_requests -syn keyword ngxDirective keepalive_timeout -syn keyword ngxDirective kqueue_changes -syn keyword ngxDirective kqueue_events -syn keyword ngxDirective large_client_header_buffers -syn keyword ngxDirective limit_conn -syn keyword ngxDirective limit_conn_log_level -syn keyword ngxDirective limit_rate -syn keyword ngxDirective limit_rate_after -syn keyword ngxDirective limit_req -syn keyword ngxDirective limit_req_log_level -syn keyword ngxDirective limit_req_zone -syn keyword ngxDirective limit_zone -syn keyword ngxDirective lingering_time -syn keyword ngxDirective lingering_timeout -syn keyword ngxDirective lock_file -syn keyword ngxDirective log_format -syn keyword ngxDirective log_not_found -syn keyword ngxDirective log_subrequest -syn keyword ngxDirective map_hash_bucket_size -syn keyword ngxDirective map_hash_max_size -syn keyword ngxDirective master_process -syn keyword ngxDirective memcached_bind -syn keyword ngxDirective memcached_buffer_size -syn keyword ngxDirective memcached_connect_timeout -syn keyword ngxDirective memcached_next_upstream -syn keyword ngxDirective memcached_read_timeout -syn keyword ngxDirective memcached_send_timeout -syn keyword ngxDirective memcached_upstream_fail_timeout -syn keyword ngxDirective memcached_upstream_max_fails -syn keyword ngxDirective merge_slashes -syn keyword ngxDirective min_delete_depth -syn keyword ngxDirective modern_browser -syn keyword ngxDirective modern_browser_value -syn keyword ngxDirective msie_padding -syn keyword ngxDirective msie_refresh -syn keyword ngxDirective multi_accept -syn keyword ngxDirective open_file_cache -syn keyword ngxDirective open_file_cache_errors -syn keyword ngxDirective open_file_cache_events -syn keyword ngxDirective open_file_cache_min_uses -syn keyword ngxDirective open_file_cache_valid -syn keyword ngxDirective open_log_file_cache -syn keyword ngxDirective output_buffers -syn keyword ngxDirective override_charset -syn keyword ngxDirective perl -syn keyword ngxDirective perl_modules -syn keyword ngxDirective perl_require -syn keyword ngxDirective perl_set -syn keyword ngxDirective pid -syn keyword ngxDirective pop3_auth -syn keyword ngxDirective pop3_capabilities -syn keyword ngxDirective port_in_redirect -syn keyword ngxDirective postpone_gzipping -syn keyword ngxDirective postpone_output -syn keyword ngxDirective protocol -syn keyword ngxDirective proxy -syn keyword ngxDirective proxy_bind -syn keyword ngxDirective proxy_buffer -syn keyword ngxDirective proxy_buffer_size -syn keyword ngxDirective proxy_buffering -syn keyword ngxDirective proxy_buffers -syn keyword ngxDirective proxy_busy_buffers_size -syn keyword ngxDirective proxy_cache -syn keyword ngxDirective proxy_cache_key -syn keyword ngxDirective proxy_cache_methods -syn keyword ngxDirective proxy_cache_min_uses -syn keyword ngxDirective proxy_cache_path -syn keyword ngxDirective proxy_cache_use_stale -syn keyword ngxDirective proxy_cache_valid -syn keyword ngxDirective proxy_connect_timeout -syn keyword ngxDirective proxy_headers_hash_bucket_size -syn keyword ngxDirective proxy_headers_hash_max_size -syn keyword ngxDirective proxy_hide_header -syn keyword ngxDirective proxy_ignore_client_abort -syn keyword ngxDirective proxy_ignore_headers -syn keyword ngxDirective proxy_intercept_errors -syn keyword ngxDirective proxy_max_temp_file_size -syn keyword ngxDirective proxy_method -syn keyword ngxDirective proxy_next_upstream -syn keyword ngxDirective proxy_pass_error_message -syn keyword ngxDirective proxy_pass_header -syn keyword ngxDirective proxy_pass_request_body -syn keyword ngxDirective proxy_pass_request_headers -syn keyword ngxDirective proxy_read_timeout -syn keyword ngxDirective proxy_redirect -syn keyword ngxDirective proxy_send_lowat -syn keyword ngxDirective proxy_send_timeout -syn keyword ngxDirective proxy_set_body -syn keyword ngxDirective proxy_set_header -syn keyword ngxDirective proxy_ssl_session_reuse -syn keyword ngxDirective proxy_store -syn keyword ngxDirective proxy_store_access -syn keyword ngxDirective proxy_temp_file_write_size -syn keyword ngxDirective proxy_temp_path -syn keyword ngxDirective proxy_timeout -syn keyword ngxDirective proxy_upstream_fail_timeout -syn keyword ngxDirective proxy_upstream_max_fails -syn keyword ngxDirective random_index -syn keyword ngxDirective read_ahead -syn keyword ngxDirective real_ip_header -syn keyword ngxDirective recursive_error_pages -syn keyword ngxDirective request_pool_size -syn keyword ngxDirective reset_timedout_connection -syn keyword ngxDirective resolver -syn keyword ngxDirective resolver_timeout -syn keyword ngxDirective rewrite_log -syn keyword ngxDirective rtsig_overflow_events -syn keyword ngxDirective rtsig_overflow_test -syn keyword ngxDirective rtsig_overflow_threshold -syn keyword ngxDirective rtsig_signo -syn keyword ngxDirective satisfy -syn keyword ngxDirective secure_link_secret -syn keyword ngxDirective send_lowat -syn keyword ngxDirective send_timeout -syn keyword ngxDirective sendfile -syn keyword ngxDirective sendfile_max_chunk -syn keyword ngxDirective server_name_in_redirect -syn keyword ngxDirective server_names_hash_bucket_size -syn keyword ngxDirective server_names_hash_max_size -syn keyword ngxDirective server_tokens -syn keyword ngxDirective set_real_ip_from -syn keyword ngxDirective smtp_auth -syn keyword ngxDirective smtp_capabilities -syn keyword ngxDirective smtp_client_buffer -syn keyword ngxDirective smtp_greeting_delay -syn keyword ngxDirective so_keepalive -syn keyword ngxDirective source_charset -syn keyword ngxDirective ssi -syn keyword ngxDirective ssi_ignore_recycled_buffers -syn keyword ngxDirective ssi_min_file_chunk -syn keyword ngxDirective ssi_silent_errors -syn keyword ngxDirective ssi_types -syn keyword ngxDirective ssi_value_length -syn keyword ngxDirective ssl -syn keyword ngxDirective ssl_certificate -syn keyword ngxDirective ssl_certificate_key -syn keyword ngxDirective ssl_ciphers -syn keyword ngxDirective ssl_client_certificate -syn keyword ngxDirective ssl_crl -syn keyword ngxDirective ssl_dhparam -syn keyword ngxDirective ssl_engine -syn keyword ngxDirective ssl_prefer_server_ciphers -syn keyword ngxDirective ssl_protocols -syn keyword ngxDirective ssl_session_cache -syn keyword ngxDirective ssl_session_timeout -syn keyword ngxDirective ssl_verify_client -syn keyword ngxDirective ssl_verify_depth -syn keyword ngxDirective starttls -syn keyword ngxDirective stub_status -syn keyword ngxDirective sub_filter -syn keyword ngxDirective sub_filter_once -syn keyword ngxDirective sub_filter_types -syn keyword ngxDirective tcp_nodelay -syn keyword ngxDirective tcp_nopush -syn keyword ngxDirective thread_stack_size -syn keyword ngxDirective timeout -syn keyword ngxDirective timer_resolution -syn keyword ngxDirective types_hash_bucket_size -syn keyword ngxDirective types_hash_max_size -syn keyword ngxDirective underscores_in_headers -syn keyword ngxDirective uninitialized_variable_warn -syn keyword ngxDirective use -syn keyword ngxDirective user -syn keyword ngxDirective userid -syn keyword ngxDirective userid_domain -syn keyword ngxDirective userid_expires -syn keyword ngxDirective userid_mark -syn keyword ngxDirective userid_name -syn keyword ngxDirective userid_p3p -syn keyword ngxDirective userid_path -syn keyword ngxDirective userid_service -syn keyword ngxDirective valid_referers -syn keyword ngxDirective variables_hash_bucket_size -syn keyword ngxDirective variables_hash_max_size -syn keyword ngxDirective worker_connections -syn keyword ngxDirective worker_cpu_affinity -syn keyword ngxDirective worker_priority -syn keyword ngxDirective worker_processes -syn keyword ngxDirective worker_rlimit_core -syn keyword ngxDirective worker_rlimit_nofile -syn keyword ngxDirective worker_rlimit_sigpending -syn keyword ngxDirective worker_threads -syn keyword ngxDirective working_directory -syn keyword ngxDirective xclient -syn keyword ngxDirective xml_entities -syn keyword ngxDirective xslt_stylesheet -syn keyword ngxDirective xslt_types - -" 3rd party module list: -" http://wiki.nginx.org/Nginx3rdPartyModules - -" Accept Language Module -" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. -syn keyword ngxDirectiveThirdParty set_from_accept_language - -" Access Key Module -" Denies access unless the request URL contains an access key. -syn keyword ngxDirectiveThirdParty accesskey -syn keyword ngxDirectiveThirdParty accesskey_arg -syn keyword ngxDirectiveThirdParty accesskey_hashmethod -syn keyword ngxDirectiveThirdParty accesskey_signature - -" Auth PAM Module -" HTTP Basic Authentication using PAM. -syn keyword ngxDirectiveThirdParty auth_pam -syn keyword ngxDirectiveThirdParty auth_pam_service_name - -" Cache Purge Module -" Module adding ability to purge content from FastCGI and proxy caches. -syn keyword ngxDirectiveThirdParty fastcgi_cache_purge -syn keyword ngxDirectiveThirdParty proxy_cache_purge - -" Chunkin Module -" HTTP 1.1 chunked-encoding request body support for Nginx. -syn keyword ngxDirectiveThirdParty chunkin -syn keyword ngxDirectiveThirdParty chunkin_keepalive -syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf -syn keyword ngxDirectiveThirdParty chunkin_resume - -" Circle GIF Module -" Generates simple circle images with the colors and size specified in the URL. -syn keyword ngxDirectiveThirdParty circle_gif -syn keyword ngxDirectiveThirdParty circle_gif_max_radius -syn keyword ngxDirectiveThirdParty circle_gif_min_radius -syn keyword ngxDirectiveThirdParty circle_gif_step_radius - -" Drizzle Module -" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle. -syn keyword ngxDirectiveThirdParty drizzle_connect_timeout -syn keyword ngxDirectiveThirdParty drizzle_dbname -syn keyword ngxDirectiveThirdParty drizzle_keepalive -syn keyword ngxDirectiveThirdParty drizzle_module_header -syn keyword ngxDirectiveThirdParty drizzle_pass -syn keyword ngxDirectiveThirdParty drizzle_query -syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout -syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout -syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout -syn keyword ngxDirectiveThirdParty drizzle_server - -" Echo Module -" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file. -syn keyword ngxDirectiveThirdParty echo -syn keyword ngxDirectiveThirdParty echo_after_body -syn keyword ngxDirectiveThirdParty echo_before_body -syn keyword ngxDirectiveThirdParty echo_blocking_sleep -syn keyword ngxDirectiveThirdParty echo_duplicate -syn keyword ngxDirectiveThirdParty echo_end -syn keyword ngxDirectiveThirdParty echo_exec -syn keyword ngxDirectiveThirdParty echo_flush -syn keyword ngxDirectiveThirdParty echo_foreach_split -syn keyword ngxDirectiveThirdParty echo_location -syn keyword ngxDirectiveThirdParty echo_location_async -syn keyword ngxDirectiveThirdParty echo_read_request_body -syn keyword ngxDirectiveThirdParty echo_request_body -syn keyword ngxDirectiveThirdParty echo_reset_timer -syn keyword ngxDirectiveThirdParty echo_sleep -syn keyword ngxDirectiveThirdParty echo_subrequest -syn keyword ngxDirectiveThirdParty echo_subrequest_async - -" Events Module -" Privides options for start/stop events. -syn keyword ngxDirectiveThirdParty on_start -syn keyword ngxDirectiveThirdParty on_stop - -" EY Balancer Module -" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream. -syn keyword ngxDirectiveThirdParty max_connections -syn keyword ngxDirectiveThirdParty max_connections_max_queue_length -syn keyword ngxDirectiveThirdParty max_connections_queue_timeout - -" Fancy Indexes Module -" Like the built-in autoindex module, but fancier. -syn keyword ngxDirectiveThirdParty fancyindex -syn keyword ngxDirectiveThirdParty fancyindex_exact_size -syn keyword ngxDirectiveThirdParty fancyindex_footer -syn keyword ngxDirectiveThirdParty fancyindex_header -syn keyword ngxDirectiveThirdParty fancyindex_localtime -syn keyword ngxDirectiveThirdParty fancyindex_readme -syn keyword ngxDirectiveThirdParty fancyindex_readme_mode - -" GeoIP Module (DEPRECATED) -" Country code lookups via the MaxMind GeoIP API. -syn keyword ngxDirectiveThirdParty geoip_country_file - -" Headers More Module -" Set and clear input and output headers...more than "add"! -syn keyword ngxDirectiveThirdParty more_clear_headers -syn keyword ngxDirectiveThirdParty more_clear_input_headers -syn keyword ngxDirectiveThirdParty more_set_headers -syn keyword ngxDirectiveThirdParty more_set_input_headers - -" HTTP Push Module -" Turn Nginx into an adept long-polling HTTP Push (Comet) server. -syn keyword ngxDirectiveThirdParty push_buffer_size -syn keyword ngxDirectiveThirdParty push_listener -syn keyword ngxDirectiveThirdParty push_message_timeout -syn keyword ngxDirectiveThirdParty push_queue_messages -syn keyword ngxDirectiveThirdParty push_sender - -" HTTP Redis Module > -" Redis support.> -syn keyword ngxDirectiveThirdParty redis_bind -syn keyword ngxDirectiveThirdParty redis_buffer_size -syn keyword ngxDirectiveThirdParty redis_connect_timeout -syn keyword ngxDirectiveThirdParty redis_next_upstream -syn keyword ngxDirectiveThirdParty redis_pass -syn keyword ngxDirectiveThirdParty redis_read_timeout -syn keyword ngxDirectiveThirdParty redis_send_timeout - -" HTTP JavaScript Module -" Embedding SpiderMonkey. Nearly full port on Perl module. -syn keyword ngxDirectiveThirdParty js -syn keyword ngxDirectiveThirdParty js_filter -syn keyword ngxDirectiveThirdParty js_filter_types -syn keyword ngxDirectiveThirdParty js_load -syn keyword ngxDirectiveThirdParty js_maxmem -syn keyword ngxDirectiveThirdParty js_require -syn keyword ngxDirectiveThirdParty js_set -syn keyword ngxDirectiveThirdParty js_utf8 - -" Log Request Speed -" Log the time it took to process each request. -syn keyword ngxDirectiveThirdParty log_request_speed_filter -syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout - -" Memc Module -" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. -syn keyword ngxDirectiveThirdParty memc_buffer_size -syn keyword ngxDirectiveThirdParty memc_cmds_allowed -syn keyword ngxDirectiveThirdParty memc_connect_timeout -syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified -syn keyword ngxDirectiveThirdParty memc_next_upstream -syn keyword ngxDirectiveThirdParty memc_pass -syn keyword ngxDirectiveThirdParty memc_read_timeout -syn keyword ngxDirectiveThirdParty memc_send_timeout -syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout -syn keyword ngxDirectiveThirdParty memc_upstream_max_fails - -" Mogilefs Module -" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS. -syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout -syn keyword ngxDirectiveThirdParty mogilefs_domain -syn keyword ngxDirectiveThirdParty mogilefs_methods -syn keyword ngxDirectiveThirdParty mogilefs_noverify -syn keyword ngxDirectiveThirdParty mogilefs_pass -syn keyword ngxDirectiveThirdParty mogilefs_read_timeout -syn keyword ngxDirectiveThirdParty mogilefs_send_timeout -syn keyword ngxDirectiveThirdParty mogilefs_tracker - -" MP4 Streaming Lite Module -" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL. -syn keyword ngxDirectiveThirdParty mp4 - -" Nginx Notice Module -" Serve static file to POST requests. -syn keyword ngxDirectiveThirdParty notice -syn keyword ngxDirectiveThirdParty notice_type - -" Phusion Passenger -" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers. -syn keyword ngxDirectiveThirdParty passenger_base_uri -syn keyword ngxDirectiveThirdParty passenger_default_user -syn keyword ngxDirectiveThirdParty passenger_enabled -syn keyword ngxDirectiveThirdParty passenger_log_level -syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app -syn keyword ngxDirectiveThirdParty passenger_max_pool_size -syn keyword ngxDirectiveThirdParty passenger_pool_idle_time -syn keyword ngxDirectiveThirdParty passenger_root -syn keyword ngxDirectiveThirdParty passenger_ruby -syn keyword ngxDirectiveThirdParty passenger_use_global_queue -syn keyword ngxDirectiveThirdParty passenger_user_switching -syn keyword ngxDirectiveThirdParty rack_env -syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time -syn keyword ngxDirectiveThirdParty rails_env -syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time -syn keyword ngxDirectiveThirdParty rails_spawn_method - -" RDS JSON Module -" Help ngx_drizzle and other DBD modules emit JSON data. -syn keyword ngxDirectiveThirdParty rds_json -syn keyword ngxDirectiveThirdParty rds_json_content_type -syn keyword ngxDirectiveThirdParty rds_json_format -syn keyword ngxDirectiveThirdParty rds_json_ret - -" RRD Graph Module -" This module provides an HTTP interface to RRDtool's graphing facilities. -syn keyword ngxDirectiveThirdParty rrd_graph -syn keyword ngxDirectiveThirdParty rrd_graph_root - -" Secure Download -" Create expiring links. -syn keyword ngxDirectiveThirdParty secure_download -syn keyword ngxDirectiveThirdParty secure_download_fail_location -syn keyword ngxDirectiveThirdParty secure_download_path_mode -syn keyword ngxDirectiveThirdParty secure_download_secret - -" SlowFS Cache Module -" Module adding ability to cache static files. -syn keyword ngxDirectiveThirdParty slowfs_big_file_size -syn keyword ngxDirectiveThirdParty slowfs_cache -syn keyword ngxDirectiveThirdParty slowfs_cache_key -syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses -syn keyword ngxDirectiveThirdParty slowfs_cache_path -syn keyword ngxDirectiveThirdParty slowfs_cache_purge -syn keyword ngxDirectiveThirdParty slowfs_cache_valid -syn keyword ngxDirectiveThirdParty slowfs_temp_path - -" Strip Module -" Whitespace remover. -syn keyword ngxDirectiveThirdParty strip - -" Substitutions Module -" A filter module which can do both regular expression and fixed string substitutions on response bodies. -syn keyword ngxDirectiveThirdParty subs_filter -syn keyword ngxDirectiveThirdParty subs_filter_types - -" Supervisord Module -" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand. -syn keyword ngxDirectiveThirdParty supervisord -syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status -syn keyword ngxDirectiveThirdParty supervisord_name -syn keyword ngxDirectiveThirdParty supervisord_start -syn keyword ngxDirectiveThirdParty supervisord_stop - -" Upload Module -" Parses multipart/form-data allowing arbitrary handling of uploaded files. -syn keyword ngxDirectiveThirdParty upload_aggregate_form_field -syn keyword ngxDirectiveThirdParty upload_buffer_size -syn keyword ngxDirectiveThirdParty upload_cleanup -syn keyword ngxDirectiveThirdParty upload_limit_rate -syn keyword ngxDirectiveThirdParty upload_max_file_size -syn keyword ngxDirectiveThirdParty upload_max_output_body_len -syn keyword ngxDirectiveThirdParty upload_max_part_header_len -syn keyword ngxDirectiveThirdParty upload_pass -syn keyword ngxDirectiveThirdParty upload_pass_args -syn keyword ngxDirectiveThirdParty upload_pass_form_field -syn keyword ngxDirectiveThirdParty upload_set_form_field -syn keyword ngxDirectiveThirdParty upload_store -syn keyword ngxDirectiveThirdParty upload_store_access - -" Upload Progress Module -" Tracks and reports upload progress. -syn keyword ngxDirectiveThirdParty report_uploads -syn keyword ngxDirectiveThirdParty track_uploads -syn keyword ngxDirectiveThirdParty upload_progress -syn keyword ngxDirectiveThirdParty upload_progress_content_type -syn keyword ngxDirectiveThirdParty upload_progress_header -syn keyword ngxDirectiveThirdParty upload_progress_json_output -syn keyword ngxDirectiveThirdParty upload_progress_template - -" Upstream Fair Balancer -" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin. -syn keyword ngxDirectiveThirdParty fair -syn keyword ngxDirectiveThirdParty upstream_fair_shm_size - -" Upstream Consistent Hash -" Select backend based on Consistent hash ring. -syn keyword ngxDirectiveThirdParty consistent_hash - -" Upstream Hash Module -" Provides simple upstream load distribution by hashing a configurable variable. -syn keyword ngxDirectiveThirdParty hash -syn keyword ngxDirectiveThirdParty hash_again - -" XSS Module -" Native support for cross-site scripting (XSS) in an nginx. -syn keyword ngxDirectiveThirdParty xss_callback_arg -syn keyword ngxDirectiveThirdParty xss_get -syn keyword ngxDirectiveThirdParty xss_input_types -syn keyword ngxDirectiveThirdParty xss_output_type - -" highlight - -hi link ngxComment Comment -hi link ngxVariable Identifier -hi link ngxVariableBlock Identifier -hi link ngxVariableString PreProc -hi link ngxBlock Normal -hi link ngxString String - -hi link ngxBoolean Boolean -hi link ngxDirectiveBlock Statement -hi link ngxDirectiveImportant Type -hi link ngxDirectiveControl Keyword -hi link ngxDirectiveError Constant -hi link ngxDirectiveDeprecated Error -hi link ngxDirective Identifier -hi link ngxDirectiveThirdParty Special - -let b:current_syntax = "nginx" diff --git a/sources_non_forked/nginx.vim/README b/sources_non_forked/nginx.vim/README deleted file mode 100644 index 91ceb224..00000000 --- a/sources_non_forked/nginx.vim/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=1886 - -nginx.vim highlights configuration files for nginx, the high-performance web server (see http://nginx.net). diff --git a/sources_forked/zencoding/.gitignore b/sources_non_forked/rust.vim/.gitignore old mode 100755 new mode 100644 similarity index 100% rename from sources_forked/zencoding/.gitignore rename to sources_non_forked/rust.vim/.gitignore diff --git a/sources_non_forked/rust.vim/README.md b/sources_non_forked/rust.vim/README.md new file mode 100644 index 00000000..481db9f3 --- /dev/null +++ b/sources_non_forked/rust.vim/README.md @@ -0,0 +1,30 @@ +# rust.vim + +## Description + +This is a vim plugin provides [Rust][r] file detection and syntax highlighting. + +It is synchronized daily to the vim support code in [rust-lang/rust][rr]'s +master branch via cronjob. + +## Installation + +### Using [Vundle][v] + +1. Add `Plugin 'wting/rust.vim'` to `~/.vimrc` +2. `vim +PluginInstall +qall` + +*Note:* Vundle will not automatically detect Rust files properly if `filetype +on` is executed before Vundle. Please check the [quickstart][vqs] for more +details. + +### Using [Pathogen][p] + +1. `cd ~/.vim/bundle` +2. `git clone https://github.com/wting/rust.vim.git` + +[rr]: https://github.com/rust-lang/rust +[p]: https://github.com/tpope/vim-pathogen +[r]: https://en.wikipedia.org/wiki/Rust_language +[v]: https://github.com/gmarik/vundle +[vqs]: https://github.com/gmarik/vundle#quick-start diff --git a/sources_non_forked/rust.vim/after/syntax/rust.vim b/sources_non_forked/rust.vim/after/syntax/rust.vim new file mode 100644 index 00000000..735c1e15 --- /dev/null +++ b/sources_non_forked/rust.vim/after/syntax/rust.vim @@ -0,0 +1,31 @@ +if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8' + finish +endif + +" For those who don't want to see `::`... +if exists('g:rust_conceal_mod_path') + syn match rustNiceOperator "::" conceal cchar=ㆍ +endif + +syn match rustRightArrowHead contained ">" conceal cchar=  +syn match rustRightArrowTail contained "-" conceal cchar=⟶ +syn match rustNiceOperator "->" contains=rustRightArrowHead,rustRightArrowTail + +syn match rustFatRightArrowHead contained ">" conceal cchar=  +syn match rustFatRightArrowTail contained "=" conceal cchar=⟹ +syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrowTail + +syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=′ + +" For those who don't want to see `pub`... +if exists('g:rust_conceal_pub') + syn match rustPublicSigil contained "pu" conceal cchar=* + syn match rustPublicRest contained "b" conceal cchar=  + syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest +endif + +hi link rustNiceOperator Operator + +if !exists('g:rust_conceal_mod_path') + hi! link Conceal Operator +endif diff --git a/sources_non_forked/rust.vim/autoload/rust.vim b/sources_non_forked/rust.vim/autoload/rust.vim new file mode 100644 index 00000000..fe8e743e --- /dev/null +++ b/sources_non_forked/rust.vim/autoload/rust.vim @@ -0,0 +1,225 @@ +" Author: Kevin Ballard +" Description: Helper functions for Rust commands/mappings +" Last Modified: May 27, 2014 + +" Jump {{{1 + +function! rust#Jump(mode, function) range + let cnt = v:count1 + normal! m' + if a:mode ==# 'v' + norm! gv + endif + let foldenable = &foldenable + set nofoldenable + while cnt > 0 + execute "call Jump_" . a:function . "()" + let cnt = cnt - 1 + endwhile + let &foldenable = foldenable +endfunction + +function! s:Jump_Back() + call search('{', 'b') + keepjumps normal! w99[{ +endfunction + +function! s:Jump_Forward() + normal! j0 + call search('{', 'b') + keepjumps normal! w99[{% + call search('{') +endfunction + +" Run {{{1 + +function! rust#Run(bang, args) + if a:bang + let idx = index(a:args, '--') + if idx != -1 + let rustc_args = idx == 0 ? [] : a:args[:idx-1] + let args = a:args[idx+1:] + else + let rustc_args = a:args + let args = [] + endif + else + let rustc_args = [] + let args = a:args + endif + + let b:rust_last_rustc_args = rustc_args + let b:rust_last_args = args + + call s:WithPath(function("s:Run"), rustc_args, args) +endfunction + +function! s:Run(path, rustc_args, args) + try + let exepath = tempname() + if has('win32') + let exepath .= '.exe' + endif + + let rustc_args = [a:path, '-o', exepath] + a:rustc_args + + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + let output = system(shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)'))) + if output != '' + echohl WarningMsg + echo output + echohl None + endif + if !v:shell_error + exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)')) + endif + finally + if exists("exepath") + silent! call delete(exepath) + endif + endtry +endfunction + +" Expand {{{1 + +function! rust#Expand(bang, args) + if a:bang && !empty(a:args) + let pretty = a:args[0] + let args = a:args[1:] + else + let pretty = "expanded" + let args = a:args + endif + call s:WithPath(function("s:Expand"), pretty, args) +endfunction + +function! s:Expand(path, pretty, args) + try + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + let args = [a:path, '--pretty', a:pretty] + a:args + let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)"))) + if v:shell_error + echohl WarningMsg + echo output + echohl None + else + new + silent put =output + 1 + d + setl filetype=rust + setl buftype=nofile + setl bufhidden=hide + setl noswapfile + endif + endtry +endfunction + +function! rust#CompleteExpand(lead, line, pos) + if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$' + " first argument and it has a ! + let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="] + if !empty(a:lead) + call filter(list, "v:val[:len(a:lead)-1] == a:lead") + endif + return list + endif + + return glob(escape(a:lead, "*?[") . '*', 0, 1) +endfunction + +" Emit {{{1 + +function! rust#Emit(type, args) + call s:WithPath(function("s:Emit"), a:type, a:args) +endfunction + +function! s:Emit(path, type, args) + try + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + let args = [a:path, '--emit', a:type, '-o', '-'] + a:args + let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)"))) + if v:shell_error + echohl WarningMsg + echo output + echohl None + else + new + silent put =output + 1 + d + if a:type == "ir" + setl filetype=llvm + elseif a:type == "asm" + setl filetype=asm + endif + setl buftype=nofile + setl bufhidden=hide + setl noswapfile + endif + endtry +endfunction + +" Utility functions {{{1 + +function! s:WithPath(func, ...) + try + let save_write = &write + set write + let path = expand('%') + let pathisempty = empty(path) + if pathisempty || !save_write + " use a temporary file named 'unnamed.rs' inside a temporary + " directory. This produces better error messages + let tmpdir = tempname() + call mkdir(tmpdir) + + let save_cwd = getcwd() + silent exe 'lcd' fnameescape(tmpdir) + + let path = 'unnamed.rs' + + let save_mod = &mod + set nomod + + silent exe 'keepalt write! ' . fnameescape(path) + if pathisempty + silent keepalt 0file + endif + else + update + endif + + call call(a:func, [path] + a:000) + finally + if exists("save_mod") | let &mod = save_mod | endif + if exists("save_write") | let &write = save_write | endif + if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif + if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif + endtry +endfunction + +function! rust#AppendCmdLine(text) + call setcmdpos(getcmdpos()) + let cmd = getcmdline() . a:text + return cmd +endfunction + +function! s:RmDir(path) + " sanity check; make sure it's not empty, /, or $HOME + if empty(a:path) + echoerr 'Attempted to delete empty path' + return 0 + elseif a:path == '/' || a:path == $HOME + echoerr 'Attempted to delete protected path: ' . a:path + return 0 + endif + silent exe "!rm -rf " . shellescape(a:path) +endfunction + +" }}}1 + +" vim: set noet sw=4 ts=4: diff --git a/sources_non_forked/rust.vim/compiler/cargo.vim b/sources_non_forked/rust.vim/compiler/cargo.vim new file mode 100644 index 00000000..ed487a30 --- /dev/null +++ b/sources_non_forked/rust.vim/compiler/cargo.vim @@ -0,0 +1,65 @@ +" Vim compiler file +" Compiler: Cargo Compiler +" Maintainer: Damien Radtke +" Latest Revision: 2014 Sep 24 + +if exists('current_compiler') + finish +endif +runtime compiler/rustc.vim +let current_compiler = "cargo" + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal +endif + +if exists('g:cargo_makeprg_params') + execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*' +else + CompilerSet makeprg=cargo\ $* +endif + +" Allow a configurable global Cargo.toml name. This makes it easy to +" support variations like 'cargo.toml'. +let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml') + +function! s:is_absolute(path) + return a:path[0] == '/' || a:path =~ '[A-Z]\+:' +endfunction + +let s:local_manifest = findfile(s:cargo_manifest_name, '.;') +if s:local_manifest != '' + let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/' + augroup cargo + au! + au QuickfixCmdPost make call s:FixPaths() + augroup END + + " FixPaths() is run after Cargo, and is used to change the file paths + " to be relative to the current directory instead of Cargo.toml. + function! s:FixPaths() + let qflist = getqflist() + let manifest = s:local_manifest + for qf in qflist + if !qf.valid + let m = matchlist(qf.text, '(file://\(.*\))$') + if !empty(m) + let manifest = m[1].'/' + " Manually strip another slash if needed; usually just an + " issue on Windows. + if manifest =~ '^/[A-Z]\+:/' + let manifest = manifest[1:] + endif + endif + continue + endif + let filename = bufname(qf.bufnr) + if s:is_absolute(filename) + continue + endif + let qf.filename = simplify(manifest.filename) + call remove(qf, 'bufnr') + endfor + call setqflist(qflist, 'r') + endfunction +endif diff --git a/sources_non_forked/rust.vim/compiler/rustc.vim b/sources_non_forked/rust.vim/compiler/rustc.vim new file mode 100644 index 00000000..f9b854ed --- /dev/null +++ b/sources_non_forked/rust.vim/compiler/rustc.vim @@ -0,0 +1,33 @@ +" Vim compiler file +" Compiler: Rust Compiler +" Maintainer: Chris Morgan +" Latest Revision: 2013 Jul 12 + +if exists("current_compiler") + finish +endif +let current_compiler = "rustc" + +let s:cpo_save = &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1 + CompilerSet makeprg=rustc +else + CompilerSet makeprg=rustc\ \% +endif + +CompilerSet errorformat= + \%f:%l:%c:\ %t%*[^:]:\ %m, + \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m, + \%-G%f:%l\ %s, + \%-G%*[\ ]^, + \%-G%*[\ ]^%*[~], + \%-G%*[\ ]... + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/sources_non_forked/rust.vim/doc/rust.txt b/sources_non_forked/rust.vim/doc/rust.txt new file mode 100644 index 00000000..e117b0c1 --- /dev/null +++ b/sources_non_forked/rust.vim/doc/rust.txt @@ -0,0 +1,178 @@ +*rust.txt* Filetype plugin for Rust + +============================================================================== +CONTENTS *rust* *ft-rust* + +1. Introduction |rust-intro| +2. Settings |rust-settings| +3. Commands |rust-commands| +4. Mappings |rust-mappings| + +============================================================================== +INTRODUCTION *rust-intro* + +This plugin provides syntax and supporting functionality for the Rust +filetype. + +============================================================================== +SETTINGS *rust-settings* + +This plugin has a few variables you can define in your vimrc that change the +behavior of the plugin. + + *g:rustc_path* +g:rustc_path~ + Set this option to the path to rustc for use in the |:RustRun| and + |:RustExpand| commands. If unset, "rustc" will be located in $PATH: > + let g:rustc_path = $HOME."/bin/rustc" +< + + *g:rustc_makeprg_no_percent* +g:rustc_makeprg_no_percent~ + Set this option to 1 to have 'makeprg' default to "rustc" instead of + "rustc %": > + let g:rustc_makeprg_no_percent = 1 +< + + *g:rust_conceal* +g:rust_conceal~ + Set this option to turn on the basic |conceal| support: > + let g:rust_conceal = 1 +< + + *g:rust_conceal_mod_path* +g:rust_conceal_mod_path~ + Set this option to turn on |conceal| for the path connecting token + "::": > + let g:rust_conceal_mod_path = 1 +< + + *g:rust_conceal_pub* +g:rust_conceal_pub~ + Set this option to turn on |conceal| for the "pub" token: > + let g:rust_conceal_pub = 1 +< + + *g:rust_recommended_style* +g:rust_recommended_style~ + Set this option to enable vim indentation and textwidth settings to + conform to style conventions of the rust standard library (i.e. use 4 + spaces for indents and sets 'textwidth' to 99). This option is enabled + by default. To disable it: > + let g:rust_recommended_style = 0 +< + + *g:rust_fold* +g:rust_fold~ + Set this option to turn on |folding|: > + let g:rust_fold = 1 +< + Value Effect ~ + 0 No folding + 1 Braced blocks are folded. All folds are open by + default. + 2 Braced blocks are folded. 'foldlevel' is left at the + global value (all folds are closed by default). + + *g:rust_bang_comment_leader* +g:rust_bang_comment_leader~ + Set this option to 1 to preserve the leader on multi-line doc comments + using the /*! syntax: > + let g:rust_bang_comment_leader = 1 +< + + *g:ftplugin_rust_source_path* +g:ftplugin_rust_source_path~ + Set this option to a path that should be prepended to 'path' for Rust + source files: > + let g:ftplugin_rust_source_path = $HOME.'/dev/rust' +< + + *g:cargo_manifest_name* +g:cargo_manifest_name~ + Set this option to the name of the manifest file for your projects. If + not specified it defaults to 'Cargo.toml' : > + let g:cargo_manifest_name = 'Cargo.toml' +< + +============================================================================== +COMMANDS *rust-commands* + +:RustRun [args] *:RustRun* +:RustRun! [rustc-args] [--] [args] + Compiles and runs the current file. If it has unsaved changes, + it will be saved first using |:update|. If the current file is + an unnamed buffer, it will be written to a temporary file + first. The compiled binary is always placed in a temporary + directory, but is run from the current directory. + + The arguments given to |:RustRun| will be passed to the + compiled binary. + + If ! is specified, the arguments are passed to rustc instead. + A "--" argument will separate the rustc arguments from the + arguments passed to the binary. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustExpand [args] *:RustExpand* +:RustExpand! [TYPE] [args] + Expands the current file using --pretty and displays the + results in a new split. If the current file has unsaved + changes, it will be saved first using |:update|. If the + current file is an unnamed buffer, it will be written to a + temporary file first. + + The arguments given to |:RustExpand| will be passed to rustc. + This is largely intended for specifying various --cfg + configurations. + + If ! is specified, the first argument is the expansion type to + pass to rustc --pretty. Otherwise it will default to + "expanded". + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustEmitIr [args] *:RustEmitIr* + Compiles the current file to LLVM IR and displays the results + in a new split. If the current file has unsaved changes, it + will be saved first using |:update|. If the current file is an + unnamed buffer, it will be written to a temporary file first. + + The arguments given to |:RustEmitIr| will be passed to rustc. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustEmitAsm [args] *:RustEmitAsm* + Compiles the current file to assembly and displays the results + in a new split. If the current file has unsaved changes, it + will be saved first using |:update|. If the current file is an + unnamed buffer, it will be written to a temporary file first. + + The arguments given to |:RustEmitAsm| will be passed to rustc. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +============================================================================== +MAPPINGS *rust-mappings* + +This plugin defines mappings for |[[| and |]]| to support hanging indents. + +It also has a few other mappings: + + *rust_* + Executes |:RustRun| with no arguments. + Note: This binding is only available in MacVim. + + *rust_* + Populates the command line with |:RustRun|! using the + arguments given to the last invocation, but does not + execute it. + Note: This binding is only available in MacVim. + +============================================================================== + vim:tw=78:sw=4:noet:ts=8:ft=help:norl: diff --git a/sources_non_forked/rust.vim/ftdetect/rust.vim b/sources_non_forked/rust.vim/ftdetect/rust.vim new file mode 100644 index 00000000..bf685d43 --- /dev/null +++ b/sources_non_forked/rust.vim/ftdetect/rust.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.rs set filetype=rust diff --git a/sources_non_forked/rust.vim/ftplugin/rust.vim b/sources_non_forked/rust.vim/ftplugin/rust.vim new file mode 100644 index 00000000..5d556994 --- /dev/null +++ b/sources_non_forked/rust.vim/ftplugin/rust.vim @@ -0,0 +1,150 @@ +" Language: Rust +" Description: Vim syntax file for Rust +" Maintainer: Chris Morgan +" Maintainer: Kevin Ballard +" Last Change: Jul 07, 2014 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" Variables {{{1 + +" The rust source code at present seems to typically omit a leader on /*! +" comments, so we'll use that as our default, but make it easy to switch. +" This does not affect indentation at all (I tested it with and without +" leader), merely whether a leader is inserted by default or not. +if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1 + " Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why, + " but without it, */ gets indented one space even if there were no + " leaders. I'm fairly sure that's a Vim bug. + setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,:// +else + setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// +endif +setlocal commentstring=//%s +setlocal formatoptions-=t formatoptions+=croqnl +" j was only added in 7.3.541, so stop complaints about its nonexistence +silent! setlocal formatoptions+=j + +" smartindent will be overridden by indentexpr if filetype indent is on, but +" otherwise it's better than nothing. +setlocal smartindent nocindent + +if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1 + setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab + setlocal textwidth=99 +endif + +" This includeexpr isn't perfect, but it's a good start +setlocal includeexpr=substitute(v:fname,'::','/','g') + +" NOT adding .rc as it's being phased out (0.7) +setlocal suffixesadd=.rs + +if exists("g:ftplugin_rust_source_path") + let &l:path=g:ftplugin_rust_source_path . ',' . &l:path +endif + +if exists("g:loaded_delimitMate") + if exists("b:delimitMate_excluded_regions") + let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions + endif + let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate' +endif + +if has("folding") && exists('g:rust_fold') && g:rust_fold != 0 + let b:rust_set_foldmethod=1 + setlocal foldmethod=syntax + if g:rust_fold == 2 + setlocal foldlevel< + else + setlocal foldlevel=99 + endif +endif + +if has('conceal') && exists('g:rust_conceal') + let b:rust_set_conceallevel=1 + setlocal conceallevel=2 +endif + +" Motion Commands {{{1 + +" Bind motion commands to support hanging indents +nnoremap [[ :call rust#Jump('n', 'Back') +nnoremap ]] :call rust#Jump('n', 'Forward') +xnoremap [[ :call rust#Jump('v', 'Back') +xnoremap ]] :call rust#Jump('v', 'Forward') +onoremap [[ :call rust#Jump('o', 'Back') +onoremap ]] :call rust#Jump('o', 'Forward') + +" Commands {{{1 + +" See |:RustRun| for docs +command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(0, []) + +" See |:RustExpand| for docs +command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(0, []) + +" See |:RustEmitIr| for docs +command! -nargs=* -bar -buffer RustEmitIr call rust#Emit("ir", []) + +" See |:RustEmitAsm| for docs +command! -nargs=* -bar -buffer RustEmitAsm call rust#Emit("asm", []) + +" Mappings {{{1 + +" Bind ⌘R in MacVim to :RustRun +nnoremap :RustRun +" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args +nnoremap :RustRun! =join(b:rust_last_rustc_args)erust#AppendCmdLine(' -- ' . join(b:rust_last_args)) + +if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args") + let b:rust_last_rustc_args = [] + let b:rust_last_args = [] +endif + +" Cleanup {{{1 + +let b:undo_ftplugin = " + \ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< + \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< + \|if exists('b:rust_original_delimitMate_excluded_regions') + \|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions + \|unlet b:rust_original_delimitMate_excluded_regions + \|else + \|unlet! b:delimitMate_excluded_regions + \|endif + \|if exists('b:rust_set_foldmethod') + \|setlocal foldmethod< foldlevel< + \|unlet b:rust_set_foldmethod + \|endif + \|if exists('b:rust_set_conceallevel') + \|setlocal conceallevel< + \|unlet b:rust_set_conceallevel + \|endif + \|unlet! b:rust_last_rustc_args b:rust_last_args + \|delcommand RustRun + \|delcommand RustExpand + \|delcommand RustEmitIr + \|delcommand RustEmitAsm + \|nunmap + \|nunmap + \|nunmap [[ + \|nunmap ]] + \|xunmap [[ + \|xunmap ]] + \|ounmap [[ + \|ounmap ]] + \" + +" }}}1 + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set noet sw=4 ts=4: diff --git a/sources_non_forked/rust.vim/indent/rust.vim b/sources_non_forked/rust.vim/indent/rust.vim new file mode 100644 index 00000000..300d7dac --- /dev/null +++ b/sources_non_forked/rust.vim/indent/rust.vim @@ -0,0 +1,196 @@ +" Vim indent file +" Language: Rust +" Author: Chris Morgan +" Last Change: 2014 Sep 13 + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal cindent +setlocal cinoptions=L0,(0,Ws,J1,j1 +setlocal cinkeys=0{,0},!^F,o,O,0[,0] +" Don't think cinwords will actually do anything at all... never mind +setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern + +" Some preliminary settings +setlocal nolisp " Make sure lisp indenting doesn't supersede us +setlocal autoindent " indentexpr isn't much help otherwise +" Also do indentkeys, otherwise # gets shoved to column 0 :-/ +setlocal indentkeys=0{,0},!^F,o,O,0[,0] + +setlocal indentexpr=GetRustIndent(v:lnum) + +" Only define the function once. +if exists("*GetRustIndent") + finish +endif + +" Come here when loading the script the first time. + +function! s:get_line_trimmed(lnum) + " Get the line and remove a trailing comment. + " Use syntax highlighting attributes when possible. + " NOTE: this is not accurate; /* */ or a line continuation could trick it + let line = getline(a:lnum) + let line_len = strlen(line) + if has('syntax_items') + " If the last character in the line is a comment, do a binary search for + " the start of the comment. synID() is slow, a linear search would take + " too long on a long line. + if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo' + let min = 1 + let max = line_len + while min < max + let col = (min + max) / 2 + if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo' + let max = col + else + let min = col + 1 + endif + endwhile + let line = strpart(line, 0, min - 1) + endif + return substitute(line, "\s*$", "", "") + else + " Sorry, this is not complete, nor fully correct (e.g. string "//"). + " Such is life. + return substitute(line, "\s*//.*$", "", "") + endif +endfunction + +function! s:is_string_comment(lnum, col) + if has('syntax_items') + for id in synstack(a:lnum, a:col) + let synname = synIDattr(id, "name") + if synname == "rustString" || synname =~ "^rustComment" + return 1 + endif + endfor + else + " without syntax, let's not even try + return 0 + endif +endfunction + +function GetRustIndent(lnum) + + " Starting assumption: cindent (called at the end) will do it right + " normally. We just want to fix up a few cases. + + let line = getline(a:lnum) + + if has('syntax_items') + let synname = synIDattr(synID(a:lnum, 1, 1), "name") + if synname == "rustString" + " If the start of the line is in a string, don't change the indent + return -1 + elseif synname =~ '\(Comment\|Todo\)' + \ && line !~ '^\s*/\*' " not /* opening line + if synname =~ "CommentML" " multi-line + if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*' + " This is (hopefully) the line after a /*, and it has no + " leader, so the correct indentation is that of the + " previous line. + return GetRustIndent(a:lnum - 1) + endif + endif + " If it's in a comment, let cindent take care of it now. This is + " for cases like "/*" where the next line should start " * ", not + " "* " as the code below would otherwise cause for module scope + " Fun fact: " /*\n*\n*/" takes two calls to get right! + return cindent(a:lnum) + endif + endif + + " cindent gets second and subsequent match patterns/struct members wrong, + " as it treats the comma as indicating an unfinished statement:: + " + " match a { + " b => c, + " d => e, + " f => g, + " }; + + " Search backwards for the previous non-empty line. + let prevlinenum = prevnonblank(a:lnum - 1) + let prevline = s:get_line_trimmed(prevlinenum) + while prevlinenum > 1 && prevline !~ '[^[:blank:]]' + let prevlinenum = prevnonblank(prevlinenum - 1) + let prevline = s:get_line_trimmed(prevlinenum) + endwhile + if prevline[len(prevline) - 1] == "," + \ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]' + \ && prevline !~ '^\s*fn\s' + \ && prevline !~ '([^()]\+,$' + " Oh ho! The previous line ended in a comma! I bet cindent will try to + " take this too far... For now, let's normally use the previous line's + " indent. + + " One case where this doesn't work out is where *this* line contains + " square or curly brackets; then we normally *do* want to be indenting + " further. + " + " Another case where we don't want to is one like a function + " definition with arguments spread over multiple lines: + " + " fn foo(baz: Baz, + " baz: Baz) // <-- cindent gets this right by itself + " + " Another case is similar to the previous, except calling a function + " instead of defining it, or any conditional expression that leaves + " an open paren: + " + " foo(baz, + " baz); + " + " if baz && (foo || + " bar) { + " + " There are probably other cases where we don't want to do this as + " well. Add them as needed. + return indent(prevlinenum) + endif + + if !has("patch-7.4.355") + " cindent before 7.4.355 doesn't do the module scope well at all; e.g.:: + " + " static FOO : &'static [bool] = [ + " true, + " false, + " false, + " true, + " ]; + " + " uh oh, next statement is indented further! + + " Note that this does *not* apply the line continuation pattern properly; + " that's too hard to do correctly for my liking at present, so I'll just + " start with these two main cases (square brackets and not returning to + " column zero) + + call cursor(a:lnum, 1) + if searchpair('{\|(', '', '}\|)', 'nbW', + \ 's:is_string_comment(line("."), col("."))') == 0 + if searchpair('\[', '', '\]', 'nbW', + \ 's:is_string_comment(line("."), col("."))') == 0 + " Global scope, should be zero + return 0 + else + " At the module scope, inside square brackets only + "if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum + if line =~ "^\\s*]" + " It's the closing line, dedent it + return 0 + else + return &shiftwidth + endif + endif + endif + endif + + " Fall back on cindent, which does it mostly right + return cindent(a:lnum) +endfunction diff --git a/sources_non_forked/rust.vim/plugin/rust.vim b/sources_non_forked/rust.vim/plugin/rust.vim new file mode 100644 index 00000000..4ec4f33d --- /dev/null +++ b/sources_non_forked/rust.vim/plugin/rust.vim @@ -0,0 +1,22 @@ +" Vim syntastic plugin helper +" Language: Rust +" Maintainer: Andrew Gallant + +if exists("g:loaded_syntastic_rust_filetype") + finish +endif +let g:loaded_syntastic_rust_filetype = 1 +let s:save_cpo = &cpo +set cpo&vim + +" This is to let Syntastic know about the Rust filetype. +" It enables tab completion for the 'SyntasticInfo' command. +" (This does not actually register the syntax checker.) +if exists('g:syntastic_extra_filetypes') + call add(g:syntastic_extra_filetypes, 'rust') +else + let g:syntastic_extra_filetypes = ['rust'] +endif + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/sources_non_forked/rust.vim/syntax/rust.vim b/sources_non_forked/rust.vim/syntax/rust.vim new file mode 100644 index 00000000..a37b7b6d --- /dev/null +++ b/sources_non_forked/rust.vim/syntax/rust.vim @@ -0,0 +1,262 @@ +" Vim syntax file +" Language: Rust +" Maintainer: Patrick Walton +" Maintainer: Ben Blum +" Maintainer: Chris Morgan +" Last Change: January 5, 2015 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Syntax definitions {{{1 +" Basic keywords {{{2 +syn keyword rustConditional match if else +syn keyword rustOperator as + +syn match rustAssert "\(); + +" This is merely a convention; note also the use of [A-Z], restricting it to +" latin identifiers rather than the full Unicode uppercase. I have not used +" [:upper:] as it depends upon 'noignorecase' +"syn match rustCapsIdent display "[A-Z]\w\(\w\)*" + +syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?" +" This one isn't *quite* right, as we could have binary-& with a reference +syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +" This isn't actually correct; a closure with no arguments can be `|| { }`. +" Last, because the & in && isn't a sigil +syn match rustOperator display "&&\|||" + +syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic +syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic + +syn match rustEscapeError display contained /\\./ +syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ +syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/ +syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/ +syn match rustStringContinuation display contained /\\\n\s*/ +syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation +syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell +syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell + +syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive +syn region rustDerive start="derive(" end=")" contained contains=rustTrait + +" Number literals +syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\=" +syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" +syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" +syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" + +" Special case for numbers of the form "1." which are float literals, unless followed by +" an identifier, which makes them integer literals with a method call or field access, +" or by another ".", which makes them integer literals followed by the ".." token. +" (This must go first so the others take precedence.) +syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!" +" To mark a number as a normal float, it must have at least one of the three things integral values don't have: +" a decimal point and more numbers; an exponent; and a type suffix. +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\=" +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)" + +" For the benefit of delimitMate +syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime +syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate +syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime + +"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting +syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" +syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ +" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). +syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ +syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode +syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid + +syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell +syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell +syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell +syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell +syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent +syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent +" FIXME: this is a really ugly and not fully correct implementation. Most +" importantly, a case like ``/* */*`` should have the final ``*`` not being in +" a comment, but in practice at present it leaves comments open two levels +" deep. But as long as you stay away from that particular case, I *believe* +" the highlighting is correct. Due to the way Vim's syntax engine works +" (greedy for start matches, unlike Rust's tokeniser which is searching for +" the earliest-starting match, start or end), I believe this cannot be solved. +" Oh you who would fix it, don't bother with things like duplicating the Block +" rules and putting ``\*\@ +" +" See for details on how to add an external Syntastic checker: +" https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external + +if exists("g:loaded_syntastic_rust_rustc_checker") + finish +endif +let g:loaded_syntastic_rust_rustc_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_rust_rustc_GetLocList() dict + let makeprg = self.makeprgBuild({ 'args': '-Zparse-only' }) + + let errorformat = + \ '%E%f:%l:%c: %\d%#:%\d%# %.%\{-}error:%.%\{-} %m,' . + \ '%W%f:%l:%c: %\d%#:%\d%# %.%\{-}warning:%.%\{-} %m,' . + \ '%C%f:%l %m,' . + \ '%-Z%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rust', + \ 'name': 'rustc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md index 9c78aa32..6dd17758 100644 --- a/sources_non_forked/syntastic/CONTRIBUTING.md +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -11,11 +11,11 @@ ## 1. Bug reports / GitHub issues Please note that the preferred channel for posting bug reports is the -[issue tracker at GitHub][0]. Reports posted elsewhere are less likely +[issue tracker at GitHub][0]. Reports posted elsewhere are less likely to be seen by the core team. When reporting a bug make sure you search the existing GitHub issues -for the same/similar issues. If you find one, feel free to add a `+1` +for the same/similar issues. If you find one, feel free to add a `+1` comment with any additional information that may help us solve the issue. @@ -26,7 +26,7 @@ When creating a new issue be sure to state the following: * the version of syntastic you are using (see `:SyntasticInfo`). For syntax checker bugs also state the version of the checker executable -that you are using. Adding debugging information is typically useful +that you are using. Adding debugging information is typically useful too: * open a file handled by your checker; @@ -38,10 +38,10 @@ too: ## 2. Submitting a patch -Before you consider adding features to syntastic, _please_ spend a few -minutes (re-)reading the latest version of the [manual][1]. Syntastic -is changing rapidly at times, and it's quite possible that some features -you want to add exist already. +Before you consider adding features to syntastic, _please_ spend a few minutes +(re-)reading the latest version of the [manual][1]. Syntastic is changing +rapidly at times, and it's possible that some features you want to add exist +already. To submit a patch: @@ -54,7 +54,7 @@ Small, focused patches are preferred. Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say. -Also, make sure to update the manual whenever applicable. Nobody can use +Also, make sure to update the manual whenever applicable. Nobody can use features that aren't documented. diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index aa5d842f..c0a49c67 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -35,7 +35,7 @@ 4.8. [How can I pass additional arguments to a checker?](#faqargs) 4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) 4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle) -4.11. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate) +4.11. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate) 4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) 4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) 5. [Resources](#otherresources) @@ -54,17 +54,17 @@ compile their code or execute their script to find them. At the time of this writing, syntastic has checking plugins for ActionScript, Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, ASM, -BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, -CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, Erlang, -eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, -HSS, HTML, Jade, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM -intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, -Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and -iOS property lists, Puppet, Python, QML, R, Racket, Relax NG, reStructuredText, -RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, -Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery, -YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details -about the corresponding supported checkers. +BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, +Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, +Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, +Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, +LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, +Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable +Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python, QML, +R, Racket, Relax NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, +SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, +VHDL, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML, z80, Zope page templates, and +zsh. See the [wiki][3] for details about the corresponding supported checkers. A number of third-party Vim plugins also provide checkers for syntastic, for example: [merlin][30], [omnisharp-vim][25], [rust.vim][12], @@ -72,7 +72,7 @@ for example: [merlin][30], [omnisharp-vim][25], [rust.vim][12], [vim-eastwood][28], and [vim-swift][24]. Below is a screenshot showing the methods that Syntastic uses to display syntax -errors. Note that, in practise, you will only have a subset of these methods +errors. Note that, in practise, you will only have a subset of these methods enabled. ![Screenshot 1][0] @@ -105,6 +105,12 @@ Syntastic should work with any modern plugin managers for Vim, such as [Vundle][17]. Instructions for installing syntastic with [Pathogen][1] are included below for completeness. +Starting with Vim version 7.4.1486 you can also load syntastic using the +standard mechanism of packages, without the help of third-party plugin managers +(see `:help packages` in Vim for details). Beware however that, while support +for packages has been added in Vim 7.4.1384, the functionality needed by +syntastic is present only in versions 7.4.1486 and later. + Last but not least: syntastic doesn't know how to do any syntax checks by itself. In order to get meaningful results you need to install external checkers corresponding to the types of files you use. Please consult the @@ -122,7 +128,7 @@ If you already have [Pathogen][1] working then skip [Step 1](#step1) and go to #### 2.2.1\. Step 1: Install pathogen.vim First I'll show you how to install Tim Pope's [Pathogen][1] so that it's easy to -install syntastic. Do this in your terminal so that you get the `pathogen.vim` +install syntastic. Do this in your terminal so that you get the `pathogen.vim` file and the directories it needs: ```sh mkdir -p ~/.vim/autoload ~/.vim/bundle && \ @@ -148,7 +154,7 @@ Quit vim and start it back up to reload it, then type: :Helptags ``` If you get an error when you do this, then you probably didn't install -[Pathogen][1] right. Go back to [Step 1](#step1) and make sure you did the +[Pathogen][1] right. Go back to [Step 1](#step1) and make sure you did the following: 1. Created both the `~/.vim/autoload` and `~/.vim/bundle` directories. @@ -161,7 +167,7 @@ following: ## 3\. Recommended settings Syntastic has numerous options that can be configured, and the defaults -are not particularly well suitable for new users. It is recommended +are not particularly well suitable for new users. It is recommended that you start by adding the following lines to your `vimrc` file, and return to them after reading the manual (see `:help syntastic` in Vim): ```vim @@ -184,7 +190,7 @@ let g:syntastic_check_on_wq = 0 __4.1. Q. I installed syntastic but it isn't reporting any errors...__ A. The most likely reason is that none of the syntax checkers that it requires -is installed. For example: by default, python requires either `flake8` or +are installed. For example: by default, python requires either `flake8` or `pylint` to be installed and in your `$PATH`. To see which executables are supported, look at the [wiki][3]. Note that aliases do not work; the actual executables must be available in your `$PATH`. Symbolic links are okay though. @@ -231,8 +237,8 @@ let g:syntastic_python_python_exec = '/path/to/python3' __4.3. Q. Are there any local checkers for HTML5 that I can use with syntastic?__ -[HTML Tidy][18] has a fork named [HTML Tidy for HTML5][19]. It's a drop -in replacement, and syntastic can use it without changes. Just install it +[HTML Tidy][18] has a fork named [HTML Tidy for HTML5][19]. It's a drop +in replacement, and syntastic can use it without changes. Just install it somewhere and point `g:syntastic_html_tidy_exec` to its executable: ```vim let g:syntastic_html_tidy_exec = 'tidy5' @@ -253,12 +259,12 @@ __4.4. Q. The `perl` checker has stopped working...__ A. The `perl` checker runs `perl -c` against your file, which in turn __executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use` -statements in your file (cf. [perlrun][10]). This is probably fine if you -wrote the file yourself, but it's a security problem if you're checking third -party files. Since there is currently no way to disable this behaviour while -still producing useful results, the checker is now disabled by default. To -(re-)enable it, make sure the `g:syntastic_perl_checkers` list includes `perl`, -and set `g:syntastic_enable_perl_checker` to 1 in your `vimrc`: +statements in your file (cf. [perlrun][10]). This is probably fine if you +wrote the file yourself, but it's a security problem if you're checking +third-party files. Since there is currently no way to disable this behaviour +while still producing useful results, the checker is now disabled by default. +To (re-)enable it, make sure the `g:syntastic_perl_checkers` list includes +`perl`, and set `g:syntastic_enable_perl_checker` to 1 in your `vimrc`: ```vim let g:syntastic_enable_perl_checker = 1 ``` @@ -267,7 +273,7 @@ let g:syntastic_enable_perl_checker = 1 __4.5. Q. What happened to the `rustc` checker?__ -A. It is now part of the [rust.vim][12] plugin. If you install this plugin the +A. It is now part of the [rust.vim][12] plugin. If you install this plugin the checker should be picked up automatically by syntastic. @@ -275,7 +281,7 @@ checker should be picked up automatically by syntastic. __4.6. Q. What happened to the `xcrun` checker?__ A. The `xcrun` checker used to have a security problem and it has been removed. -A better checker for __Swift__ is part of the [vim-swift][24] plugin. If you +A better checker for __Swift__ is part of the [vim-swift][24] plugin. If you install this plugin the checker should be picked up automatically by syntastic. @@ -284,7 +290,7 @@ __4.7. Q. I run a checker and the location list is not updated...__ __4.7. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ A. By default the location list is changed only when you run the `:Errors` -command, in order to minimise conflicts with other plugins. If you want the +command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your `vimrc`: ```vim @@ -367,7 +373,7 @@ nature, produce both kinds of messages. Syntastic is not smart enough to be able to sort out these things by itself. In fact it's more useful to look at this from the perspective of filtering -unwanted messages, rather than as an indicator of severity levels. The +unwanted messages, rather than as an indicator of severity levels. The distinction between syntax and style is orthogonal to the distinction between errors and warnings, and thus you can turn off messages based on level, on type, or both. @@ -380,7 +386,7 @@ See `:help syntastic_quiet_messages` for details. -__4.11. Q. I have enabled multiple checkers for the current filetype. How can I +__4.11. Q. I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?__ A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: @@ -426,8 +432,8 @@ There are also a dedicated [google group][5], and a [syntastic tag at StackOverflow][6]. Syntastic aims to provide a common interface to syntax checkers for as many -languages as possible. For particular languages, there are, of course, other -plugins that provide more functionality than syntastic. You might want to take +languages as possible. For particular languages, there are, of course, other +plugins that provide more functionality than syntastic. You might want to take a look at [ghcmod-vim][31], [jedi-vim][7], [python-mode][8], [vim-go][32], or [YouCompleteMe][9]. diff --git a/sources_non_forked/syntastic/autoload/syntastic/log.vim b/sources_non_forked/syntastic/autoload/syntastic/log.vim index f3950bcc..517d2c2f 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/log.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/log.vim @@ -173,10 +173,17 @@ endfunction " }}}2 " Utilities {{{1 -function! s:_log_timestamp() abort " {{{2 +function! s:_log_timestamp_smart() abort " {{{2 + return printf('syntastic: %f: ', reltimefloat(reltime(g:_SYNTASTIC_START))) +endfunction " }}}2 + +function! s:_log_timestamp_dumb() abort " {{{2 return 'syntastic: ' . split(reltimestr(reltime(g:_SYNTASTIC_START)))[0] . ': ' endfunction " }}}2 +let s:_log_timestamp = function(has('float') && exists('*reltimefloat') ? 's:_log_timestamp_smart' : 's:_log_timestamp_dumb') +lockvar s:_log_timestamp + function! s:_format_variable(name) abort " {{{2 let vals = [] if exists('g:syntastic_' . a:name) diff --git a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim index 433ed146..9f4b43b7 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim @@ -227,12 +227,12 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2 call add(out, msg) catch /\m^Vim\%((\a\+)\)\=:E716/ - call syntastic#log#warn('checker python/prospector: unrecognized error format') + call syntastic#log#warn('checker python/prospector: unrecognized error item ' . string(e)) let out = [] break endtry else - call syntastic#log#warn('checker python/prospector: unrecognized error format') + call syntastic#log#warn('checker python/prospector: unrecognized error item ' . string(e)) let out = [] break endif @@ -284,6 +284,42 @@ function! syntastic#preprocess#rparse(errors) abort " {{{2 return out endfunction " }}}2 +function! syntastic#preprocess#scss_lint(errors) abort " {{{2 + let errs = join(a:errors, '') + if errs ==# '' + return [] + endif + + let json = s:_decode_JSON(errs) + + let out = [] + if type(json) == type({}) + for fname in keys(json) + if type(json[fname]) == type([]) + for e in json[fname] + try + cal add(out, fname . ':' . + \ e['severity'][0] . ':' . + \ e['line'] . ':' . + \ e['column'] . ':' . + \ e['length'] . ':' . + \ ( has_key(e, 'linter') ? e['linter'] . ': ' : '' ) . + \ e['reason']) + catch /\m^Vim\%((\a\+)\)\=:E716/ + call syntastic#log#warn('checker scss/scss_lint: unrecognized error item ' . string(e)) + let out = [] + endtry + endfor + else + call syntastic#log#warn('checker scss/scss_lint: unrecognized error format') + endif + endfor + else + call syntastic#log#warn('checker scss/scss_lint: unrecognized error format') + endif + return out +endfunction " }}}2 + function! syntastic#preprocess#stylelint(errors) abort " {{{2 let out = [] @@ -358,12 +394,12 @@ function! syntastic#preprocess#vint(errors) abort " {{{2 call add(out, msg) catch /\m^Vim\%((\a\+)\)\=:E716/ - call syntastic#log#warn('checker vim/vint: unrecognized error format') + call syntastic#log#warn('checker vim/vint: unrecognized error item ' . string(e)) let out = [] break endtry else - call syntastic#log#warn('checker vim/vint: unrecognized error format') + call syntastic#log#warn('checker vim/vint: unrecognized error item ' . string(e)) let out = [] break endif diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim index eec3c0df..efdd5869 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/util.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -51,7 +51,7 @@ endfunction " }}}2 function! syntastic#util#tmpdir() abort " {{{2 let tempdir = '' - if (has('unix') || has('mac')) && executable('mktemp') + if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix') " TODO: option "-t" to mktemp(1) is not portable let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp' let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n") @@ -90,18 +90,7 @@ function! syntastic#util#rmrf(what) abort " {{{2 endif if getftype(a:what) ==# 'dir' - if !exists('s:rmrf') - let s:rmrf = - \ has('unix') || has('mac') ? 'rm -rf' : - \ has('win32') || has('win64') ? 'rmdir /S /Q' : - \ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : '' - endif - - if s:rmrf !=# '' - silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what)) - else - call s:_rmrf(a:what) - endif + call s:_delete(a:what, 'rf') else silent! call delete(a:what) endif @@ -251,7 +240,12 @@ function! syntastic#util#findGlobInParent(what, where) abort " {{{2 let old = '' while here !=# '' - let p = split(globpath(here, a:what, 1), '\n') + try + " Vim 7.4.279 and later + let p = globpath(here, a:what, 1, 1) + catch /\m^Vim\%((\a\+)\)\=:E118/ + let p = split(globpath(here, a:what, 1), "\n") + endtry if !empty(p) return fnamemodify(p[0], ':p') @@ -274,8 +268,9 @@ function! syntastic#util#unique(list) abort " {{{2 let seen = {} let uniques = [] for e in a:list - if !has_key(seen, e) - let seen[e] = 1 + let k = string(e) + if !has_key(seen, k) + let seen[k] = 1 call add(uniques, e) endif endfor @@ -339,6 +334,12 @@ function! syntastic#util#stamp() abort " {{{2 return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' ) endfunction " }}}2 +function! syntastic#util#setChangedtick() abort " {{{2 + unlockvar! b:syntastic_changedtick + let b:syntastic_changedtick = b:changedtick + lockvar! b:syntastic_changedtick +endfunction " }}}2 + let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_' let s:_wid_pool = 0 @@ -478,6 +479,27 @@ function! s:_translateElement(key, term) abort " {{{2 return ret endfunction " }}}2 +" @vimlint(EVL103, 1, a:flags) +function! s:_delete_dumb(what, flags) abort " {{{2 + if !exists('s:rmrf') + let s:rmrf = + \ has('unix') || has('mac') ? 'rm -rf' : + \ has('win32') || has('win64') ? 'rmdir /S /Q' : + \ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : '' + endif + + if s:rmrf !=# '' + silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what)) + else + call s:_rmrf(a:what) + endif +endfunction " }}}2 +" @vimlint(EVL103, 0, a:flags) + +" delete(dir, 'rf') was added in Vim 7.4.1107, but it didn't become usable until 7.4.1128 +let s:_delete = function(v:version > 704 || (v:version == 704 && has('patch1128')) ? 'delete' : 's:_delete_dumb') +lockvar s:_delete + function! s:_rmrf(what) abort " {{{2 if !exists('s:rmdir') let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir')) @@ -488,7 +510,13 @@ function! s:_rmrf(what) abort " {{{2 return endif - for f in split(globpath(a:what, '*', 1), "\n") + try + " Vim 7.4.279 and later + let entries = globpath(a:what, '*', 1, 1) + catch /\m^Vim\%((\a\+)\)\=:E118/ + let entries = split(globpath(a:what, '*', 1), "\n") + endtry + for f in entries call s:_rmrf(f) endfor silent! call syntastic#util#system(s:rmdir . ' ' . syntastic#util#shescape(a:what)) diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt index 85871350..310c1348 100644 --- a/sources_non_forked/syntastic/doc/syntastic.txt +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -36,6 +36,9 @@ CONTENTS *syntastic-contents* 5.2.Choosing the executable................|syntastic-config-exec| 5.3.Configuring specific checkers..........|syntastic-config-makeprg| 5.4.Sorting errors.........................|syntastic-config-sort| + 5.5.Filtering errors.......................|syntastic-config-filtering| + 5.6.Debugging..............................|syntastic-config-debug| + 5.7.Profiling..............................|syntastic-profiling| 6.Notes........................................|syntastic-notes| 6.1.Handling of composite filetypes........|syntastic-composite| 6.2.Editing files over network.............|syntastic-netrw| @@ -63,8 +66,8 @@ CONTENTS *syntastic-contents* 1. Intro *syntastic-intro* Syntastic is a syntax checking plugin that runs files through external syntax -checkers. This can be done on demand, or automatically as files are saved and -opened. If syntax errors are detected, the user is notified and is happy +checkers. This can be done on demand, or automatically as files are saved +and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. @@ -90,21 +93,21 @@ Syntastic comes preconfigured with a default list of enabled checkers per trying to use conflicting checkers. You can see the list of checkers available for the current filetype with the -|:SyntasticInfo| command. +`:SyntasticInfo` command. You probably want to override the configured list of checkers for the filetypes you use, and also change the arguments passed to specific checkers to suit your needs. See |syntastic-checker-options| below for details. -Use |:SyntasticCheck| to manually check right now. Use |:Errors| to open the -|location-list| window, and |:lclose| to close it. You can clear the error -list with |:SyntasticReset|, and you can use |:SyntasticToggleMode| to switch +Use `:SyntasticCheck` to manually check right now. Use `:Errors` to open the +|location-list| window, and `:lclose` to close it. You can clear the error +list with `:SyntasticReset`, and you can use `:SyntasticToggleMode` to switch between active (checking on writing the buffer) and passive (manual) checking. You don't have to switch focus to the |location-list| window to jump to the -different errors. Vim provides several built-in commands for this, for -example |:lnext| and |:lprevious|. You may want to add shortcut mappings for -these commands, or perhaps install a plugin such as Tim Pope's 'unimpaired' +different errors. Vim provides several built-in commands for this, for +example `:lnext` and `:lprevious`. You may want to add shortcut mappings for +these commands, or perhaps install a plugin such as Tim Pope's "unimpaired" (see https://github.com/tpope/vim-unimpaired) that provides such mappings. ------------------------------------------------------------------------------ @@ -127,7 +130,7 @@ needed: > 2. Functionality provided *syntastic-functionality* Syntax checking can be done automatically or on demand (see -|'syntastic_mode_map'| and |:SyntasticToggleMode| for configuring this). +|'syntastic_mode_map'| and `:SyntasticToggleMode` for configuring this). When syntax checking is done, the features below can be used to notify the user of errors. See |syntastic-global-options| for how to configure and @@ -158,22 +161,27 @@ Something like this could be more useful: > When syntax errors are detected a flag will be shown. The content of the flag is derived from the |syntastic_stl_format| option. +Please note that these settings might conflict with other Vim plugins that +change the way statusline works. Refer to these plugins' documentation for +possible solutions. See also |syntastic-powerline| below if you're using the +"powerline" Vim plugin (https://github.com/powerline/powerline). + ------------------------------------------------------------------------------ 2.2. Error signs *syntastic-error-signs* -Syntastic uses the |:sign| commands (provided that the |+signs| feature is +Syntastic uses the `:sign` commands (provided that the |+signs| feature is compiled in) to mark lines with errors and warnings in the sign column. To enable this feature, use the |'syntastic_enable_signs'| option. Signs are colored using the Error and Todo syntax highlight groups by default (see |group-name|). If you wish to customize the colors for the signs, you can use the following groups: - SyntasticErrorSign - For syntax errors, links to 'error' by default - SyntasticWarningSign - For syntax warnings, links to 'todo' by default - SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign' + SyntasticErrorSign - For syntax errors, links to "error" by default + SyntasticWarningSign - For syntax warnings, links to "todo" by default + SyntasticStyleErrorSign - For style errors, links to "SyntasticErrorSign" by default SyntasticStyleWarningSign - For style warnings, links to - 'SyntasticWarningSign' by default + "SyntasticWarningSign" by default Example: > highlight SyntasticErrorSign guifg=white guibg=red @@ -182,8 +190,8 @@ To set up highlighting for the line where a sign resides, you can use the following highlight groups: SyntasticErrorLine SyntasticWarningLine - SyntasticStyleErrorLine - Links to 'SyntasticErrorLine' by default - SyntasticStyleWarningLine - Links to 'SyntasticWarningLine' by default + SyntasticStyleErrorLine - Links to "SyntasticErrorLine" by default + SyntasticStyleWarningLine - Links to "SyntasticWarningLine" by default Example: > highlight SyntasticErrorLine guibg=#2f0000 @@ -191,15 +199,15 @@ Example: > ------------------------------------------------------------------------------ 2.3. The error window *syntastic-error-window* -You can use the |:Errors| command to display the errors for the current buffer +You can use the `:Errors` command to display the errors for the current buffer in the |location-list|. By default syntastic doesn't fill the |location-list| with the errors found by the checkers, in order to reduce clashes with other plugins. Consequently, if -you run |:lopen| or |:lwindow| rather than |:Errors| to open the error window -you wouldn't see syntastic's list of errors. If you insist on using |:lopen| -or |:lwindow| you should either run |:SyntasticSetLoclist| after running the -checks, or set |syntastic_always_populate_loc_list| which tells syntastic to +you run `:lopen` or `:lwindow` rather than `:Errors` to open the error window +you wouldn't see syntastic's list of errors. If you insist on using `:lopen` +or `:lwindow` you should either run `:SyntasticSetLoclist` after running the +checks, or set |'syntastic_always_populate_loc_list'| which tells syntastic to update the |location-list| automatically. ------------------------------------------------------------------------------ @@ -209,10 +217,10 @@ Some checkers provide enough information for syntastic to be able to highlight errors. By default the SpellBad syntax highlight group is used to color errors, and the SpellCap group is used for warnings. If you wish to customize the colors for highlighting you can use the following groups: - SyntasticError - Links to 'SpellBad' by default - SyntasticWarning - Links to 'SpellCap' by default - SyntasticStyleError - Links to SyntasticError by default - SyntasticStyleWarning - Links to SyntasticWarning by default + SyntasticError - Links to "SpellBad" by default (see |hl-SpellBad|) + SyntasticWarning - Links to "SpellCap" by default (see |hl-SpellCap|) + SyntasticStyleError - Links to "SyntasticError" by default + SyntasticStyleWarning - Links to "SyntasticWarning" by default Example: > highlight SyntasticError guibg=#2f0000 @@ -232,11 +240,11 @@ If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found by all checkers in a single list, and notifies you. In this mode each error message is labeled with the name of the checker that generated it, but you can -disable generation of these labels by turning off '|syntastic_id_checkers|'. +disable generation of these labels by turning off |'syntastic_id_checkers'|. If |'syntastic_sort_aggregated_errors'| is set (which is the default), messages in the aggregated list are grouped by file, then sorted by line number, then -type, then column number. Otherwise messages produced by the same checker are +type, then column number. Otherwise messages produced by the same checker are grouped together, and sorting within each group is decided by the variables |'syntastic___sort'|. @@ -258,7 +266,7 @@ See also: |'syntastic___quiet_messages'| and When errors have been detected, use this command to pop up the |location-list| and display the error messages. -Please note that the |:Errors| command overwrites the current location list with +Please note that the `:Errors` command overwrites the current location list with syntastic's own location list. :SyntasticToggleMode *:SyntasticToggleMode* @@ -268,17 +276,17 @@ for more info. :SyntasticCheck *:SyntasticCheck* -Manually cause a syntax check to be done. By default the checkers in the +Manually cause a syntax check to be done. By default the checkers in the |'g:syntastic__checkers'| or |'b:syntastic_checkers'| lists are run, -cf. |syntastic-filetype-checkers|. If |'syntastic_aggregate_errors'| is unset +cf. |syntastic-filetype-checkers|. If |'syntastic_aggregate_errors'| is unset (which is the default), checking stops the first time a checker reports any errors; if |'syntastic_aggregate_errors'| is set, all checkers that apply are run in turn, and all errors found are aggregated in a single list. -The command may be followed by a (space separated) list of checkers. In this +The command may be followed by a (space separated) list of checkers. In this case |'g:syntastic__checkers'| and |'b:syntastic_checkers'| are ignored, and the checkers named by the command's arguments are run instead, in -the order specified. The set by |'syntastic_aggregate_errors'| still apply. +the order specified. The set by |'syntastic_aggregate_errors'| still apply. Example: > :SyntasticCheck flake8 pylint @@ -298,26 +306,29 @@ Resets the list of errors and turns off all error notifiers. If |'syntastic_always_populate_loc_list'| is not set, the |location-list| is not filled in automatically with the list of errors detected by the checkers. This is useful if you run syntastic along with other plugins that use location -lists. The |:SyntasticSetLoclist| command allows you to stick the errors into +lists. The `:SyntasticSetLoclist` command allows you to stick the errors into the location list explicitly. ============================================================================== 4. Global Options *syntastic-global-options* *'syntastic_check_on_open'* +Type: boolean Default: 0 If this variable is enabled, syntastic in active mode will run syntax checks when buffers are first loaded, as well as on saving: > let g:syntastic_check_on_open = 1 < *'syntastic_check_on_wq'* +Type: boolean Default: 1 In active mode syntax checks are normally run whenever buffers are written to -disk, even when the writes happen just before quitting Vim. If you want to -skip checks when you issue |:wq|, |:x|, and |:ZZ|, set this variable to 0: > +disk, even when the writes happen just before quitting Vim. If you want to +skip checks when you issue `:wq`, `:x`, and `:ZZ`, set this variable to 0: > let g:syntastic_check_on_wq = 0 < *'syntastic_aggregate_errors'* +Type: boolean Default: 0 When enabled, syntastic runs all checkers that apply to the current filetype, then aggregates errors found by all checkers and displays them. When disabled, @@ -326,26 +337,30 @@ time a checker finds any errors. > let g:syntastic_aggregate_errors = 1 < *'syntastic_id_checkers'* +Type: boolean Default: 1 When results from multiple checkers are aggregated in a single error list (that is either when |'syntastic_aggregate_errors'| is enabled, or when -checking a file with a composite filetype), it might not be immediately -obvious which checker has produced a given error message. This variable -instructs syntastic to label error messages with the names of the checkers -that created them. > +checking a file with a composite filetype, cf. |syntastic-composite|), it +might not be immediately obvious which checker has produced a given error +message. This variable instructs syntastic to label error messages with the +names of the checkers that created them. > let g:syntastic_id_checkers = 0 < *'syntastic_sort_aggregated_errors'* +Type: boolean Default: 1 By default, when results from multiple checkers are aggregated in a single -error list (that is either when |'syntastic_aggregate_errors'| is enabled, -or when checking a file with a composite filetype), errors are grouped by -file, then sorted by line number, then grouped by type (namely errors take -precedence over warnings), then they are sorted by column number. If you want -to leave messages grouped by checker output, set this variable to 0: > +error list (that is either when |'syntastic_aggregate_errors'| is enabled, or +when checking a file with a composite filetype, cf. |syntastic-composite|), +errors are grouped by file, then sorted by line number, then grouped by type +(namely errors take precedence over warnings), then they are sorted by column +number. If you want to leave messages grouped by checker output, set this +variable to 0: > let g:syntastic_sort_aggregated_errors = 0 < *'syntastic_echo_current_error'* +Type: boolean Default: 1 If enabled, syntastic will echo current error to the command window. If multiple errors are found on the same line, |'syntastic_cursor_columns'| is @@ -353,6 +368,7 @@ used to decide which one is shown. > let g:syntastic_echo_current_error = 1 < *'syntastic_cursor_columns'* +Type: boolean Default: 1 This option controls which errors are echoed to the command window if |'syntastic_echo_current_error'| is set and multiple errors are found on the @@ -365,25 +381,28 @@ up navigation significantly: > let g:syntastic_cursor_column = 0 < *'syntastic_enable_signs'* +Type: boolean Default: 1 -Use this option to tell syntastic whether to use the |:sign| interface to mark +Use this option to tell syntastic whether to use the `:sign` interface to mark syntax errors: > let g:syntastic_enable_signs = 1 < *'syntastic_error_symbol'* *'syntastic_style_error_symbol'* *'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'* -Use this option to control what the syntastic |:sign| text contains. Several +Type: string +Use these options to control what the syntastic `:sign` text contains. Several error symbols can be customized: - syntastic_error_symbol - For syntax errors, defaults to '>>' - syntastic_style_error_symbol - For style errors, defaults to 'S>' - syntastic_warning_symbol - For syntax warnings, defaults to '>>' - syntastic_style_warning_symbol - For style warnings, defaults to 'S>' + syntastic_error_symbol - For syntax errors, defaults to ">>" + syntastic_style_error_symbol - For style errors, defaults to "S>" + syntastic_warning_symbol - For syntax warnings, defaults to ">>" + syntastic_style_warning_symbol - For style warnings, defaults to "S>" Example: > - let g:syntastic_error_symbol = "✗" - let g:syntastic_warning_symbol = "⚠" + let g:syntastic_error_symbol = "\u2717" + let g:syntastic_warning_symbol = "\u26A0" < *'syntastic_enable_balloons'* +Type: boolean Default: 1 Use this option to tell syntastic whether to display error messages in balloons when the mouse is hovered over erroneous lines: > @@ -392,12 +411,14 @@ when the mouse is hovered over erroneous lines: > Note that Vim must be compiled with |+balloon_eval|. *'syntastic_enable_highlighting'* +Type: boolean Default: 1 Use this option to tell syntastic whether to use syntax highlighting to mark errors (where possible). Highlighting can be turned off with the following > let g:syntastic_enable_highlighting = 0 < *'syntastic_always_populate_loc_list'* +Type: boolean Default: 0 By default syntastic doesn't fill the |location-list| with the errors found by the checkers, in order to reduce clashes with other plugins. Enable this @@ -407,10 +428,11 @@ option to tell syntastic to always stick any detected errors into the < Please note that if |'syntastic_auto_jump'| is set to a non-zero value the location list is overwritten with Syntastic's own list when taking a jump, -regardless of the value of |'syntastic_always_populate_loc_list'|. The -location list is also overwritten when running the |:Errors| command. +regardless of the value of |'syntastic_always_populate_loc_list'|. The +location list is also overwritten when running the `:Errors` command. *'syntastic_auto_jump'* +Type: integer Default: 0 Enable this option if you want the cursor to jump to the first detected issue when saving or opening a file. @@ -435,6 +457,7 @@ of the location list being overwritten with Syntastic's own location list, regardless of the value of |'syntastic_always_populate_loc_list'|. *'syntastic_auto_loc_list'* +Type: integer Default: 2 Use this option to tell syntastic to automatically open and/or close the |location-list| (see |syntastic-error-window|). @@ -456,20 +479,23 @@ detected, but not closed automatically. > let g:syntastic_auto_loc_list = 3 < *'syntastic_loc_list_height'* +Type: integer Default: 10 Use this option to specify the height of the location lists that syntastic opens. > let g:syntastic_loc_list_height = 5 < *'syntastic_ignore_files'* +Type: list of strings Default: [] -Use this option to specify files that syntastic should never check. It's a -list of |regular-expression| patterns. The full paths of files (see |::p|) are +Use this option to specify files that syntastic should never check. It's a +list of |regular-expression| patterns. The full paths of files (see |::p|) are matched against these patterns, and the matches are case-sensitive. Use |\c| -to specify case-insensitive patterns. Example: > +to specify case-insensitive patterns. Example: > let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$'] < *'syntastic_filetype_map'* +Type: dictionary Default: {} Use this option to map non-standard filetypes to standard ones. Corresponding checkers are mapped accordingly, which allows syntastic to check files with @@ -478,11 +504,13 @@ non-standard filetypes: > \ "plaintex": "tex", \ "gentoo-metadata": "xml" } < -Composite filetypes can also be mapped to simple types, which disables the -default behaviour of running both checkers against the input file: > +Composite filetypes (cf. |syntastic-composite|) can also be mapped to simple +types, which disables the default behaviour of running both checkers against +the input file: > let g:syntastic_filetype_map = { "handlebars.html": "handlebars" } < *'syntastic_mode_map'* +Type: dictionary Default: { "mode": "active", "active_filetypes": [], "passive_filetypes": [] } @@ -490,7 +518,6 @@ Use this option to fine tune when automatic syntax checking is done (or not done). The option should be set to something like: > - let g:syntastic_mode_map = { \ "mode": "active", \ "active_filetypes": ["ruby", "php"], @@ -498,8 +525,8 @@ The option should be set to something like: > < "mode" can be mapped to one of two values - "active" or "passive". When set to "active", syntastic does automatic checking whenever a buffer is saved or -initially opened. When set to "passive" syntastic only checks when the user -calls |:SyntasticCheck|. +initially opened. When set to "passive" syntastic only checks when the user +calls `:SyntasticCheck`. The exceptions to these rules are defined with "active_filetypes" and "passive_filetypes". In passive mode, automatic checks are still done for @@ -514,18 +541,20 @@ If local variable |'b:syntastic_mode'| is defined its value takes precedence over all calculations involving |'syntastic_mode_map'| for the corresponding buffer. -At runtime, the |:SyntasticToggleMode| command can be used to switch between +At runtime, the `:SyntasticToggleMode` command can be used to switch between active and passive modes. *'b:syntastic_mode'* +Type: string Default: unset Only the local form |'b:syntastic_mode'| is used. When set to either "active" or "passive", it takes precedence over |'syntastic_mode_map'| when deciding whether the corresponding buffer should be checked automatically. *'syntastic_quiet_messages'* +Type: dictionary Default: {} -Use this option to filter out some of the messages produced by checkers. The +Use this option to filter out some of the messages produced by checkers. The option should be set to something like: > let g:syntastic_quiet_messages = { \ "!level": "errors", @@ -536,15 +565,15 @@ option should be set to something like: > Each element turns off messages matching the patterns specified by the corresponding value. Values are lists, but if a list consist of a single element you may omit the brackets (e.g. you may write "style" instead of -["style"]). Elements with values [] or '' are ignored (this is useful for +["style"]). Elements with values [] or "" are ignored (this is useful for overriding filters, cf. |filter-overrides|). "level" - takes one of two values, "warnings" or "errors" "type" - can be either "syntax" or "style" - "regex" - is matched against the messages' text as a case-insensitive - |regular-expression| - "file" - is matched against the filenames the messages refer to, as a - case-sensitive |regular-expression|. + "regex" - each item in list is matched against the messages' text as a + case-insensitive |regular-expression| + "file" - each item in list is matched against the filenames the messages + refer to, as a case-sensitive |regular-expression|. If a key is prefixed by an exclamation mark "!", the corresponding filter is negated (i.e. the above example silences all messages that are NOT errors). @@ -566,16 +595,17 @@ errors produced by the said checker). In case of conflicting values for the same keys, the values of the checker-specific filters take precedence. *filter-overrides* -Since filter elements with values [] or '' are ignored, you can disable global +Since filter elements with values [] or "" are ignored, you can disable global filters for particular checkers, by setting the values of the corresponding -elements in |'syntastic___quiet_messages'| to [] or ''. For +elements in |'syntastic___quiet_messages'| to [] or "". For example, the following setting will silence all warnings, except for the ones produced by "pylint": > let g:syntastic_quiet_messages = { "level": "warnings" } let g:syntastic_python_pylint_quiet_messages = { "level" : [] } < *'syntastic_stl_format'* -Default: [Syntax: line:%F (%t)] +Type: string +Default: "[Syntax: line:%F (%t)]" Use this option to control what the syntastic statusline text contains. Several magic flags are available to insert information: %e - number of errors @@ -606,7 +636,7 @@ Several additional flags are available to hide text under certain conditions: These flags can't be nested. Example: > - let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]' + let g:syntastic_stl_format = "[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]" < If this format is used and the current buffer has 5 errors and 1 warning starting on lines 20 and 10 respectively then this would appear on the @@ -617,19 +647,22 @@ If the buffer had 2 warnings, starting on line 5 then this would appear: > [Warn: 5 #2] < *'b:syntastic_skip_checks'* +Type: boolean Default: unset Only the local form |'b:syntastic_skip_checks'| is used. When set to a true value, no checks are run against the corresponding buffer. Example: > let b:syntastic_skip_checks = 1 < *'syntastic_full_redraws'* +Type: boolean Default: 0 in GUI Vim and MacVim, 1 otherwise -Controls whether syntastic calls |:redraw| or |:redraw!| for screen redraws. +Controls whether syntastic calls `:redraw` or `:redraw!` for screen redraws. Changing it can in principle make screen redraws smoother, but it can also cause screen to flicker, or cause ghost characters. Leaving it to the default should be safe. *'syntastic_exit_checks'* +Type: boolean Default: 0 when running under "cmd.exe" on Windows, 1 otherwise Syntastic attempts to catch abnormal termination conditions from checkers by looking at their exit codes. The "cmd.exe" shell on Windows make these checks @@ -637,26 +670,29 @@ meaningless, by returning 1 to Vim when the checkers exit with non-zero codes. The above variable can be used to disable exit code checks in syntastic. *'syntastic_shell'* +Type: string Default: Vim's 'shell' This is the (full path to) the shell syntastic will use to run the checkers. On UNIX and Mac OS-X this shell must accept Bourne-compatible syntax for -file "stdout" and "stderr" redirections ">file" and "2>file". Examples of +file "stdout" and "stderr" redirections ">file" and "2>file". Examples of compatible shells are "zsh", "bash", "ksh", and of course the original Bourne "sh". This shell is independent of Vim's 'shell', and it isn't used for interactive -operations. It must take care to initialize all environment variables needed -by the checkers you're using. Example: > +operations. It must take care to initialize all environment variables needed +by the checkers you're using. Example: > let g:syntastic_shell = "/bin/sh" < *'syntastic_nested_autocommands'* +Type: boolean Default: 0 Controls whether syntastic's autocommands |BufReadPost| and |BufWritePost| are called from other |BufReadPost| and |BufWritePost| autocommands (see -|autocmd-nested|). This is known to trigger interoperability problems with +|autocmd-nested|). This is known to trigger interoperability problems with other plugins, so only enable it if you actually need that functionality. *'syntastic_debug'* +Type: integer Default: 0 Set this to the sum of one or more of the following flags to enable debugging: @@ -672,23 +708,25 @@ Example: > let g:syntastic_debug = 1 < Syntastic will then add debugging messages to Vim's |message-history|. You can -examine these messages with |:mes|. +examine these messages with `:mes`. *'syntastic_debug_file'* +Type: string Default: unset When set, debugging messages are written to the file named by its value, in addition to being added to Vim's |message-history|: > - let g:syntastic_debug_file = '~/syntastic.log' + let g:syntastic_debug_file = "~/syntastic.log" < *'syntastic_extra_filetypes'* +Type: list of strings Default: [] -List of filetypes handled by checkers external to syntastic. If you have a Vim +List of filetypes handled by checkers external to syntastic. If you have a Vim plugin that adds a checker for syntastic, and if the said checker deals with a filetype that is unknown to syntastic, you might consider adding that filetype to this list: > let g:syntastic_extra_filetypes = [ "make", "gitcommit" ] < -This will allow |:SyntasticInfo| to do proper tab completion for the new +This will allow `:SyntasticInfo` to do proper tab completion for the new filetypes. ============================================================================== @@ -703,8 +741,8 @@ variable 'g:syntastic__checkers' to a list of checkers, e.g. > let g:syntastic_php_checkers = ["php", "phpcs", "phpmd"] < *'b:syntastic_checkers'* -There is also a per-buffer version of this setting, 'b:syntastic_checkers'. -When set, it takes precedence over |'g:syntastic__checkers'|. You can +There is also a per-buffer version of this setting, |'b:syntastic_checkers'|. +When set, it takes precedence over |'g:syntastic__checkers'|. You can use this in an autocmd to configure specific checkers for particular paths: > autocmd FileType python if stridx(expand("%:p"), "/some/path/") == 0 | \ let b:syntastic_checkers = ["pylint"] | endif @@ -718,7 +756,7 @@ by syntastic: https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers -Use |:SyntasticInfo| to see which checkers are available for a given filetype. +Use `:SyntasticInfo` to see which checkers are available for a given filetype. ------------------------------------------------------------------------------ 5.2 Choosing the executable *syntastic-config-exec* @@ -727,74 +765,93 @@ Use |:SyntasticInfo| to see which checkers are available for a given filetype. The executable run by a checker is normally defined automatically, when the checker is registered. You can however override it, by setting the variable 'g:syntastic___exec': > - let g:syntastic_ruby_mri_exec = '~/bin/ruby2' + let g:syntastic_ruby_mri_exec = "~/bin/ruby2" < This variable has a local version, 'b:syntastic___exec', which takes precedence over the global one in the corresponding buffer. *'b:syntastic__exec'* -And there is also a local variable named 'b:syntastic__exec', which +There is also a local variable named 'b:syntastic__exec', which takes precedence over both 'b:syntastic___exec' and 'g:syntastic___exec' in the buffers where it is defined. ------------------------------------------------------------------------------ 5.3 Configuring specific checkers *syntastic-config-makeprg* -Most checkers use the 'makeprgBuild()' function and provide many options by -default - in fact you can customise every part of the command that gets called. +Checkers are run by constructing a command line and by passing it to a shell +(see |'shell'| and |'syntastic_shell'|). In most cases this command line is +built using an internal function named "makeprgBuild()", which provides a +number of options that allow you to customise every part of the command that +gets called. *'syntastic___