144 changed files with 13076 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT) |
||||
|
||||
Copyright (c) 2015 Dave Honneffer |
||||
|
||||
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. |
@ -0,0 +1,135 @@
@@ -0,0 +1,135 @@
|
||||
## introduction |
||||
|
||||
This is a vim syntax plugin for Ansible 2.x, it supports YAML playbooks, Jinja2 templates, and Ansible's `hosts` files. |
||||
|
||||
- YAML playbooks are detected if: |
||||
- they are in the `group_vars` or `host_vars` folder |
||||
- they are in the `tasks`, `roles`, or `handlers` folder and have either a *.yml* or *.yaml* suffix |
||||
- they are named `playbook.y(a)ml`, `site.y(a)ml`, or `main.y(a)ml` |
||||
- Jinja2 templates are detected if they have a *.j2* suffix |
||||
- Files named `hosts` will be treated as Ansible hosts files |
||||
|
||||
You can also set the filetype to `yaml.ansible`, `*.jinja2`, or `ansible_hosts` if auto-detection does not work (e.g. `:set ft=yaml.ansible` or `:set ft=ruby.jinja2`). **Note**: If you want to detect a custom pattern of your own, you can easily add this in your `.vimrc` using something like this: |
||||
|
||||
```vim |
||||
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible |
||||
``` |
||||
|
||||
If you want to override the default file type detection you can easily do this in your `.vimrc`. For example if you use YAML syntax for `hosts` include something like this: |
||||
|
||||
```vim |
||||
augroup ansible_vim_fthosts |
||||
autocmd! |
||||
autocmd BufNewFile,BufRead hosts setfiletype yaml.ansible |
||||
augroup END |
||||
``` |
||||
|
||||
This plugin should be quite reliable, as it sources the original formats and simply modifies the highlights as appropriate. This also enables a focus on simplicity and configurability instead of patching bad syntax detection. |
||||
|
||||
##### examples (with [solarized](https://github.com/altercation/vim-colors-solarized) colorscheme) |
||||
|
||||
Bright (and selective highlight) | Dim |
||||
:-----------------------------------:|:-------------------------: |
||||
 |  |
||||
|
||||
##### installation |
||||
|
||||
Use your favorite plugin manager, or try [vim-plug](https://github.com/junegunn/vim-plug) if you're looking for a really nice one! |
||||
|
||||
**vim-plug:** `Plug 'pearofducks/ansible-vim'` |
||||
|
||||
**vim-plug with post-update hook:** `Plug 'pearofducks/ansible-vim', { 'do': |
||||
'cd ./UltiSnips; ./generate.py' }` |
||||
|
||||
*Note: `generate.py` requires Ansible 2.4 or later.* |
||||
|
||||
**vundle:** `Plugin 'pearofducks/ansible-vim'` |
||||
|
||||
**pathogen:** `git clone https://github.com/pearofducks/ansible-vim ~/.vim/bundle/ansible-vim` |
||||
|
||||
**Arch Linux:** Package [ansible-vim-git](https://aur.archlinux.org/packages/ansible-vim-git/) available on AUR |
||||
|
||||
## options |
||||
|
||||
##### g:ansible_unindent_after_newline |
||||
|
||||
`let g:ansible_unindent_after_newline = 1` |
||||
|
||||
When this variable is set, indentation will completely reset (unindent to column 0) after two newlines in insert-mode. The normal behavior of YAML is to always keep the previous indentation, even across multiple newlines with no content. |
||||
|
||||
##### g:ansible_yamlKeyName |
||||
|
||||
`let g:ansible_yamlKeyName = 'yamlKey'` |
||||
|
||||
This option exists to provide additional compatibility with [stephpy/vim-yaml](https://github.com/stephpy/vim-yaml). |
||||
|
||||
##### g:ansible_attribute_highlight |
||||
`let g:ansible_attribute_highlight = "ob"` |
||||
|
||||
Ansible modules use a `key=value` format for specifying module-attributes in playbooks. This highlights those as specified. This highlight option is also used when highlighting key/value pairs in `hosts` files. |
||||
|
||||
Available flags (bold are defaults): |
||||
|
||||
- **a**: highlight *all* instances of `key=` |
||||
- o: highlight *only* instances of `key=` found on newlines |
||||
- **d**: *dim* the instances of `key=` found |
||||
- b: *brighten* the instances of `key=` found |
||||
- n: turn this highlight off completely |
||||
|
||||
##### g:ansible_name_highlight |
||||
`let g:ansible_name_highlight = 'd'` |
||||
|
||||
Ansible modules commonly start with a `name:` key for self-documentation of playbooks. This option enables/changes highlight of this. |
||||
|
||||
Available flags (this feature is off by default): |
||||
|
||||
- d: *dim* the instances of `name:` found |
||||
- b: *brighten* the instances of `name:` found |
||||
|
||||
##### g:ansible_extra_keywords_highlight |
||||
`let g:ansible_extra_keywords_highlight = 1` |
||||
|
||||
*Note:* This option is enabled when set, and disabled when not set. |
||||
|
||||
Highlight the following additional keywords in playbooks: `register always_run changed_when failed_when no_log args vars delegate_to ignore_errors` |
||||
|
||||
By default we only highlight: `include until retries delay when only_if become become_user block rescue always notify` |
||||
|
||||
##### g:ansible_normal_keywords_highlight |
||||
`let g:ansible_normal_keywords_highlight = 'Constant'` |
||||
|
||||
Accepts any syntax group name from `:help E669` - e.g. _Comment_, _Constant_, and _Identifier_ |
||||
|
||||
*Note:* Defaults to 'Statement' when not set. |
||||
|
||||
This option change the highlight of the following common keywords in playbooks: `include until retries delay when only_if become become_user block rescue always notify` |
||||
|
||||
##### g:ansible_with_keywords_highlight |
||||
`let g:ansible_with_keywords_highlight = 'Constant'` |
||||
|
||||
Accepts any syntax group-name from `:help E669` - e.g. _Comment_, _Constant_, and _Identifier_ |
||||
|
||||
*Note:* Defaults to 'Statement' when not set. |
||||
|
||||
This option changes the highlight of all `with_.+` keywords in playbooks. |
||||
|
||||
##### g:ansible_template_syntaxes |
||||
`let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby' }` |
||||
|
||||
Accepts a dictionary in the form of `'regex-for-file': 'filetype'`. |
||||
- _regex-for-file_ will receive the full filepath, so directory matching can be done. |
||||
- _filetype_ is the root filetype to be applied, `jinja2` will be automatically appended |
||||
|
||||
All files ending in `*.j2` that aren't matched will simply get the `jinja2` filetype. |
||||
|
||||
## bugs, suggestions/requests, & contributions |
||||
|
||||
##### bugs |
||||
|
||||
It's unlikely that there will be bugs in highlighting that don't exist in the core format. Where appropriate these will be fixed in this plugin, but if the problem is with the original syntax we should probably focus on fixing that instead. |
||||
|
||||
Indenting a full document - e.g with `gg=G` - will not be supported and is not a goal of this plugin (unless someone else develops it!). Please do not file a bug report on this. |
||||
|
||||
##### suggestions/requests |
||||
|
||||
Suggestions for improvements are welcome, pull-requests with completed features even more so. :) |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
ansible.snippets |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
Generate Snippets Based on Ansible Modules |
||||
========================================== |
||||
|
||||
A script to generate `UltiSnips` based on ansible code on the fly. |
||||
|
||||
**Note:** Requires Ansible 2.4 or later. |
||||
|
||||
Script parameters |
||||
----------------- |
||||
There are a couple of optional arguments for the script. |
||||
|
||||
* --output: Output filename (Default: ansible.snippets) |
||||
* --style: YAML formatting style for snippets |
||||
Choices: multiline (default), dictionary |
||||
* --sort: Whether to sort module arguments (default: no) |
||||
|
||||
For Users |
||||
--------- |
||||
We display option description somewhere, however, there are some special formatters in it. |
||||
For your reference, we list them here and you can find them under `/ansible/repo/hacking/module_formatter.py`: |
||||
|
||||
* I: Italic |
||||
* B: Bold |
||||
* M: Module |
||||
* U: URL |
||||
* C: Const |
||||
|
||||
For Developers |
||||
-------------- |
||||
* `pip install ansible` first |
||||
|
||||
Thanks |
||||
------ |
||||
* Based on (ansible)[https://github.com/ansible/ansible] Awesome Documentation |
||||
* Inspired by [bleader/ansible_snippet_generator](https://github.com/bleader/ansible_snippet_generator) |
@ -0,0 +1,109 @@
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env python |
||||
# -*- coding: utf-8 -*- |
||||
from __future__ import unicode_literals |
||||
|
||||
import argparse |
||||
import os |
||||
import os.path |
||||
import ansible.modules |
||||
from ansible.utils.plugin_docs import get_docstring |
||||
from ansible.plugins.loader import fragment_loader |
||||
|
||||
|
||||
def get_documents(): |
||||
for root, dirs, files in os.walk(os.path.dirname(ansible.modules.__file__)): |
||||
for f in files: |
||||
if f == '__init__.py' or not f.endswith('py'): |
||||
continue |
||||
documentation = get_docstring(os.path.join(root, f), fragment_loader)[0] |
||||
if documentation is None: |
||||
continue |
||||
yield documentation |
||||
|
||||
|
||||
def to_snippet(document): |
||||
snippet = [] |
||||
if 'options' in document: |
||||
options = document['options'].items() |
||||
if args.sort: |
||||
options = sorted(options, key=lambda x: x[0]) |
||||
|
||||
options = sorted(options, key=lambda x: x[1].get('required', False), reverse=True) |
||||
|
||||
for index, (name, option) in enumerate(options, 1): |
||||
if 'choices' in option: |
||||
default = option.get('default') |
||||
if isinstance(default, list): |
||||
prefix = lambda x: '#' if x in default else '' |
||||
suffix = lambda x: "'%s'" % x if isinstance(x, str) else x |
||||
value = '[' + ', '.join("%s%s" % (prefix(choice), suffix(choice)) for choice in option['choices']) |
||||
else: |
||||
prefix = lambda x: '#' if x == default else '' |
||||
value = '|'.join('%s%s' % (prefix(choice), choice) for choice in option['choices']) |
||||
elif option.get('default') is not None and option['default'] != 'None': |
||||
value = option['default'] |
||||
if isinstance(value, bool): |
||||
value = 'yes' if value else 'no' |
||||
else: |
||||
value = "# " + option.get('description', [''])[0] |
||||
if args.style == 'dictionary': |
||||
delim = ': ' |
||||
else: |
||||
delim = '=' |
||||
|
||||
if name == 'free_form': # special for command/shell |
||||
snippet.append('\t${%d:%s%s%s}' % (index, name, delim, value)) |
||||
else: |
||||
snippet.append('\t%s%s${%d:%s}' % (name, delim, index, value)) |
||||
|
||||
# insert a line to seperate required/non-required fields |
||||
for index, (_, option) in enumerate(options): |
||||
if not option.get("required"): |
||||
if index != 0: |
||||
snippet.insert(index, '') |
||||
break |
||||
|
||||
if args.style == 'dictionary': |
||||
snippet.insert(0, '%s:' % (document['module'])) |
||||
else: |
||||
snippet.insert(0, '%s:%s' % (document['module'], ' >' if len(snippet) else '')) |
||||
snippet.insert(0, 'snippet %s "%s" b' % (document['module'], document['short_description'])) |
||||
snippet.append('') |
||||
snippet.append('endsnippet') |
||||
return "\n".join(snippet) |
||||
|
||||
|
||||
if __name__ == "__main__": |
||||
|
||||
parser = argparse.ArgumentParser() |
||||
parser.add_argument( |
||||
'--output', |
||||
help='output filename', |
||||
default='ansible.snippets' |
||||
) |
||||
parser.add_argument( |
||||
'--style', |
||||
help='yaml format to use for snippets', |
||||
choices=['multiline', 'dictionary'], |
||||
default='multiline' |
||||
) |
||||
parser.add_argument( |
||||
'--sort', |
||||
help='sort module arguments', |
||||
action='store_true', |
||||
default=False |
||||
) |
||||
|
||||
args = parser.parse_args() |
||||
|
||||
with open(args.output, "w") as f: |
||||
f.writelines(["priority -50\n", "\n", "# THIS FILE IS AUTOMATED GENERATED, PLEASE DON'T MODIFY BY HAND\n", "\n"]) |
||||
for document in get_documents(): |
||||
if 'deprecated' in document: |
||||
continue |
||||
snippet = to_snippet(document) |
||||
if not isinstance(snippet, str): |
||||
# python2 compatibility |
||||
snippet = snippet.encode('utf-8') |
||||
f.write(snippet) |
||||
f.write("\n\n") |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
function! s:isAnsible() |
||||
let filepath = expand("%:p") |
||||
let filename = expand("%:t") |
||||
if filepath =~ '\v/(defaults|tasks|roles|handlers|meta|vars)/.*\.ya?ml$' | return 1 | en |
||||
if filepath =~ '\v/(group|host)_vars/' | return 1 | en |
||||
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en |
||||
|
||||
let shebang = getline(1) |
||||
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en |
||||
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en |
||||
|
||||
return 0 |
||||
endfunction |
||||
|
||||
function! s:setupTemplate() |
||||
if exists("g:ansible_template_syntaxes") |
||||
let filepath = expand("%:p") |
||||
for syntax_name in items(g:ansible_template_syntaxes) |
||||
let s:syntax_string = '\v/'.syntax_name[0] |
||||
if filepath =~ s:syntax_string |
||||
execute 'set ft='.syntax_name[1].'.jinja2' |
||||
return |
||||
endif |
||||
endfor |
||||
endif |
||||
set ft=jinja2 |
||||
endfunction |
||||
|
||||
augroup ansible_vim_ftyaml_ansible |
||||
au! |
||||
au BufNewFile,BufRead * if s:isAnsible() | set ft=yaml.ansible | en |
||||
augroup END |
||||
augroup ansible_vim_ftjinja2 |
||||
au! |
||||
au BufNewFile,BufRead *.j2 call s:setupTemplate() |
||||
augroup END |
||||
augroup ansible_vim_fthosts |
||||
au! |
||||
au BufNewFile,BufRead inventory* set ft=ansible_hosts |
||||
augroup END |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
" Slow yaml highlighting workaround |
||||
if exists('+regexpengine') && ('®expengine' == 0) |
||||
setlocal regexpengine=1 |
||||
endif |
||||
set isfname+=@-@ |
||||
set path+=./../templates,./../files,templates,files |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
if exists("b:did_ftplugin") |
||||
finish |
||||
else |
||||
let b:did_ftplugin = 1 |
||||
endif |
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions-=c |
||||
|
||||
let b:undo_ftplugin = "setl comments< commentstring< formatoptions<" |
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
let s:save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
setlocal indentexpr=GetAnsibleIndent(v:lnum) |
||||
setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-,*<Return> |
||||
setlocal nosmartindent |
||||
setlocal expandtab |
||||
setlocal softtabstop=2 |
||||
setlocal shiftwidth=2 |
||||
setlocal commentstring=#%s |
||||
setlocal formatoptions+=cl |
||||
" c -> wrap long comments, including # |
||||
" l -> do not wrap long lines |
||||
|
||||
let s:comment = '\v^\s*#' " # comment |
||||
let s:array_entry = '\v^\s*-\s' " - foo |
||||
let s:named_module_entry = '\v^\s*-\s*(name|hosts|role):\s*\S' " - name: 'do stuff' |
||||
let s:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items: |
||||
let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package |
||||
let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: > |
||||
|
||||
if exists('*GetAnsibleIndent') |
||||
finish |
||||
endif |
||||
|
||||
function GetAnsibleIndent(lnum) |
||||
if a:lnum == 1 || !prevnonblank(a:lnum-1) |
||||
return 0 |
||||
endif |
||||
if exists("g:ansible_unindent_after_newline") |
||||
if (a:lnum -1) != prevnonblank(a:lnum - 1) |
||||
return 0 |
||||
endif |
||||
endif |
||||
let prevlnum = prevnonblank(a:lnum - 1) |
||||
let maintain = indent(prevlnum) |
||||
let increase = maintain + &sw |
||||
|
||||
let line = getline(prevlnum) |
||||
if line =~ s:array_entry |
||||
if line =~ s:named_module_entry |
||||
return increase |
||||
else |
||||
return maintain |
||||
endif |
||||
elseif line =~ s:dictionary_entry |
||||
return increase |
||||
elseif line =~ s:key_value |
||||
if line =~ s:scalar_value |
||||
return increase |
||||
else |
||||
return maintain |
||||
endif |
||||
else |
||||
return maintain |
||||
endif |
||||
endfunction |
||||
|
||||
let &cpo = s:save_cpo |
@ -0,0 +1,104 @@
@@ -0,0 +1,104 @@
|
||||
" Vim syntax file |
||||
" Language: Ansible YAML/Jinja templates |
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com> |
||||
" Last Change: 2018.02.08 |
||||
|
||||
if !exists("main_syntax") |
||||
let main_syntax = 'yaml' |
||||
endif |
||||
|
||||
if exists('b:current_syntax') |
||||
let s:current_syntax=b:current_syntax |
||||
unlet b:current_syntax |
||||
endif |
||||
|
||||
syntax include @Jinja syntax/jinja2.vim |
||||
|
||||
if exists('s:current_syntax') |
||||
let b:current_syntax=s:current_syntax |
||||
endif |
||||
|
||||
" Jinja |
||||
" ================================ |
||||
|
||||
syn cluster jinjaSLSBlocks add=jinjaTagBlock,jinjaVarBlock,jinjaComment |
||||
" https://github.com/mitsuhiko/jinja2/blob/6b7c0c23/ext/Vim/jinja.vim |
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,yamlComment,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks |
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,@jinjaSLSBlocks |
||||
highlight link jinjaVariable Constant |
||||
highlight link jinjaVarDelim Delimiter |
||||
|
||||
" YAML |
||||
" ================================ |
||||
|
||||
if exists("g:ansible_yamlKeyName") |
||||
let s:yamlKey = g:ansible_yamlKeyName |
||||
else |
||||
let s:yamlKey = "yamlBlockMappingKey" |
||||
endif |
||||
|
||||
" Reset some YAML to plain styling |
||||
" the number 80 in Ansible isn't any more important than the word root |
||||
highlight link yamlInteger NONE |
||||
highlight link yamlBool NONE |
||||
highlight link yamlFlowString NONE |
||||
" but it does make sense we visualize quotes easily |
||||
highlight link yamlFlowStringDelimiter Delimiter |
||||
" This is only found in stephypy/vim-yaml, since it's one line it isn't worth |
||||
" making conditional |
||||
highlight link yamlConstant NONE |
||||
|
||||
fun! s:attribute_highlight(attributes) |
||||
if a:attributes =~ 'a' |
||||
syn match ansible_attributes "\v\w+\=" containedin=yamlPlainScalar |
||||
else |
||||
syn match ansible_attributes "\v^\s*\w+\=" containedin=yamlPlainScalar |
||||
endif |
||||
if a:attributes =~ 'n' |
||||
highlight link ansible_attributes NONE |
||||
elseif a:attributes =~ 'd' |
||||
highlight link ansible_attributes Comment |
||||
else |
||||
highlight link ansible_attributes Structure |
||||
endif |
||||
endfun |
||||
|
||||
if exists("g:ansible_attribute_highlight") |
||||
call s:attribute_highlight(g:ansible_attribute_highlight) |
||||
else |
||||
call s:attribute_highlight('ad') |
||||
endif |
||||
|
||||
if exists("g:ansible_name_highlight") |
||||
execute 'syn keyword ansible_name name containedin='.s:yamlKey.' contained' |
||||
if g:ansible_name_highlight =~ 'd' |
||||
highlight link ansible_name Comment |
||||
else |
||||
highlight link ansible_name Underlined |
||||
endif |
||||
endif |
||||
|
||||
execute 'syn keyword ansible_debug_keywords debug containedin='.s:yamlKey.' contained' |
||||
highlight link ansible_debug_keywords Debug |
||||
|
||||
if exists("g:ansible_extra_keywords_highlight") |
||||
execute 'syn keyword ansible_extra_special_keywords register always_run changed_when failed_when no_log args vars delegate_to ignore_errors containedin='.s:yamlKey.' contained' |
||||
highlight link ansible_extra_special_keywords Statement |
||||
endif |
||||
|
||||
execute 'syn keyword ansible_normal_keywords include include_tasks import_tasks until retries delay when only_if become become_user block rescue always notify containedin='.s:yamlKey.' contained' |
||||
if exists("g:ansible_normal_keywords_highlight") |
||||
execute 'highlight link ansible_normal_keywords '.g:ansible_normal_keywords_highlight |
||||
else |
||||
highlight link ansible_normal_keywords Statement |
||||
endif |
||||
|
||||
execute 'syn match ansible_with_keywords "\vwith_.+" containedin='.s:yamlKey.' contained' |
||||
if exists("g:ansible_with_keywords_highlight") |
||||
execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight |
||||
else |
||||
highlight link ansible_with_keywords Statement |
||||
endif |
||||
|
||||
let b:current_syntax = "ansible" |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file |
||||
" Language: Ansible hosts files |
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com> |
||||
" Last Change: 2015.09.23 |
||||
|
||||
if exists("b:current_syntax") |
||||
finish |
||||
endif |
||||
|
||||
syn case ignore |
||||
syn match hostsFirstWord "\v^\S+" |
||||
syn match hostsAttributes "\v\S*\=" |
||||
syn region hostsHeader start="\v^\s*\[" end="\v\]" |
||||
syn keyword hostsHeaderSpecials children vars containedin=hostsHeader contained |
||||
syn match hostsComment "\v^[#;].*$" |
||||
|
||||
highlight link hostsFirstWord Label |
||||
highlight link hostsHeader Define |
||||
highlight link hostsComment Comment |
||||
highlight link hostsHeaderSpecials Identifier |
||||
highlight link hostsAttributes Structure |
||||
|
||||
if exists("g:ansible_attribute_highlight") |
||||
if g:ansible_attribute_highlight =~ 'n' |
||||
highlight link hostsAttributes NONE |
||||
elseif g:ansible_attribute_highlight =~ 'd' |
||||
highlight link hostsAttributes Comment |
||||
endif |
||||
endif |
||||
|
||||
let b:current_syntax = "ansible_hosts" |
@ -0,0 +1,97 @@
@@ -0,0 +1,97 @@
|
||||
" Vim syntax file |
||||
" Language: Jinja2 - with special modifications for compound-filetype |
||||
" compatibility |
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com> |
||||
" Last Change: 2018.02.11 |
||||
|
||||
if !exists("main_syntax") |
||||
let main_syntax = 'jinja2' |
||||
endif |
||||
|
||||
let b:current_syntax = '' |
||||
unlet b:current_syntax |
||||
|
||||
syntax case match |
||||
|
||||
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they |
||||
" have special threatment) |
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import |
||||
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter |
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction |
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName |
||||
|
||||
" Variable Names |
||||
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/ |
||||
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs |
||||
|
||||
" Filters |
||||
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter |
||||
syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/ |
||||
syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/ |
||||
syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/ |
||||
|
||||
" Jinja template constants |
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/ |
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/ |
||||
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/ |
||||
|
||||
" Operators |
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/ |
||||
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/ |
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute |
||||
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/ |
||||
|
||||
" Jinja template tag and variable blocks |
||||
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained |
||||
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained |
||||
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained |
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment |
||||
|
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,yamlComment,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment |
||||
|
||||
" Jinja template 'raw' tag |
||||
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment |
||||
|
||||
" Jinja comments |
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString |
||||
|
||||
" Block start keywords. A bit tricker. We only highlight at the start of a |
||||
" tag block and only if the name is not followed by a comma or equals sign |
||||
" which usually means that we have to deal with an assignment. |
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/ |
||||
|
||||
" and context modifiers |
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/ |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
if !exists("did_jinja_syn_inits") |
||||
command -nargs=+ HiLink hi def link <args> |
||||
|
||||
HiLink jinjaPunctuation jinjaOperator |
||||
HiLink jinjaAttribute jinjaVariable |
||||
HiLink jinjaFunction jinjaFilter |
||||
|
||||
HiLink jinjaTagDelim jinjaTagBlock |
||||
HiLink jinjaVarDelim jinjaVarBlock |
||||
HiLink jinjaCommentDelim jinjaComment |
||||
HiLink jinjaRawDelim jinja |
||||
|
||||
HiLink jinjaSpecial Special |
||||
HiLink jinjaOperator Normal |
||||
HiLink jinjaRaw Normal |
||||
HiLink jinjaTagBlock PreProc |
||||
HiLink jinjaVarBlock PreProc |
||||
HiLink jinjaStatement Statement |
||||
HiLink jinjaFilter Function |
||||
HiLink jinjaBlockName Function |
||||
HiLink jinjaVariable Identifier |
||||
HiLink jinjaString Constant |
||||
HiLink jinjaNumber Constant |
||||
HiLink jinjaComment Comment |
||||
|
||||
delcommand HiLink |
||||
endif |
||||
|
||||
let b:current_syntax = "jinja2" |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details. |
||||
|
||||
Some rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are |
||||
met: |
||||
|
||||
* Redistributions of source code must retain the above copyright |
||||
notice, this list of conditions and the following disclaimer. |
||||
|
||||
* Redistributions in binary form must reproduce the above |
||||
copyright notice, this list of conditions and the following |
||||
disclaimer in the documentation and/or other materials provided |
||||
with the distribution. |
||||
|
||||
* The names of the contributors may not be used to endorse or |
||||
promote products derived from this software without specific |
||||
prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
" {{{1 Documentation |
||||
" Version: $Id: autoloadTemplate.vim,v 1.2 2007/02/06 05:22:55 alanc Exp $ |
||||
" File: autoloadTemplate.vim |
||||
" Maintainer: Alan Che <alan.che@hotmail.com> |
||||
" Last Change:2007/02/06 |
||||
" |
||||
" {{{2 Decription: |
||||
" |
||||
" Load template file from a specific directory according their filetype while |
||||
" starting to edit a new file. if the file does not exist, skip it! |
||||
" |
||||
" |
||||
" {{{2 INSTALL: |
||||
" Here is the way to install this script to your site: |
||||
" 1. extract this file to ~/.vim/plugin |
||||
" 2. create a directory ~/.vim/template |
||||
" 3. create your template files in that directory, where the file name follow |
||||
" th rule: |
||||
" <filetype>.vim |
||||
" where <filetype> is the filetype of this template will apply to, such |
||||
" as: verilog.vim, tcl.vim and so on. |
||||
" |
||||
" |
||||
" {{{1 Source code |
||||
|
||||
|
||||
|
||||
let g:TemplatePath="~/.config/nvim/template" |
||||
|
||||
augroup loadTemplate |
||||
autocmd! |
||||
au FileType * call Template() |
||||
|
||||
function! Template() |
||||
if ! exists("b:IsNewFile") |
||||
return |
||||
endif |
||||
|
||||
if exists("b:Template_loaded") |
||||
return |
||||
endif |
||||
let b:Template_loaded=1 |
||||
|
||||
let b:ThisFileType=expand("<amatch>") |
||||
let b:TemplatePath=g:TemplatePath ."/". b:ThisFileType . ".vim" |
||||
let TemplateFullName = expand(b:TemplatePath) |
||||
|
||||
if filereadable(TemplateFullName) |
||||
let $TemplateFullName=TemplateFullName |
||||
0r $TemplateFullName |
||||
unlet TemplateFullName |
||||
normal G |
||||
endif |
||||
endfunction |
||||
|
||||
augroup END |
||||
|
||||
au BufNewFile * execute "let b:IsNewFile=1" |
||||
au BufNewFile * execute "doau loadTemplate FileType" |
||||
|
||||
|
||||
" vim: set ft=vim foldmethod=marker sw=4 ts=8: |
@ -0,0 +1,988 @@
@@ -0,0 +1,988 @@
|
||||
if !exists("g:calendar_action") |
||||
let g:calendar_action = "calendar#diary" |
||||
endif |
||||
if !exists("g:calendar_sign") |
||||
let g:calendar_sign = "calendar#sign" |
||||
endif |
||||
if !exists("g:calendar_mark") |
||||
\|| (g:calendar_mark != 'left' |
||||
\&& g:calendar_mark != 'left-fit' |
||||
\&& g:calendar_mark != 'right') |
||||
let g:calendar_mark = 'left' |
||||
endif |
||||
if !exists("g:calendar_navi") |
||||
\|| (g:calendar_navi != 'top' |
||||
\&& g:calendar_navi != 'bottom' |
||||
\&& g:calendar_navi != 'both' |
||||
\&& g:calendar_navi != '') |
||||
let g:calendar_navi = 'top' |
||||
endif |
||||
if !exists("g:calendar_navi_label") |
||||
let g:calendar_navi_label = "Prev,Today,Next" |
||||
endif |
||||
if !exists("g:calendar_diary") |
||||
let g:calendar_diary = "~/diary" |
||||
endif |
||||
if !exists("g:calendar_focus_today") |
||||
let g:calendar_focus_today = 0 |
||||
endif |
||||
if !exists("g:calendar_datetime") |
||||
\|| (g:calendar_datetime != '' |
||||
\&& g:calendar_datetime != 'title' |
||||
\&& g:calendar_datetime != 'statusline') |
||||
let g:calendar_datetime = 'title' |
||||
endif |
||||
if !exists("g:calendar_options") |
||||
let g:calendar_options = "fdc=0 nonu" |
||||
if has("+relativenumber") |
||||
let g:calendar_options .= " nornu" |
||||
endif |
||||
endif |
||||
|
||||
"***************************************************************** |
||||
"* Default Calendar key bindings |
||||
"***************************************************************** |
||||
let s:calendar_keys = { |
||||
\ 'close' : 'q', |
||||
\ 'do_action' : '<CR>', |
||||
\ 'goto_today' : 't', |
||||
\ 'show_help' : '?', |
||||
\ 'redisplay' : 'r', |
||||
\ 'goto_next_month' : '<RIGHT>', |
||||
\ 'goto_prev_month' : '<LEFT>', |
||||
\ 'goto_next_year' : '<UP>', |
||||
\ 'goto_prev_year' : '<DOWN>', |
||||
\} |
||||
|
||||
if exists("g:calendar_keys") && type(g:calendar_keys) == 4 |
||||
let s:calendar_keys = extend(s:calendar_keys, g:calendar_keys) |
||||
end |
||||
|
||||
"***************************************************************** |
||||
"* CalendarDoAction : call the action handler function |
||||
"*---------------------------------------------------------------- |
||||
"***************************************************************** |
||||
function! calendar#action(...) |
||||
" for navi |
||||
if exists('g:calendar_navi') |
||||
let navi = (a:0 > 0)? a:1 : expand("<cWORD>") |
||||
let curl = line(".") |
||||
if navi == '<' . get(split(g:calendar_navi_label, ','), 0, '') |
||||
if b:CalendarMonth > 1 |
||||
call calendar#show(b:CalendarDir, b:CalendarYear, b:CalendarMonth-1) |
||||
else |
||||
call calendar#show(b:CalendarDir, b:CalendarYear-1, 12) |
||||
endif |
||||
elseif navi == get(split(g:calendar_navi_label, ','), 2, '') . '>' |
||||
if b:CalendarMonth < 12 |
||||
call calendar#show(b:CalendarDir, b:CalendarYear, b:CalendarMonth+1) |
||||
else |
||||
call calendar#show(b:CalendarDir, b:CalendarYear+1, 1) |
||||
endif |
||||
elseif navi == get(split(g:calendar_navi_label, ','), 1, '') |
||||
call calendar#show(b:CalendarDir) |
||||
if exists('g:calendar_today') |
||||
exe "call " . g:calendar_today . "()" |
||||
endif |
||||
else |
||||
let navi = '' |
||||
endif |
||||
if navi != '' |
||||
if g:calendar_focus_today == 1 && search("\*","w") > 0 |
||||
silent execute "normal! gg/\*\<cr>" |
||||
return |
||||
else |
||||
if curl < line('$')/2 |
||||
silent execute "normal! gg0/".navi."\<cr>" |
||||
else |
||||
silent execute "normal! G$?".navi."\<cr>" |
||||
endif |
||||
return |
||||
endif |
||||
endif |
||||
endif |
||||
|
||||
" if no action defined return |
||||
if !exists("g:calendar_action") || g:calendar_action == "" |
||||
return |
||||
endif |
||||
|
||||
if b:CalendarDir |
||||
let dir = 'H' |
||||
if exists('g:calendar_weeknm') |
||||
let cnr = col('.') - (col('.')%(24+5)) + 1 |
||||
else |
||||
let cnr = col('.') - (col('.')%(24)) + 1 |
||||
endif |
||||
let week = ((col(".") - cnr - 1 + cnr/49) / 3) |
||||
else |
||||
let dir = 'V' |
||||
let cnr = 1 |
||||
let week = ((col(".")+1) / 3) - 1 |
||||
endif |
||||
let lnr = 1 |
||||
let hdr = 1 |
||||
while 1 |
||||
if lnr > line('.') |
||||
break |
||||
endif |
||||
let sline = getline(lnr) |
||||
if sline =~ '^\s*$' |
||||
let hdr = lnr + 1 |
||||
endif |
||||
let lnr = lnr + 1 |
||||
endwhile |
||||
let lnr = line('.') |
||||
if(exists('g:calendar_monday')) |
||||
let week = week + 1 |
||||
elseif(week == 0) |
||||
let week = 7 |
||||
endif |
||||
if lnr-hdr < 2 |
||||
return |
||||
endif |
||||
let sline = substitute(strpart(getline(hdr),cnr,21),'\s*\(.*\)\s*','\1','') |
||||
if (col(".")-cnr) > 21 |
||||
return |
||||
endif |
||||
|
||||
" extract day |
||||
if g:calendar_mark == 'right' && col('.') > 1 |
||||
normal! h |
||||
let day = matchstr(expand("<cword>"), '[^0].*') |
||||
normal! l |
||||
else |
||||
let day = matchstr(expand("<cword>"), '[^0].*') |
||||
endif |
||||
if day == 0 |
||||
return |
||||
endif |
||||
" extract year and month |
||||
if exists('g:calendar_erafmt') && g:calendar_erafmt !~ "^\s*$" |
||||
let year = matchstr(substitute(sline, '/.*', '', ''), '\d\+') |
||||
let month = matchstr(substitute(sline, '.*/\(\d\d\=\).*', '\1', ""), '[^0].*') |
||||
if g:calendar_erafmt =~ '.*,[+-]*\d\+' |
||||
let veranum = substitute(g:calendar_erafmt,'.*,\([+-]*\d\+\)','\1','') |
||||
if year-veranum > 0 |
||||
let year = year-veranum |
||||
endif |
||||
endif |
||||
else |
||||
let year = matchstr(substitute(sline, '/.*', '', ''), '[^0].*') |
||||
let month = matchstr(substitute(sline, '\d*/\(\d\d\=\).*', '\1', ""), '[^0].*') |
||||
endif |
||||
" call the action function |
||||
exe "call " . g:calendar_action . "(day, month, year, week, dir)" |
||||
endfunc |
||||
|
||||
"***************************************************************** |
||||
"* Calendar : build calendar |
||||
"*---------------------------------------------------------------- |
||||
"* a1 : direction |
||||
"* a2 : month(if given a3, it's year) |
||||
"* a3 : if given, it's month |
||||
"***************************************************************** |
||||
function! calendar#show(...) |
||||
|
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
"+++ ready for build |
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
" remember today |
||||
" divide strftime('%d') by 1 so as to get "1,2,3 .. 9" instead of "01, 02, 03 .. 09" |
||||
let vtoday = strftime('%Y').strftime('%m').strftime('%d') |
||||
|
||||
" get arguments |
||||
if a:0 == 0 |
||||
let dir = 0 |
||||
let vyear = strftime('%Y') |
||||
let vmnth = matchstr(strftime('%m'), '[^0].*') |
||||
elseif a:0 == 1 |
||||
let dir = a:1 |
||||
let vyear = strftime('%Y') |
||||
let vmnth = matchstr(strftime('%m'), '[^0].*') |
||||
elseif a:0 == 2 |
||||
let dir = a:1 |
||||
let vyear = strftime('%Y') |
||||
let vmnth = matchstr(a:2, '^[^0].*') |
||||
else |
||||
let dir = a:1 |
||||
let vyear = a:2 |
||||
let vmnth = matchstr(a:3, '^[^0].*') |
||||
endif |
||||
|
||||
" remember constant |
||||
let vmnth_org = vmnth |
||||
let vyear_org = vyear |
||||
|
||||
" start with last month |
||||
let vmnth = vmnth - 1 |
||||
if vmnth < 1 |
||||
let vmnth = 12 |
||||
let vyear = vyear - 1 |
||||
endif |
||||
|
||||
" reset display variables |
||||
let vdisplay1 = '' |
||||
let vheight = 1 |
||||
let vmcnt = 0 |
||||
|
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
"+++ build display |
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
if exists("g:calendar_begin") |
||||
exe "call " . g:calendar_begin . "()" |
||||
endif |
||||
while vmcnt < 3 |
||||
let vcolumn = 22 |
||||
let vnweek = -1 |
||||
"-------------------------------------------------------------- |
||||
"--- calculating |
||||
"-------------------------------------------------------------- |
||||
" set boundary of the month |
||||
if vmnth == 1 |
||||
let vmdays = 31 |
||||
let vparam = 1 |
||||
let vsmnth = 'Jan' |
||||
elseif vmnth == 2 |
||||
let vmdays = 28 |
||||
let vparam = 32 |
||||
let vsmnth = 'Feb' |
||||
elseif vmnth == 3 |
||||
let vmdays = 31 |
||||
let vparam = 60 |
||||
let vsmnth = 'Mar' |
||||
elseif vmnth == 4 |
||||
let vmdays = 30 |
||||
let vparam = 91 |
||||
let vsmnth = 'Apr' |
||||
elseif vmnth == 5 |
||||
let vmdays = 31 |
||||
let vparam = 121 |
||||
let vsmnth = 'May' |
||||
elseif vmnth == 6 |
||||
let vmdays = 30 |
||||
let vparam = 152 |
||||
let vsmnth = 'Jun' |
||||
elseif vmnth == 7 |
||||
let vmdays = 31 |
||||
let vparam = 182 |
||||
let vsmnth = 'Jul' |
||||
elseif vmnth == 8 |
||||
let vmdays = 31 |
||||
let vparam = 213 |
||||
let vsmnth = 'Aug' |
||||
elseif vmnth == 9 |
||||
let vmdays = 30 |
||||
let vparam = 244 |
||||
let vsmnth = 'Sep' |
||||
elseif vmnth == 10 |
||||
let vmdays = 31 |
||||
let vparam = 274 |
||||
let vsmnth = 'Oct' |
||||
elseif vmnth == 11 |
||||
let vmdays = 30 |
||||
let vparam = 305 |
||||
let vsmnth = 'Nov' |
||||
elseif vmnth == 12 |
||||
let vmdays = 31 |
||||
let vparam = 335 |
||||
let vsmnth = 'Dec' |
||||
else |
||||
echo 'Invalid Year or Month' |
||||
return |
||||
endif |
||||
if vyear % 400 == 0 |
||||
if vmnth == 2 |
||||
let vmdays = 29 |
||||
elseif vmnth >= 3 |
||||
let vparam = vparam + 1 |
||||
endif |
||||
elseif vyear % 100 == 0 |
||||
if vmnth == 2 |
||||
let vmdays = 28 |
||||
endif |
||||
elseif vyear % 4 == 0 |
||||
if vmnth == 2 |
||||
let vmdays = 29 |
||||
elseif vmnth >= 3 |
||||
let vparam = vparam + 1 |
||||
endif |
||||
endif |
||||
|
||||
" calc vnweek of the day |
||||
if vnweek == -1 |
||||
let vnweek = ( vyear * 365 ) + vparam |
||||
let vnweek = vnweek + ( vyear/4 ) - ( vyear/100 ) + ( vyear/400 ) |
||||
if vyear % 4 == 0 |
||||
if vyear % 100 != 0 || vyear % 400 == 0 |
||||
let vnweek = vnweek - 1 |
||||
endif |
||||
endif |
||||
let vnweek = vnweek - 1 |
||||
endif |
||||
|
||||
" fix Gregorian |
||||
if vyear <= 1752 |
||||
let vnweek = vnweek - 3 |
||||
endif |
||||
|
||||
let vnweek = vnweek % 7 |
||||
|
||||
if exists('g:calendar_monday') |
||||
" if given g:calendar_monday, the week start with monday |
||||
if vnweek == 0 |
||||
let vnweek = 7 |
||||
endif |
||||
let vnweek = vnweek - 1 |
||||
endif |
||||
|
||||
if exists('g:calendar_weeknm') |
||||
" if given g:calendar_weeknm, show week number(ref:ISO8601) |
||||
|
||||
"vparam <= 1. day of month |
||||
"vnweek <= 1. weekday of month (0-6) |
||||
"viweek <= number of week |
||||
"vfweek <= 1. day of year |
||||
|
||||
" mo di mi do fr sa so |
||||
" 6 5 4 3 2 1 0 vfweek |
||||
" 0 1 2 3 4 5 6 vnweek |
||||
|
||||
let vfweek =((vparam % 7) -vnweek+ 14-2) % 7 |
||||
let viweek = (vparam - vfweek-2+7 ) / 7 +1 |
||||
|
||||
if vfweek < 3 |
||||
let viweek = viweek - 1 |
||||
endif |
||||
|
||||
"vfweekl <=year length |
||||
let vfweekl = 52 |
||||
if (vfweek == 3) |
||||
let vfweekl = 53 |
||||
endif |
||||
|
||||
if viweek == 0 |
||||
let viweek = 52 |
||||
if ((vfweek == 2) && (((vyear-1) % 4) != 0)) |
||||
\ || ((vfweek == 1) && (((vyear-1) % 4) == 0)) |
||||
let viweek = 53 |
||||
endif |
||||
endif |
||||
|
||||
let vcolumn = vcolumn + 5 |
||||
if g:calendar_weeknm == 5 |
||||
let vcolumn = vcolumn - 2 |
||||
endif |
||||
endif |
||||
|
||||
"-------------------------------------------------------------- |
||||
"--- displaying |
||||
"-------------------------------------------------------------- |
||||
" build header |
||||
if exists('g:calendar_erafmt') && g:calendar_erafmt !~ "^\s*$" |
||||
if g:calendar_erafmt =~ '.*,[+-]*\d\+' |
||||
let veranum = substitute(g:calendar_erafmt,'.*,\([+-]*\d\+\)','\1','') |
||||
if vyear+veranum > 0 |
||||
let vdisplay2 = substitute(g:calendar_erafmt,'\(.*\),.*','\1','') |
||||
let vdisplay2 = vdisplay2.(vyear+veranum).'/'.vmnth.'(' |
||||
else |
||||
let vdisplay2 = vyear.'/'.vmnth.'(' |
||||
endif |
||||
else |
||||
let vdisplay2 = vyear.'/'.vmnth.'(' |
||||
endif |
||||
let vdisplay2 = strpart(" ", |
||||
\ 1,(vcolumn-strlen(vdisplay2))/2-2).vdisplay2 |
||||
else |
||||
let vdisplay2 = vyear.'/'.vmnth.'(' |
||||
let vdisplay2 = strpart(" ", |
||||
\ 1,(vcolumn-strlen(vdisplay2))/2-2).vdisplay2 |
||||
endif |
||||
if exists('g:calendar_mruler') && g:calendar_mruler !~ "^\s*$" |
||||
let vdisplay2 = vdisplay2 . get(split(g:calendar_mruler, ','), vmnth-1, '').')'."\n" |
||||
else |
||||
let vdisplay2 = vdisplay2 . vsmnth.')'."\n" |
||||
endif |
||||
let vwruler = "Su Mo Tu We Th Fr Sa" |
||||
if exists('g:calendar_wruler') && g:calendar_wruler !~ "^\s*$" |
||||
let vwruler = g:calendar_wruler |
||||
endif |
||||
if exists('g:calendar_monday') |
||||
let vwruler = strpart(vwruler,stridx(vwruler, ' ') + 1).' '.strpart(vwruler,0,stridx(vwruler, ' ')) |
||||
endif |
||||
let vdisplay2 = vdisplay2.' '.vwruler."\n" |
||||
if g:calendar_mark == 'right' |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
|
||||
" build calendar |
||||
let vinpcur = 0 |
||||
while (vinpcur < vnweek) |
||||
let vdisplay2 = vdisplay2.' ' |
||||
let vinpcur = vinpcur + 1 |
||||
endwhile |
||||
let vdaycur = 1 |
||||
while (vdaycur <= vmdays) |
||||
if vmnth < 10 |
||||
let vtarget = vyear."0".vmnth |
||||
else |
||||
let vtarget = vyear.vmnth |
||||
endif |
||||
if vdaycur < 10 |
||||
let vtarget = vtarget."0".vdaycur |
||||
else |
||||
let vtarget = vtarget.vdaycur |
||||
endif |
||||
if exists("g:calendar_sign") && g:calendar_sign != "" |
||||
exe "let vsign = " . g:calendar_sign . "(vdaycur, vmnth, vyear)" |
||||
if vsign != "" |
||||
let vsign = vsign[0] |
||||
if vsign !~ "[+!#$%&@?]" |
||||
let vsign = "+" |
||||
endif |
||||
endif |
||||
else |
||||
let vsign = '' |
||||
endif |
||||
|
||||
" show mark |
||||
if g:calendar_mark == 'right' |
||||
if vdaycur < 10 |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
let vdisplay2 = vdisplay2.vdaycur |
||||
elseif g:calendar_mark == 'left-fit' |
||||
if vdaycur < 10 |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
endif |
||||
if vtarget == vtoday |
||||
let vdisplay2 = vdisplay2.'*' |
||||
elseif vsign != '' |
||||
let vdisplay2 = vdisplay2.vsign |
||||
else |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
if g:calendar_mark == 'left' |
||||
if vdaycur < 10 |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
let vdisplay2 = vdisplay2.vdaycur |
||||
endif |
||||
if g:calendar_mark == 'left-fit' |
||||
let vdisplay2 = vdisplay2.vdaycur |
||||
endif |
||||
let vdaycur = vdaycur + 1 |
||||
|
||||
" fix Gregorian |
||||
if vyear == 1752 && vmnth == 9 && vdaycur == 3 |
||||
let vdaycur = 14 |
||||
endif |
||||
|
||||
let vinpcur = vinpcur + 1 |
||||
if vinpcur % 7 == 0 |
||||
if exists('g:calendar_weeknm') |
||||
if g:calendar_mark != 'right' |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
" if given g:calendar_weeknm, show week number |
||||
if viweek < 10 |
||||
if g:calendar_weeknm == 1 |
||||
let vdisplay2 = vdisplay2.'WK0'.viweek |
||||
elseif g:calendar_weeknm == 2 |
||||
let vdisplay2 = vdisplay2.'WK '.viweek |
||||
elseif g:calendar_weeknm == 3 |
||||
let vdisplay2 = vdisplay2.'KW0'.viweek |
||||
elseif g:calendar_weeknm == 4 |
||||
let vdisplay2 = vdisplay2.'KW '.viweek |
||||
elseif g:calendar_weeknm == 5 |
||||
let vdisplay2 = vdisplay2.' '.viweek |
||||
endif |
||||
else |
||||
if g:calendar_weeknm <= 2 |
||||
let vdisplay2 = vdisplay2.'WK'.viweek |
||||
elseif g:calendar_weeknm == 3 || g:calendar_weeknm == 4 |
||||
let vdisplay2 = vdisplay2.'KW'.viweek |
||||
elseif g:calendar_weeknm == 5 |
||||
let vdisplay2 = vdisplay2.viweek |
||||
endif |
||||
endif |
||||
let viweek = viweek + 1 |
||||
|
||||
if viweek > vfweekl |
||||
let viweek = 1 |
||||
endif |
||||
|
||||
endif |
||||
let vdisplay2 = vdisplay2."\n" |
||||
if g:calendar_mark == 'right' |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
endif |
||||
endwhile |
||||
|
||||
" if it is needed, fill with space |
||||
if vinpcur % 7 |
||||
while (vinpcur % 7 != 0) |
||||
let vdisplay2 = vdisplay2.' ' |
||||
let vinpcur = vinpcur + 1 |
||||
endwhile |
||||
if exists('g:calendar_weeknm') |
||||
if g:calendar_mark != 'right' |
||||
let vdisplay2 = vdisplay2.' ' |
||||
endif |
||||
if viweek < 10 |
||||
if g:calendar_weeknm == 1 |
||||
let vdisplay2 = vdisplay2.'WK0'.viweek |
||||
elseif g:calendar_weeknm == 2 |
||||
let vdisplay2 = vdisplay2.'WK '.viweek |
||||
elseif g:calendar_weeknm == 3 |
||||
let vdisplay2 = vdisplay2.'KW0'.viweek |
||||
elseif g:calendar_weeknm == 4 |
||||
let vdisplay2 = vdisplay2.'KW '.viweek |
||||
elseif g:calendar_weeknm == 5 |
||||
let vdisplay2 = vdisplay2.' '.viweek |
||||
endif |
||||
else |
||||
if g:calendar_weeknm <= 2 |
||||
let vdisplay2 = vdisplay2.'WK'.viweek |
||||
elseif g:calendar_weeknm == 3 || g:calendar_weeknm == 4 |
||||
let vdisplay2 = vdisplay2.'KW'.viweek |
||||
elseif g:calendar_weeknm == 5 |
||||
let vdisplay2 = vdisplay2.viweek |
||||
endif |
||||
endif |
||||
endif |
||||
endif |
||||
|
||||
" build display |
||||
let vstrline = '' |
||||
if dir |
||||
" for horizontal |
||||
"-------------------------------------------------------------- |
||||
" +---+ +---+ +------+ |
||||
" | | | | | | |
||||
" | 1 | + | 2 | = | 1' | |
||||
" | | | | | | |
||||
" +---+ +---+ +------+ |
||||
"-------------------------------------------------------------- |
||||
let vtokline = 1 |
||||
while 1 |
||||
let vtoken1 = get(split(vdisplay1, "\n"), vtokline-1, '') |
||||
let vtoken2 = get(split(vdisplay2, "\n"), vtokline-1, '') |
||||
if vtoken1 == '' && vtoken2 == '' |
||||
break |
||||
endif |
||||
while strlen(vtoken1) < (vcolumn+1)*vmcnt |
||||
if strlen(vtoken1) % (vcolumn+1) == 0 |
||||
let vtoken1 = vtoken1.'|' |
||||
else |
||||
let vtoken1 = vtoken1.' ' |
||||
endif |
||||
endwhile |
||||
let vstrline = vstrline.vtoken1.'|'.vtoken2.' '."\n" |
||||
let vtokline = vtokline + 1 |
||||
endwhile |
||||
let vdisplay1 = vstrline |
||||
let vheight = vtokline-1 |
||||
else |
||||
" for virtical |
||||
"-------------------------------------------------------------- |
||||
" +---+ +---+ +---+ |
||||
" | 1 | + | 2 | = | | |
||||
" +---+ +---+ | 1'| |
||||
" | | |
||||
" +---+ |
||||
"-------------------------------------------------------------- |
||||
let vtokline = 1 |
||||
while 1 |
||||
let vtoken1 = get(split(vdisplay1, "\n"), vtokline-1, '') |
||||
if vtoken1 == '' |
||||
break |
||||
endif |
||||
let vstrline = vstrline.vtoken1."\n" |
||||
let vtokline = vtokline + 1 |
||||
let vheight = vheight + 1 |
||||
endwhile |
||||
if vstrline != '' |
||||
let vstrline = vstrline.' '."\n" |
||||
let vheight = vheight + 1 |
||||
endif |
||||
let vtokline = 1 |
||||
while 1 |
||||
let vtoken2 = get(split(vdisplay2, "\n"), vtokline-1, '') |
||||
if vtoken2 == '' |
||||
break |
||||
endif |
||||
while strlen(vtoken2) < vcolumn |
||||
let vtoken2 = vtoken2.' ' |
||||
endwhile |
||||
let vstrline = vstrline.vtoken2."\n" |
||||
let vtokline = vtokline + 1 |
||||
let vheight = vtokline + 1 |
||||
endwhile |
||||
let vdisplay1 = vstrline |
||||
endif |
||||
let vmnth = vmnth + 1 |
||||
let vmcnt = vmcnt + 1 |
||||
if vmnth > 12 |
||||
let vmnth = 1 |
||||
let vyear = vyear + 1 |
||||
endif |
||||
endwhile |
||||
if exists("g:calendar_end") |
||||
exe "call " . g:calendar_end . "()" |
||||
endif |
||||
if a:0 == 0 |
||||
return vdisplay1 |
||||
endif |
||||
|
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
"+++ build window |
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
" make window |
||||
let vwinnum = bufnr('__Calendar') |
||||
if getbufvar(vwinnum, 'Calendar') == 'Calendar' |
||||
let vwinnum = bufwinnr(vwinnum) |
||||
else |
||||
let vwinnum = -1 |
||||
endif |
||||
|
||||
if vwinnum >= 0 |
||||
" if already exist |
||||
if vwinnum != bufwinnr('%') |
||||
exe vwinnum . 'wincmd w' |
||||
endif |
||||
setlocal modifiable |
||||
silent %d _ |
||||
else |
||||
" make title |
||||
if g:calendar_datetime == "title" && (!exists('s:bufautocommandsset')) |
||||
auto BufEnter *Calendar let b:sav_titlestring = &titlestring | let &titlestring = '%{strftime("%c")}' |
||||
auto BufLeave *Calendar let &titlestring = b:sav_titlestring |
||||
let s:bufautocommandsset = 1 |
||||
endif |
||||
|
||||
if exists('g:calendar_navi') && dir |
||||
if g:calendar_navi == 'both' |
||||
let vheight = vheight + 4 |
||||
else |
||||
let vheight = vheight + 2 |
||||
endif |
||||
endif |
||||
|
||||
" or not |
||||
if dir |
||||
silent execute 'bo '.vheight.'split __Calendar' |
||||
setlocal winfixheight |
||||
else |
||||
silent execute 'to '.vcolumn.'vsplit __Calendar' |
||||
setlocal winfixwidth |
||||
endif |
||||
call s:CalendarBuildKeymap(dir, vyear, vmnth) |
||||
setlocal noswapfile |
||||
setlocal buftype=nofile |
||||
setlocal bufhidden=delete |
||||
silent! exe "setlocal " . g:calendar_options |
||||
let nontext_columns = &foldcolumn + &nu * &numberwidth |
||||
if has("+relativenumber") |
||||
let nontext_columns += &rnu * &numberwidth |
||||
endif |
||||
" Without this, the 'sidescrolloff' setting may cause the left side of the |
||||
" calendar to disappear if the last inserted element is near the right |
||||
" window border. |
||||
setlocal nowrap |
||||
setlocal norightleft |
||||
setlocal modifiable |
||||
setlocal nolist |
||||
let b:Calendar = 'Calendar' |
||||
setlocal filetype=calendar |
||||
" is this a vertical (0) or a horizontal (1) split? |
||||
exe vcolumn + nontext_columns . "wincmd |" |
||||
endif |
||||
if g:calendar_datetime == "statusline" |
||||
setlocal statusline=%{strftime('%c')} |
||||
endif |
||||
let b:CalendarDir = dir |
||||
let b:CalendarYear = vyear_org |
||||
let b:CalendarMonth = vmnth_org |
||||
|
||||
" navi |
||||
if exists('g:calendar_navi') |
||||
let navi_label = '<' |
||||
\.get(split(g:calendar_navi_label, ','), 0, '').' ' |
||||
\.get(split(g:calendar_navi_label, ','), 1, '').' ' |
||||
\.get(split(g:calendar_navi_label, ','), 2, '').'>' |
||||
if dir |
||||
let navcol = vcolumn + (vcolumn-strlen(navi_label)+2)/2 |
||||
else |
||||
let navcol = (vcolumn-strlen(navi_label)+2)/2 |
||||
endif |
||||
if navcol < 3 |
||||
let navcol = 3 |
||||
endif |
||||
|
||||
if g:calendar_navi == 'top' |
||||
execute "normal gg".navcol."i " |
||||
silent exec "normal! a".navi_label."\<cr>\<cr>" |
||||
silent put! =vdisplay1 |
||||
endif |
||||
if g:calendar_navi == 'bottom' |
||||
silent put! =vdisplay1 |
||||
silent exec "normal! Gi\<cr>" |
||||
execute "normal ".navcol."i " |
||||
silent exec "normal! a".navi_label |
||||
endif |
||||
if g:calendar_navi == 'both' |
||||
execute "normal gg".navcol."i " |
||||
silent exec "normal! a".navi_label."\<cr>\<cr>" |
||||
silent put! =vdisplay1 |
||||
silent exec "normal! Gi\<cr>" |
||||
execute "normal ".navcol."i " |
||||
silent exec "normal! a".navi_label |
||||
endif |
||||
else |
||||
silent put! =vdisplay1 |
||||
endif |
||||
|
||||
setlocal nomodifiable |
||||
" In case we've gotten here from insert mode (via <C-O>:Calendar<CR>)... |
||||
stopinsert |
||||
|
||||
let vyear = vyear_org |
||||
let vmnth = vmnth_org |
||||
|
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
"+++ build highlight |
||||
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
" today |
||||
syn clear |
||||
if g:calendar_mark =~ 'left-fit' |
||||
syn match CalToday display "\s*\*\d*" |
||||
syn match CalMemo display "\s*[+!#$%&@?]\d*" |
||||
elseif g:calendar_mark =~ 'right' |
||||
syn match CalToday display "\d*\*\s*" |
||||
syn match CalMemo display "\d*[+!#$%&@?]\s*" |
||||
else |
||||
syn match CalToday display "\*\s*\d*" |
||||
syn match CalMemo display "[+!#$%&@?]\s*\d*" |
||||
endif |
||||
" header |
||||
syn match CalHeader display "[^ ]*\d\+\/\d\+([^)]*)" |
||||
|
||||
" navi |
||||
if exists('g:calendar_navi') |
||||
exec "silent! syn match CalNavi display \"\\(<" |
||||
\.get(split(g:calendar_navi_label, ','), 0, '')."\\|" |
||||
\.get(split(g:calendar_navi_label, ','), 2, '').">\\)\"" |
||||
exec "silent! syn match CalNavi display \"\\s" |
||||
\.get(split(g:calendar_navi_label, ','), 1, '')."\\s\"hs=s+1,he=e-1" |
||||
endif |
||||
|
||||
" saturday, sunday |
||||
|
||||
if exists('g:calendar_monday') |
||||
if dir |
||||
syn match CalSaturday display /|.\{15}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
syn match CalSunday display /|.\{18}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
else |
||||
syn match CalSaturday display /^.\{15}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
syn match CalSunday display /^.\{18}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
endif |
||||
else |
||||
if dir |
||||
syn match CalSaturday display /|.\{18}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
syn match CalSunday display /|\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
else |
||||
syn match CalSaturday display /^.\{18}\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
syn match CalSunday display /^\s\([0-9\ ]\d\)/hs=e-1 contains=ALL |
||||
endif |
||||
endif |
||||
|
||||
" week number |
||||
if !exists('g:calendar_weeknm') || g:calendar_weeknm <= 2 |
||||
syn match CalWeeknm display "WK[0-9\ ]\d" |
||||
else |
||||
syn match CalWeeknm display "KW[0-9\ ]\d" |
||||
endif |
||||
|
||||
" ruler |
||||
execute 'syn match CalRuler "'.vwruler.'"' |
||||
|
||||
if search("\*","w") > 0 |
||||
silent execute "normal! gg/\*\<cr>" |
||||
endif |
||||
|
||||
return '' |
||||
endfunction |
||||
|
||||
"***************************************************************** |
||||
"* make_dir : make directory |
||||
"*---------------------------------------------------------------- |
||||
"* dir : directory |
||||
"***************************************************************** |
||||
function! s:make_dir(dir) |
||||
if(has("unix")) |
||||
call system("mkdir " . a:dir) |
||||
let rc = v:shell_error |
||||
elseif(has("win16") || has("win32") || has("win95") || |
||||
\has("dos16") || has("dos32") || has("os2")) |
||||
call system("mkdir \"" . a:dir . "\"") |
||||
let rc = v:shell_error |
||||
else |
||||
let rc = 1 |
||||
endif |
||||
if rc != 0 |
||||
call confirm("can't create directory : " . a:dir, "&OK") |
||||
endif |
||||
return rc |
||||
endfunc |
||||
|
||||
"***************************************************************** |
||||
"* diary : calendar hook function |
||||
"*---------------------------------------------------------------- |
||||
"* day : day you actioned |
||||
"* month : month you actioned |
||||
"* year : year you actioned |
||||
"***************************************************************** |
||||
function! calendar#diary(day, month, year, week, dir) |
||||
" build the file name and create directories as needed |
||||
if !isdirectory(expand(g:calendar_diary)) |
||||
call confirm("please create diary directory : ".g:calendar_diary, 'OK') |
||||
return |
||||
endif |
||||
let sfile = expand(g:calendar_diary) . "/" . a:year |
||||
if isdirectory(sfile) == 0 |
||||
if s:make_dir(sfile) != 0 |
||||
return |
||||
endif |
||||
endif |
||||
let sfile = sfile . "/" . a:month |
||||
if isdirectory(sfile) == 0 |
||||
if s:make_dir(sfile) != 0 |
||||
return |
||||
endif |
||||
endif |
||||
let sfile = expand(sfile) . "/" . a:day . ".md" |
||||
let sfile = substitute(sfile, ' ', '\\ ', 'g') |
||||
let vbufnr = bufnr('__Calendar') |
||||
|
||||
" load the file |
||||
exe "wincmd w" |
||||
exe "edit " . sfile |
||||
let dir = getbufvar(vbufnr, "CalendarDir") |
||||
let vyear = getbufvar(vbufnr, "CalendarYear") |
||||
let vmnth = getbufvar(vbufnr, "CalendarMonth") |
||||
exe "auto BufDelete ".escape(sfile, ' \\')." call calendar#show(" . dir . "," . vyear . "," . vmnth . ")" |
||||
endfunc |
||||
|
||||
"***************************************************************** |
||||
"* sign : calendar sign function |
||||
"*---------------------------------------------------------------- |
||||
"* day : day of sign |
||||
"* month : month of sign |
||||
"* year : year of sign |
||||
"***************************************************************** |
||||
function! calendar#sign(day, month, year) |
||||
let sfile = g:calendar_diary."/".a:year."/".a:month."/".a:day.".md" |
||||
return filereadable(expand(sfile)) |
||||
endfunction |
||||
|
||||
"***************************************************************** |
||||
"* CalendarVar : get variable |
||||
"*---------------------------------------------------------------- |
||||
"***************************************************************** |
||||
function! s:CalendarVar(var) |
||||
if !exists(a:var) |
||||
return '' |
||||
endif |
||||
exec 'return ' . a:var |
||||
endfunction |
||||
|
||||
"***************************************************************** |
||||
"* CalendarBuildKeymap : build keymap |
||||
"*---------------------------------------------------------------- |
||||
"***************************************************************** |
||||
function! s:CalendarBuildKeymap(dir, vyear, vmnth) |
||||
" make keymap |
||||
nnoremap <silent> <buffer> <Plug>CalendarDoAction :call calendar#action()<cr> |
||||
nnoremap <silent> <buffer> <Plug>CalendarDoAction :call calendar#action()<cr> |
||||
nnoremap <silent> <buffer> <Plug>CalendarGotoToday :call calendar#show(b:CalendarDir)<cr> |
||||
nnoremap <silent> <buffer> <Plug>CalendarShowHelp :call <SID>CalendarHelp()<cr> |
||||
execute 'nnoremap <silent> <buffer> <Plug>CalendarReDisplay :call calendar#show(' . a:dir . ',' . a:vyear . ',' . a:vmnth . ')<cr>' |
||||
let pnav = get(split(g:calendar_navi_label, ','), 0, '') |
||||
let nnav = get(split(g:calendar_navi_label, ','), 2, '') |
||||
execute 'nnoremap <silent> <buffer> <Plug>CalendarGotoPrevMonth :call calendar#action("<' . pnav . '")<cr>' |
||||
execute 'nnoremap <silent> <buffer> <Plug>CalendarGotoNextMonth :call calendar#action("' . nnav . '>")<cr>' |
||||
execute 'nnoremap <silent> <buffer> <Plug>CalendarGotoPrevYear :call calendar#show('.a:dir.','.(a:vyear-1).','.a:vmnth.')<cr>' |
||||
execute 'nnoremap <silent> <buffer> <Plug>CalendarGotoNextYear :call calendar#show('.a:dir.','.(a:vyear+1).','.a:vmnth.')<cr>' |
||||
|
||||
nmap <buffer> <2-LeftMouse> <Plug>CalendarDoAction |
||||
|
||||
execute 'nmap <buffer> ' . s:calendar_keys['close'] . ' <C-w>c' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['do_action'] . ' <Plug>CalendarDoAction' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['goto_today'] . ' <Plug>CalendarGotoToday' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['show_help'] . ' <Plug>CalendarShowHelp' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['redisplay'] . ' <Plug>CalendarRedisplay' |
||||
|
||||
execute 'nmap <buffer> ' . s:calendar_keys['goto_next_month'] . ' <Plug>CalendarGotoNextMonth' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['goto_prev_month'] . ' <Plug>CalendarGotoPrevMonth' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['goto_next_year'] . ' <Plug>CalendarGotoNextYear' |
||||
execute 'nmap <buffer> ' . s:calendar_keys['goto_prev_year'] . ' <Plug>CalendarGotoPrevYear' |
||||
endfunction |
||||
|
||||
"***************************************************************** |
||||
"* CalendarHelp : show help for Calendar |
||||
"*---------------------------------------------------------------- |
||||
"***************************************************************** |
||||
function! s:CalendarHelp() |
||||
let ck = s:calendar_keys |
||||
let max_width = max(map(values(ck), 'len(v:val)')) |
||||
let offsets = map(copy(ck), '1 + max_width - len(v:val)') |
||||
|
||||
echohl SpecialKey |
||||
echo ck['goto_prev_month'] . repeat(' ', offsets['goto_prev_month']) . ': goto prev month' |
||||
echo ck['goto_next_month'] . repeat(' ', offsets['goto_next_month']) . ': goto next month' |
||||
echo ck['goto_prev_year'] . repeat(' ', offsets['goto_prev_year']) . ': goto prev year' |
||||
echo ck['goto_next_year'] . repeat(' ', offsets['goto_next_year']) . ': goto next year' |
||||
echo ck['goto_today'] . repeat(' ', offsets['goto_today']) . ': goto today' |
||||
echo ck['close'] . repeat(' ', offsets['close']) . ': close window' |
||||
echo ck['redisplay'] . repeat(' ', offsets['redisplay']) . ': re-display window' |
||||
echo ck['show_help'] . repeat(' ', offsets['show_help']) . ': show this help' |
||||
if g:calendar_action == "calendar#diary" |
||||
echo ck['do_action'] . repeat(' ', offsets['do_action']) . ': show diary' |
||||
endif |
||||
echo '' |
||||
echohl Question |
||||
|
||||
let vk = [ |
||||
\ 'calendar_erafmt', |
||||
\ 'calendar_mruler', |
||||
\ 'calendar_wruler', |
||||
\ 'calendar_weeknm', |
||||
\ 'calendar_navi_label', |
||||
\ 'calendar_diary', |
||||
\ 'calendar_mark', |
||||
\ 'calendar_navi', |
||||
\] |
||||
let max_width = max(map(copy(vk), 'len(v:val)')) |
||||
|
||||
for _ in vk |
||||
let v = get(g:, _, '') |
||||
echo _ . repeat(' ', max_width - len(_)) . ' = ' . v |
||||
endfor |
||||
echohl MoreMsg |
||||
echo "[Hit any key]" |
||||
echohl None |
||||
call getchar() |
||||
redraw! |
||||
endfunction |
||||
|
||||
hi def link CalNavi Search |
||||
hi def link CalSaturday Statement |
||||
hi def link CalSunday Type |
||||
hi def link CalRuler StatusLine |
||||
hi def link CalWeeknm Comment |
||||
hi def link CalToday Directory |
||||
hi def link CalHeader Special |
||||
hi def link CalMemo Identifier |
@ -0,0 +1,195 @@
@@ -0,0 +1,195 @@
|
||||
*calendar.txt* Calendar utility for vim |
||||
|
||||
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> |
||||
|
||||
INTRODUCTION *calendar* |
||||
|
||||
This script creates a calendar window in vim. It does not rely on any |
||||
external program, such as cal, etc. |
||||
|
||||
COMMANDS *calendar-commands* |
||||
|
||||
calendar.vim makes the following commands available: |
||||
|
||||
*calendar-:Calendar* |
||||
:Calendar [[year] month] Show calendar at this year and this month in a |
||||
vertical split. When [year] is omitted, the |
||||
calendar will show the given month in the current |
||||
year. When both [year] and [month] are omitted, the |
||||
calendar will show the current month. |
||||
|
||||
*calendar-:CalendarH* |
||||
:CalendarH [[year] month] Show calendar at this year and this month in a |
||||
horizontal split. When [year] is omitted, the |
||||
calendar will show the given month in the current |
||||
year. When both [year] and [month] are omitted, the |
||||
calendar will show the current month. |
||||
|
||||
MAPPINGS *calendar-mappings* |
||||
|
||||
calendar.vim makes the following normal mode mappings available: |
||||
|
||||
*calendar-cal* |
||||
<LocalLeader>cal Brings up the calendar in a vertical split. |
||||
Equivalent to calling |:Calendar|. |
||||
|
||||
*calendar-caL* |
||||
<LocalLeader>caL Brings up the calendar in a horizontal split. |
||||
Equivalent to calling |:CalendarH|. |
||||
|
||||
SETTINGS *calendar-settings* |
||||
|
||||
calendar.vim can be configured using the following settings: |
||||
|
||||
*g:calendar_focus_today* |
||||
Keeps focus when moving to next or previous calendar: > |
||||
let g:calendar_focus_today = 1 |
||||
< |
||||
|
||||
*g:calendar_keys* |
||||
To change the key bindings in the calendar window, add entries to this |
||||
dictionary. Possible keys, the action bound to the keycode given in the |
||||
respective value for this key and the default binding are listed below. |
||||
'close' Closes calendar window. 'q' |
||||
'do_action' Executes |calendar_action|. '<CR>' |
||||
'goto_today' Executes |calendar_today|. 't' |
||||
'show_help' Displays a short help message. '?' |
||||
'redisplay' Redraws calendar window. 'r' |
||||
'goto_next_month' Jumps to the next month. '<Right>' |
||||
'goto_prev_month' Jumps to the previous month. '<Left>' |
||||
'goto_next_year' Jumps to the next month. '<Up>' |
||||
'goto_prev_year' Jumps to the previous month. '<Down>' |
||||
An example in your .vimrc might look like this: > |
||||
let g:calendar_keys = { 'goto_next_month':'<C-Right>, 'goto_prev_month':'<C-Left>'} |
||||
< |
||||
|
||||
*g:calendar_mark* |
||||
Place a '*' or '+' mark after the day. Acceptable values are 'left', |
||||
'left-fit', and 'right': > |
||||
let g:calendar_mark = 'right' |
||||
< |
||||
|
||||
*g:calendar_navi* |
||||
To control the calendar navigator, set this variable. Acceptable values are |
||||
'top', 'bottom', or 'both'. > |
||||
let g:calendar_navi = '' |
||||
< |
||||
|
||||
*g:calendar_navi_label* |
||||
To set the labels for the calendar navigator, for example to change the |
||||
language, use this variable. Entries should be comma separated. > |
||||
let g:calendar_navi_label = 'Prev,Today,Next' |
||||
< |
||||
|
||||
*g:calendar_erafmt* |
||||
To change the dating system, set the following variable. Include the name of |
||||
the dating system and its offset from the Georgian calendar (A.D.). For |
||||
example, to use the current Japanese era (Heisei), you would set: > |
||||
let g:calendar_erafmt = 'Heisei,-1988' |
||||
< |
||||
|
||||
*g:calendar_mruler* |
||||
To change the month names for the calendar headings, set this variable. The |
||||
value is expected to be a comma-separated list of twelve values, starting with |
||||
Janurary: > |
||||
let g:calendar_mruler = 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec' |
||||
< |
||||
|
||||
*g:calendar_wruler* |
||||
To change the week names for the calendar headings, set this variable. The |
||||
value is expected to be a space-separated list of seven values, starting with |
||||
Sunday: > |
||||
let g:calendar_wruler = 'Su Mo Tu We Th Fr Sa' |
||||
< |
||||
|
||||
*g:calendar_monday* |
||||
To make the week start on Monday rather than Sunday, set this variable. Note |
||||
that the value of |g:calendar_wruler| is not affected by this; it should |
||||
always begin with Sunday: > |
||||
let g:calendar_monday = 1 |
||||
< |
||||
|
||||
*g:calendar_weeknm* |
||||
To show the week number, set this variable. There are four valid settings: > |
||||
let g:calendar_weeknm = 1 " WK01 |
||||
let g:calendar_weeknm = 2 " WK 1 |
||||
let g:calendar_weeknm = 3 " KW01 |
||||
let g:calendar_weeknm = 4 " KW 1 |
||||
let g:calendar_weeknm = 5 " 1 |
||||
< |
||||
|
||||
*g:calendar_datetime* |
||||
To control display of the current date and time, set this variable. |
||||
Acceptable values are 'title', 'statusline', and '': > |
||||
let g:calendar_datetime = 'title' |
||||
< |
||||
|
||||
HOOKS *calendar-hooks* |
||||
|
||||
calendar.vim provides a number of hooks which allow you to run custom code on |
||||
certain events. These are documented below. |
||||
|
||||
*calendar_action* |
||||
The function declared in the calendar_action variable is run when the user |
||||
presses enter on a date. Implement and set your function as follows: > |
||||
function MyCalAction(day,month,year,week,dir) |
||||
" day : day you actioned |
||||
" month : month you actioned |
||||
" year : year you actioned |
||||
" week : day of week (Mo=1 ... Su=7) |
||||
" dir : direction of calendar |
||||
endfunction |
||||
let calendar_action = 'MyCalAction' |
||||
< |
||||
|
||||
*calendar_begin* |
||||
The function declared in the calendar_begin variable is run just before the |
||||
calendar is displayed. Implement and set your function as follows: > |
||||
function MyCalActionBegin() |
||||
endfunction |
||||
let calendar_begin = 'MyCalActionBegin' |
||||
< |
||||
|
||||
*calendar_end* |
||||
The function declared in the calendar_end variable is run just after the |
||||
calendar is displayed. Implement and set your function as follows: > |
||||
function MyCalActionEnd() |
||||
endfunction |
||||
let calendar_end = 'MyCalActionEnd' |
||||
< |
||||
|
||||
*calendar_sign* |
||||
The function declared in the calendar_sign variable can be used to set a mark |
||||
next to certain dates. Implement and set your function as follows: > |
||||
function MyCalSign(day,month,year) |
||||
" day : day you actioned |
||||
" month : month you actioned |
||||
" year : year you actioned |
||||
if a:day == 1 && a:month == 1 |
||||
return 1 " happy new year |
||||
else |
||||
return 0 " or not |
||||
endif |
||||
endfunction |
||||
let calendar_sign = 'MyCalSign' |
||||
< |
||||
|
||||
*calendar_today* |
||||
The function declared in the calendar_today variable is run when the user |
||||
presses 'today'. Implement and set your function as follows: > |
||||
function MyCalToday() |
||||
endfunction |
||||
let calendar_today = 'MyCalToday' |
||||
< |
||||
|
||||
ABOUT *calendar-about* |
||||
|
||||
calendar.vim is available on GitHub: |
||||
|
||||
http://github.com/mattn/calendar.vim |
||||
|
||||
and also on VimScripts: |
||||
|
||||
http://www.vim.org/scripts/script.php?script_id=52 |
||||
|
||||
vim:tw=78:et:ft=help:norl: |
@ -0,0 +1,229 @@
@@ -0,0 +1,229 @@
|
||||
"============================================================================= |
||||
" What Is This: Calendar |
||||
" File: calendar.vim |
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> |
||||
" Last Change: 2013 Mar 19 |
||||
" Version: 2.9 |
||||
" Thanks: |
||||
" Tobias Columbus : customizable key bindings |
||||
" Daniel P. Wright : doc/calendar.txt |
||||
" SethMilliken : gave a hint for 2.4 |
||||
" bw1 : bug fix, new weeknm format |
||||
" Ingo Karkat : bug fix |
||||
" Thinca : bug report, bug fix |
||||
" Yu Pei : bug report |
||||
" Per Winkvist : bug fix |
||||
" Serge (gentoosiast) Koksharov : bug fix |
||||
" Vitor Antunes : bug fix |
||||
" Olivier Mengue : bug fix |
||||
" Noel Henson : today action |
||||
" Per Winkvist : bug report |
||||
" Peter Findeisen : bug fix |
||||
" Chip Campbell : gave a hint for 1.3z |
||||
" PAN Shizhu : gave a hint for 1.3y |
||||
" Eric Wald : bug fix |
||||
" Sascha Wuestemann : advise |
||||
" Linas Vasiliauskas : bug report |
||||
" Per Winkvist : bug report |
||||
" Ronald Hoelwarth : gave a hint for 1.3s |
||||
" Vikas Agnihotri : bug report |
||||
" Steve Hall : gave a hint for 1.3q |
||||
" James Devenish : bug fix |
||||
" Carl Mueller : gave a hint for 1.3o |
||||
" Klaus Fabritius : bug fix |
||||
" Stucki : gave a hint for 1.3m |
||||
" Rosta : bug report |
||||
" Richard Bair : bug report |
||||
" Yin Hao Liew : bug report |
||||
" Bill McCarthy : bug fix and gave a hint |
||||
" Srinath Avadhanula : bug fix |
||||
" Ronald Hoellwarth : few advices |
||||
" Juan Orlandini : added higlighting of days with data |
||||
" Ray : bug fix |
||||
" Ralf.Schandl : gave a hint for 1.3 |
||||
" Bhaskar Karambelkar : bug fix |
||||
" Suresh Govindachar : gave a hint for 1.2, bug fix |
||||
" Michael Geddes : bug fix |
||||
" Leif Wickland : bug fix |
||||
" ChangeLog: |
||||
" 2.8 : bug fix |
||||
" 2.7 : vim7ish, customizable key bindings |
||||
" 2.6 : new week number format |
||||
" 2.5 : bug fix, 7.2 don't have relativenumber. |
||||
" 2.4 : added g:calendar_options. |
||||
" 2.3 : week number like ISO8601 |
||||
" g:calendar_monday and g:calendar_weeknm work together |
||||
" 2.2 : http://gist.github.com/355513#file_customizable_keymap.diff |
||||
" http://gist.github.com/355513#file_winfixwidth.diff |
||||
" 2.1 : bug fix, set filetype 'calendar'. |
||||
" 2.0 : bug fix, many bug fix and enhancements. |
||||
" 1.9 : bug fix, use nnoremap. |
||||
" 1.8 : bug fix, E382 when close diary. |
||||
" 1.7 : bug fix, week number was broken on 2008. |
||||
" 1.6 : added calendar_begin action. |
||||
" added calendar_end action. |
||||
" 1.5 : bug fix, fixed ruler formating with strpart. |
||||
" bug fix, using winfixheight. |
||||
" 1.4a : bug fix, week number was broken on 2005. |
||||
" added calendar_today action. |
||||
" bug fix, about wrapscan. |
||||
" bug fix, about today mark. |
||||
" bug fix, about today navigation. |
||||
" 1.4 : bug fix, and one improvement. |
||||
" bug 1: |
||||
" when marking the current date, there is not distinguished e.g. between |
||||
" 20041103 and 20040113, both dates are marked as today |
||||
" bug 2: |
||||
" the navigation mark "today" doesn't work |
||||
" improvement: |
||||
" the mapping t worked only when today was displayed, now it works always |
||||
" and redisplays the cuurent month and today |
||||
" 1.3z : few changes |
||||
" asign <Left>, <Right> for navigation. |
||||
" set ws for search navigation. |
||||
" add tag for GetLatestVimScripts(AutoInstall) |
||||
" 1.3y : bug fix, few changes |
||||
" changed color syntax name. (ex. CalNavi, see bottom of this) |
||||
" changed a map CalendarV for <Leader>cal |
||||
" changed a map CalendarH for <Leader>caL |
||||
" (competitive map for cvscommand.vim) |
||||
" the date on the right-hand side didn't work correctoly. |
||||
" make a map to rebuild Calendar window(r). |
||||
" 1.3x : bug fix |
||||
" viweek can't refer when not set calendar_weeknm. |
||||
" 1.3w : bug fix |
||||
" on leap year, week number decreases. |
||||
" 1.3v : bug fix |
||||
" add nowrapscan |
||||
" use s:bufautocommandsset for making title |
||||
" don't focus to navi when doubleclick bottom next>. |
||||
" 1.3u : bug fix |
||||
" when enter diary first time, |
||||
" it don't warn that you don't have diary directory. |
||||
" 1.3t : bug fix |
||||
" make sure the variables for help |
||||
" 1.3s : bug fix |
||||
" make a map CalendarV for <Leader>ca |
||||
" add option calendar_navi_label |
||||
" see Additional: |
||||
" add option calendar_focus_today |
||||
" see Additional: |
||||
" add map ? for help |
||||
" 1.3r : bug fix |
||||
" if clicked navigator, cursor go to strange position. |
||||
" 1.3q : bug fix |
||||
" coundn't set calendar_navi |
||||
" in its horizontal direction |
||||
" 1.3p : bug fix |
||||
" coundn't edit diary when the calendar is |
||||
" in its horizontal direction |
||||
" 1.3o : add option calendar_mark, and delete calendar_rmark |
||||
" see Additional: |
||||
" add option calendar_navi |
||||
" see Additional: |
||||
" 1.3n : bug fix |
||||
" s:CalendarSign() should use filereadable(expand(sfile)). |
||||
" 1.3m : tuning |
||||
" using topleft or botright for opening Calendar. |
||||
" use filereadable for s:CalendarSign(). |
||||
" 1.3l : bug fix |
||||
" if set calendar_monday, it can see that Sep 1st is Sat |
||||
" as well as Aug 31st. |
||||
" 1.3k : bug fix |
||||
" it didn't escape the file name on calendar. |
||||
" 1.3j : support for fixed Gregorian |
||||
" added the part of Sep 1752. |
||||
" 1.3i : bug fix |
||||
" Calculation mistake for week number. |
||||
" 1.3h : add option for position of displaying '*' or '+'. |
||||
" see Additional: |
||||
" 1.3g : centering header |
||||
" add option for show name of era. |
||||
" see Additional: |
||||
" bug fix |
||||
" <Leader>ca didn't show current month. |
||||
" 1.3f : bug fix |
||||
" there was yet another bug of today's sign. |
||||
" 1.3e : added usage for <Leader> |
||||
" support handler for sign. |
||||
" see Additional: |
||||
" 1.3d : added higlighting of days that have calendar data associated |
||||
" with it. |
||||
" bug fix for calculates date. |
||||
" 1.3c : bug fix for MakeDir() |
||||
" if CalendarMakeDir(sfile) != 0 |
||||
" v |
||||
" if s:CalendarMakeDir(sfile) != 0 |
||||
" 1.3b : bug fix for calendar_monday. |
||||
" it didn't work g:calendar_monday correctly. |
||||
" add g:calendar_version. |
||||
" add argument on action handler. |
||||
" see Additional: |
||||
" 1.3a : bug fix for MakeDir(). |
||||
" it was not able to make directory. |
||||
" 1.3 : support handler for action. |
||||
" see Additional: |
||||
" 1.2g : bug fix for today's sign. |
||||
" it could not display today's sign correctly. |
||||
" 1.2f : bug fix for current Date. |
||||
" vtoday variable calculates date as 'YYYYMMDD' |
||||
" while the loop calculates date as 'YYYYMMD' i.e just 1 digit |
||||
" for date if < 10 so if current date is < 10 , the if condiction |
||||
" to check for current date fails and current date is not |
||||
" highlighted. |
||||
" simple solution changed vtoday calculation line divide the |
||||
" current-date by 1 so as to get 1 digit date. |
||||
" 1.2e : change the way for setting title. |
||||
" auto configuration for g:calendar_wruler with g:calendar_monday |
||||
" 1.2d : add option for show week number. |
||||
" let g:calendar_weeknm = 1 |
||||
" add separator if horizontal. |
||||
" change all option's name |
||||
" g:calendar_mnth -> g:calendar_mruler |
||||
" g:calendar_week -> g:calendar_wruler |
||||
" g:calendar_smnd -> g:calendar_monday |
||||
" 1.2c : add option for that the week starts with monday. |
||||
" let g:calendar_smnd = 1 |
||||
" 1.2b : bug fix for modifiable. |
||||
" setlocal nomodifiable (was set) |
||||
" 1.2a : add default options. |
||||
" nonumber,foldcolumn=0,nowrap... as making gap |
||||
" 1.2 : support wide display. |
||||
" add a command CalendarH |
||||
" add map <s-left> <s-right> |
||||
" 1.1c : extra. |
||||
" add a titlestring for today. |
||||
" 1.1b : bug fix by Michael Geddes. |
||||
" it happend when do ':Calender' twice |
||||
" 1.1a : fix misspell. |
||||
" Calender -> Calendar |
||||
" 1.1 : bug fix. |
||||
" it"s about strftime("%m") |
||||
" 1.0a : bug fix by Leif Wickland. |
||||
" it"s about strftime("%w") |
||||
" 1.0 : first release. |
||||
" TODO: |
||||
" add the option for diary which is separate or single file. |
||||
" GetLatestVimScripts: 52 1 :AutoInstall: calendar.vim |
||||
|
||||
if &compatible |
||||
finish |
||||
endif |
||||
"***************************************************************** |
||||
"* Calendar commands |
||||
"***************************************************************** |
||||
command! -nargs=* Calendar call calendar#show(0,<f-args>) |
||||
command! -nargs=* CalendarH call calendar#show(1,<f-args>) |
||||
|
||||
if !get(g:, 'calendar_no_mappings', 0) |
||||
if !hasmapto('<Plug>CalendarV') |
||||
nmap <unique> <Leader>cal <Plug>CalendarV |
||||
endif |
||||
if !hasmapto('<Plug>CalendarH') |
||||
nmap <unique> <Leader>caL <Plug>CalendarH |
||||
endif |
||||
endif |
||||
nnoremap <silent> <Plug>CalendarV :cal calendar#show(0)<CR> |
||||
nnoremap <silent> <Plug>CalendarH :cal calendar#show(1)<CR> |
||||
|
||||
" vi: et sw=2 ts=2 |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
|
||||
" Calendar"{{{ |
||||
let g:calendar_navi_label = 'Пред,Тек,След' |
||||
let g:calendar_mruler = 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь' |
||||
\.',Октябрь,Ноябрь,Декабрь' |
||||
let g:calendar_wruler = 'Вс Пн Вт Ср Чт Пт Сб' |
||||
let g:calendar_monday = 1 |
||||
"}}} |
||||
|
@ -0,0 +1,674 @@
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE |
||||
Version 3, 29 June 2007 |
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> |
||||
Everyone is permitted to copy and distribute verbatim copies |
||||
of this license document, but changing it is not allowed. |
||||
|
||||
Preamble |
||||
|
||||
The GNU General Public License is a free, copyleft license for |
||||
software and other kinds of works. |
||||
|
||||
The licenses for most software and other practical works are designed |
||||
to take away your freedom to share and change the works. By contrast, |
||||
the GNU General Public License is intended to guarantee your freedom to |
||||
share and change all versions of a program--to make sure it remains free |
||||
software for all its users. We, the Free Software Foundation, use the |
||||
GNU General Public License for most of our software; it applies also to |
||||
any other work released this way by its authors. You can apply it to |
||||
your programs, too. |
||||
|
||||
When we speak of free software, we are referring to freedom, not |
||||
price. Our General Public Licenses are designed to make sure that you |
||||
have the freedom to distribute copies of free software (and charge for |
||||
them if you wish), that you receive source code or can get it if you |
||||
want it, that you can change the software or use pieces of it in new |
||||
free programs, and that you know you can do these things. |
||||
|
||||
To protect your rights, we need to prevent others from denying you |
||||
these rights or asking you to surrender the rights. Therefore, you have |
||||
certain responsibilities if you distribute copies of the software, or if |
||||
you modify it: responsibilities to respect the freedom of others. |
||||
|
||||
For example, if you distribute copies of such a program, whether |
||||
gratis or for a fee, you must pass on to the recipients the same |
||||
freedoms that you received. You must make sure that they, too, receive |
||||
or can get the source code. And you must show them these terms so they |
||||
know their rights. |
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: |
||||
(1) assert copyright on the software, and (2) offer you this License |
||||
giving you legal permission to copy, distribute and/or modify it. |
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains |
||||
that there is no warranty for this free software. For both users' and |
||||
authors' sake, the GPL requires that modified versions be marked as |
||||
changed, so that their problems will not be attributed erroneously to |
||||
authors of previous versions. |
||||
|
||||
Some devices are designed to deny users access to install or run |
||||
modified versions of the software inside them, although the manufacturer |
||||
can do so. This is fundamentally incompatible with the aim of |
||||
protecting users' freedom to change the software. The systematic |
||||
pattern of such abuse occurs in the area of products for individuals to |
||||
use, which is precisely where it is most unacceptable. Therefore, we |
||||
have designed this version of the GPL to prohibit the practice for those |
||||
products. If such problems arise substantially in other domains, we |
||||
stand ready to extend this provision to those domains in future versions |
||||
of the GPL, as needed to protect the freedom of users. |
||||
|
||||
Finally, every program is threatened constantly by software patents. |
||||
States should not allow patents to restrict development and use of |
||||
software on general-purpose computers, but in those that do, we wish to |
||||
avoid the special danger that patents applied to a free program could |
||||
make it effectively proprietary. To prevent this, the GPL assures that |
||||
patents cannot be used to render the program non-free. |
||||
|
||||
The precise terms and conditions for copying, distribution and |
||||
modification follow. |
||||
|
||||
TERMS AND CONDITIONS |
||||
|
||||
0. Definitions. |
||||
|
||||
"This License" refers to version 3 of the GNU General Public License. |
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of |
||||
works, such as semiconductor masks. |
||||
|
||||
"The Program" refers to any copyrightable work licensed under this |
||||
License. Each licensee is addressed as "you". "Licensees" and |
||||
"recipients" may be individuals or organizations. |
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work |
||||
in a fashion requiring copyright permission, other than the making of an |
||||
exact copy. The resulting work is called a "modified version" of the |
||||
earlier work or a work "based on" the earlier work. |
||||
|
||||
A "covered work" means either the unmodified Program or a work based |
||||
on the Program. |
||||
|
||||
To "propagate" a work means to do anything with it that, without |
||||
permission, would make you directly or secondarily liable for |
||||
infringement under applicable copyright law, except executing it on a |
||||
computer or modifying a private copy. Propagation includes copying, |
||||
distribution (with or without modification), making available to the |
||||
public, and in some countries other activities as well. |
||||
|
||||
To "convey" a work means any kind of propagation that enables other |
||||
parties to make or receive copies. Mere interaction with a user through |
||||
a computer network, with no transfer of a copy, is not conveying. |
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" |
||||
to the extent that it includes a convenient and prominently visible |
||||
feature that (1) displays an appropriate copyright notice, and (2) |
||||
tells the user that there is no warranty for the work (except to the |
||||
extent that warranties are provided), that licensees may convey the |
||||
work under this License, and how to view a copy of this License. If |
||||
the interface presents a list of user commands or options, such as a |
||||
menu, a prominent item in the list meets this criterion. |
||||
|
||||
1. Source Code. |
||||
|
||||
The "source code" for a work means the preferred form of the work |
||||
for making modifications to it. "Object code" means any non-source |
||||
form of a work. |
||||
|
||||
A "Standard Interface" means an interface that either is an official |
||||
standard defined by a recognized standards body, or, in the case of |
||||
interfaces specified for a particular programming language, one that |
||||
is widely used among developers working in that language. |
||||
|
||||
The "System Libraries" of an executable work include anything, other |
||||
than the work as a whole, that (a) is included in the normal form of |
||||
packaging a Major Component, but which is not part of that Major |
||||
Component, and (b) serves only to enable use of the work with that |
||||
Major Component, or to implement a Standard Interface for which an |
||||
implementation is available to the public in source code form. A |
||||
"Major Component", in this context, means a major essential component |
||||
(kernel, window system, and so on) of the specific operating system |
||||
(if any) on which the executable work runs, or a compiler used to |
||||
produce the work, or an object code interpreter used to run it. |
||||
|
||||
The "Corresponding Source" for a work in object code form means all |
||||
the source code needed to generate, install, and (for an executable |
||||
work) run the object code and to modify the work, including scripts to |
||||
control those activities. However, it does not include the work's |
||||
System Libraries, or general-purpose tools or generally available free |
||||
programs which are used unmodified in performing those activities but |
||||
which are not part of the work. For example, Corresponding Source |
||||
includes interface definition files associated with source files for |
||||
the work, and the source code for shared libraries and dynamically |
||||
linked subprograms that the work is specifically designed to require, |
||||
such as by intimate data communication or control flow between those |
||||
subprograms and other parts of the work. |
||||
|
||||
The Corresponding Source need not include anything that users |
||||
can regenerate automatically from other parts of the Corresponding |
||||
Source. |
||||
|
||||
The Corresponding Source for a work in source code form is that |
||||
same work. |
||||
|
||||
2. Basic Permissions. |
||||
|
||||
All rights granted under this License are granted for the term of |
||||
copyright on the Program, and are irrevocable provided the stated |
||||
conditions are met. This License explicitly affirms your unlimited |
||||
permission to run the unmodified Program. The output from running a |
||||
covered work is covered by this License only if the output, given its |
||||
content, constitutes a covered work. This License acknowledges your |
||||
rights of fair use or other equivalent, as provided by copyright law. |
||||
|
||||
You may make, run and propagate covered works that you do not |
||||
convey, without conditions so long as your license otherwise remains |
||||
in force. You may convey covered works to others for the sole purpose |
||||
of having them make modifications exclusively for you, or provide you |
||||
with facilities for running those works, provided that you comply with |
||||
the terms of this License in conveying all material for which you do |
||||
not control copyright. Those thus making or running the covered works |
||||
for you must do so exclusively on your behalf, under your direction |
||||
and control, on terms that prohibit them from making any copies of |
||||
your copyrighted material outside their relationship with you. |
||||
|
||||
Conveying under any other circumstances is permitted solely under |
||||
the conditions stated below. Sublicensing is not allowed; section 10 |
||||
makes it unnecessary. |
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
||||
|
||||
No covered work shall be deemed part of an effective technological |
||||
measure under any applicable law fulfilling obligations under article |
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
||||
similar laws prohibiting or restricting circumvention of such |
||||
measures. |
||||
|
||||
When you convey a covered work, you waive any legal power to forbid |
||||
circumvention of technological measures to the extent such circumvention |
||||
is effected by exercising rights under this License with respect to |
||||
the covered work, and you disclaim any intention to limit operation or |
||||
modification of the work as a means of enforcing, against the work's |
||||
users, your or third parties' legal rights to forbid circumvention of |
||||
technological measures. |
||||
|
||||
4. Conveying Verbatim Copies. |
||||
|
||||
You may convey verbatim copies of the Program's source code as you |
||||
receive it, in any medium, provided that you conspicuously and |
||||
appropriately publish on each copy an appropriate copyright notice; |
||||
keep intact all notices stating that this License and any |
||||
non-permissive terms added in accord with section 7 apply to the code; |
||||
keep intact all notices of the absence of any warranty; and give all |
||||
recipients a copy of this License along with the Program. |
||||
|
||||
You may charge any price or no price for each copy that you convey, |
||||
and you may offer support or warranty protection for a fee. |
||||
|
||||
5. Conveying Modified Source Versions. |
||||
|
||||
You may convey a work based on the Program, or the modifications to |
||||
produce it from the Program, in the form of source code under the |
||||
terms of section 4, provided that you also meet all of these conditions: |
||||
|
||||
a) The work must carry prominent notices stating that you modified |
||||
it, and giving a relevant date. |
||||
|
||||
b) The work must carry prominent notices stating that it is |
||||
released under this License and any conditions added under section |
||||
7. This requirement modifies the requirement in section 4 to |
||||
"keep intact all notices". |
||||
|
||||
c) You must license the entire work, as a whole, under this |
||||
License to anyone who comes into possession of a copy. This |
||||
License will therefore apply, along with any applicable section 7 |
||||
additional terms, to the whole of the work, and all its parts, |
||||
regardless of how they are packaged. This License gives no |
||||
permission to license the work in any other way, but it does not |
||||
invalidate such permission if you have separately received it. |
||||
|
||||
d) If the work has interactive user interfaces, each must display |
||||
Appropriate Legal Notices; however, if the Program has interactive |
||||
interfaces that do not display Appropriate Legal Notices, your |
||||
work need not make them do so. |
||||
|
||||
A compilation of a covered work with other separate and independent |
||||
works, which are not by their nature extensions of the covered work, |
||||
and which are not combined with it such as to form a larger program, |
||||
in or on a volume of a storage or distribution medium, is called an |
||||
"aggregate" if the compilation and its resulting copyright are not |
||||
used to limit the access or legal rights of the compilation's users |
||||
beyond what the individual works permit. Inclusion of a covered work |
||||
in an aggregate does not cause this License to apply to the other |
||||
parts of the aggregate. |
||||
|
||||
6. Conveying Non-Source Forms. |
||||
|
||||
You may convey a covered work in object code form under the terms |
||||
of sections 4 and 5, provided that you also convey the |
||||
machine-readable Corresponding Source under the terms of this License, |
||||
in one of these ways: |
||||
|
||||
a) Convey the object code in, or embodied in, a physical product |
||||
(including a physical distribution medium), accompanied by the |
||||
Corresponding Source fixed on a durable physical medium |
||||
customarily used for software interchange. |
||||
|
||||
b) Convey the object code in, or embodied in, a physical product |
||||
(including a physical distribution medium), accompanied by a |
||||
written offer, valid for at least three years and valid for as |
||||
long as you offer spare parts or customer support for that product |
||||
model, to give anyone who possesses the object code either (1) a |
||||
copy of the Corresponding Source for all the software in the |
||||
product that is covered by this License, on a durable physical |
||||
medium customarily used for software interchange, for a price no |
||||
more than your reasonable cost of physically performing this |
||||
conveying of source, or (2) access to copy the |
||||
Corresponding Source from a network server at no charge. |
||||
|
||||
c) Convey individual copies of the object code with a copy of the |
||||
written offer to provide the Corresponding Source. This |
||||
alternative is allowed only occasionally and noncommercially, and |
||||
only if you received the object code with such an offer, in accord |
||||
with subsection 6b. |
||||
|
||||
d) Convey the object code by offering access from a designated |
||||
place (gratis or for a charge), and offer equivalent access to the |
||||
Corresponding Source in the same way through the same place at no |
||||
further charge. You need not require recipients to copy the |
||||
Corresponding Source along with the object code. If the place to |
||||
copy the object code is a network server, the Corresponding Source |
||||
may be on a different server (operated by you or a third party) |
||||
that supports equivalent copying facilities, provided you maintain |
||||
clear directions next to the object code saying where to find the |
||||
Corresponding Source. Regardless of what server hosts the |
||||
Corresponding Source, you remain obligated to ensure that it is |
||||
available for as long as needed to satisfy these requirements. |
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided |
||||
you inform other peers where the object code and Corresponding |
||||
Source of the work are being offered to the general public at no |
||||
charge under subsection 6d. |
||||
|
||||
A separable portion of the object code, whose source code is excluded |
||||
from the Corresponding Source as a System Library, need not be |
||||
included in conveying the object code work. |
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any |
||||
tangible personal property which is normally used for personal, family, |
||||
or household purposes, or (2) anything designed or sold for incorporation |
||||
into a dwelling. In determining whether a product is a consumer product, |
||||
doubtful cases shall be resolved in favor of coverage. For a particular |
||||
product received by a particular user, "normally used" refers to a |
||||
typical or common use of that class of product, regardless of the status |
||||
of the particular user or of the way in which the particular user |
||||
actually uses, or expects or is expected to use, the product. A product |
||||
is a consumer product regardless of whether the product has substantial |
||||
commercial, industrial or non-consumer uses, unless such uses represent |
||||
the only significant mode of use of the product. |
||||
|
||||
"Installation Information" for a User Product means any methods, |
||||
procedures, authorization keys, or other information required to install |
||||
and execute modified versions of a covered work in that User Product from |
||||
a modified version of its Corresponding Source. The information must |
||||
suffice to ensure that the continued functioning of the modified object |
||||
code is in no case prevented or interfered with solely because |
||||
modification has been made. |
||||
|
||||
If you convey an object code work under this section in, or with, or |
||||
specifically for use in, a User Product, and the conveying occurs as |
||||
part of a transaction in which the right of possession and use of the |
||||
User Product is transferred to the recipient in perpetuity or for a |
||||
fixed term (regardless of how the transaction is characterized), the |
||||
Corresponding Source conveyed under this section must be accompanied |
||||
by the Installation Information. But this requirement does not apply |
||||
if neither you nor any third party retains the ability to install |
||||
modified object code on the User Product (for example, the work has |
||||
been installed in ROM). |
||||
|
||||
The requirement to provide Installation Information does not include a |
||||
requirement to continue to provide support service, warranty, or updates |
||||
for a work that has been modified or installed by the recipient, or for |
||||
the User Product in which it has been modified or installed. Access to a |
||||
network may be denied when the modification itself materially and |
||||
adversely affects the operation of the network or violates the rules and |
||||
protocols for communication across the network. |
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, |
||||
in accord with this section must be in a format that is publicly |
||||
documented (and with an implementation available to the public in |
||||
source code form), and must require no special password or key for |
||||
unpacking, reading or copying. |
||||
|
||||
7. Additional Terms. |
||||
|
||||
"Additional permissions" are terms that supplement the terms of this |
||||
License by making exceptions from one or more of its conditions. |
||||
Additional permissions that are applicable to the entire Program shall |
||||
be treated as though they were included in this License, to the extent |
||||
that they are valid under applicable law. If additional permissions |
||||
apply only to part of the Program, that part may be used separately |
||||
under those permissions, but the entire Program remains governed by |
||||
this License without regard to the additional permissions. |
||||
|
||||
When you convey a copy of a covered work, you may at your option |
||||
remove any additional permissions from that copy, or from any part of |
||||
it. (Additional permissions may be written to require their own |
||||
removal in certain cases when you modify the work.) You may place |
||||
additional permissions on material, added by you to a covered work, |
||||
for which you have or can give appropriate copyright permission. |
||||
|
||||
Notwithstanding any other provision of this License, for material you |
||||
add to a covered work, you may (if authorized by the copyright holders of |
||||
that material) supplement the terms of this License with terms: |
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the |
||||
terms of sections 15 and 16 of this License; or |
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or |
||||
author attributions in that material or in the Appropriate Legal |
||||
Notices displayed by works containing it; or |
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or |
||||
requiring that modified versions of such material be marked in |
||||
reasonable ways as different from the original version; or |
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or |
||||
authors of the material; or |
||||
|
||||
e) Declining to grant rights under trademark law for use of some |
||||
trade names, trademarks, or service marks; or |
||||
|
||||
f) Requiring indemnification of licensors and authors of that |
||||
material by anyone who conveys the material (or modified versions of |
||||
it) with contractual assumptions of liability to the recipient, for |
||||
any liability that these contractual assumptions directly impose on |
||||
those licensors and authors. |
||||
|
||||
All other non-permissive additional terms are considered "further |
||||
restrictions" within the meaning of section 10. If the Program as you |
||||
received it, or any part of it, contains a notice stating that it is |
||||
governed by this License along with a term that is a further |
||||
restriction, you may remove that term. If a license document contains |
||||
a further restriction but permits relicensing or conveying under this |
||||
License, you may add to a covered work material governed by the terms |
||||
of that license document, provided that the further restriction does |
||||
not survive such relicensing or conveying. |
||||
|
||||
If you add terms to a covered work in accord with this section, you |
||||
must place, in the relevant source files, a statement of the |
||||
additional terms that apply to those files, or a notice indicating |
||||
where to find the applicable terms. |
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the |
||||
form of a separately written license, or stated as exceptions; |
||||
the above requirements apply either way. |
||||
|
||||
8. Termination. |
||||
|
||||
You may not propagate or modify a covered work except as expressly |
||||
provided under this License. Any attempt otherwise to propagate or |
||||
modify it is void, and will automatically terminate your rights under |
||||
this License (including any patent licenses granted under the third |
||||
paragraph of section 11). |
||||
|
||||
However, if you cease all violation of this License, then your |
||||
license from a particular copyright holder is reinstated (a) |
||||
provisionally, unless and until the copyright holder explicitly and |
||||
finally terminates your license, and (b) permanently, if the copyright |
||||
holder fails to notify you of the violation by some reasonable means |
||||
prior to 60 days after the cessation. |
||||
|
||||
Moreover, your license from a particular copyright holder is |
||||
reinstated permanently if the copyright holder notifies you of the |
||||
violation by some reasonable means, this is the first time you have |
||||
received notice of violation of this License (for any work) from that |
||||
copyright holder, and you cure the violation prior to 30 days after |
||||
your receipt of the notice. |
||||
|
||||
Termination of your rights under this section does not terminate the |
||||
licenses of parties who have received copies or rights from you under |
||||
this License. If your rights have been terminated and not permanently |
||||
reinstated, you do not qualify to receive new licenses for the same |
||||
material under section 10. |
||||
|
||||
9. Acceptance Not Required for Having Copies. |
||||
|
||||
You are not required to accept this License in order to receive or |
||||
run a copy of the Program. Ancillary propagation of a covered work |
||||
occurring solely as a consequence of using peer-to-peer transmission |
||||
to receive a copy likewise does not require acceptance. However, |
||||
nothing other than this License grants you permission to propagate or |
||||
modify any covered work. These actions infringe copyright if you do |
||||
not accept this License. Therefore, by modifying or propagating a |
||||
covered work, you indicate your acceptance of this License to do so. |
||||
|
||||
10. Automatic Licensing of Downstream Recipients. |
||||
|
||||
Each time you convey a covered work, the recipient automatically |
||||
receives a license from the original licensors, to run, modify and |
||||
propagate that work, subject to this License. You are not responsible |
||||
for enforcing compliance by third parties with this License. |
||||
|
||||
An "entity transaction" is a transaction transferring control of an |
||||
organization, or substantially all assets of one, or subdividing an |
||||
organization, or merging organizations. If propagation of a covered |
||||
work results from an entity transaction, each party to that |
||||
transaction who receives a copy of the work also receives whatever |
||||
licenses to the work the party's predecessor in interest had or could |
||||
give under the previous paragraph, plus a right to possession of the |
||||
Corresponding Source of the work from the predecessor in interest, if |
||||
the predecessor has it or can get it with reasonable efforts. |
||||
|
||||
You may not impose any further restrictions on the exercise of the |
||||
rights granted or affirmed under this License. For example, you may |
||||
not impose a license fee, royalty, or other charge for exercise of |
||||
rights granted under this License, and you may not initiate litigation |
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that |
||||
any patent claim is infringed by making, using, selling, offering for |
||||
sale, or importing the Program or any portion of it. |
||||
|
||||
11. Patents. |
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this |
||||
License of the Program or a work on which the Program is based. The |
||||
work thus licensed is called the contributor's "contributor version". |
||||
|
||||
A contributor's "essential patent claims" are all patent claims |
||||
owned or controlled by the contributor, whether already acquired or |
||||
hereafter acquired, that would be infringed by some manner, permitted |
||||
by this License, of making, using, or selling its contributor version, |
||||
but do not include claims that would be infringed only as a |
||||
consequence of further modification of the contributor version. For |
||||
purposes of this definition, "control" includes the right to grant |
||||
patent sublicenses in a manner consistent with the requirements of |
||||
this License. |
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free |
||||
patent license under the contributor's essential patent claims, to |
||||
make, use, sell, offer for sale, import and otherwise run, modify and |
||||
propagate the contents of its contributor version. |
||||
|
||||
In the following three paragraphs, a "patent license" is any express |
||||
agreement or commitment, however denominated, not to enforce a patent |
||||
(such as an express permission to practice a patent or covenant not to |
||||
sue for patent infringement). To "grant" such a patent license to a |
||||
party means to make such an agreement or commitment not to enforce a |
||||
patent against the party. |
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, |
||||
and the Corresponding Source of the work is not available for anyone |
||||
to copy, free of charge and under the terms of this License, through a |
||||
publicly available network server or other readily accessible means, |
||||
then you must either (1) cause the Corresponding Source to be so |
||||
available, or (2) arrange to deprive yourself of the benefit of the |
||||
patent license for this particular work, or (3) arrange, in a manner |
||||
consistent with the requirements of this License, to extend the patent |
||||
license to downstream recipients. "Knowingly relying" means you have |
||||
actual knowledge that, but for the patent license, your conveying the |
||||
covered work in a country, or your recipient's use of the covered work |
||||
in a country, would infringe one or more identifiable patents in that |
||||
country that you have reason to believe are valid. |
||||
|
||||
If, pursuant to or in connection with a single transaction or |
||||
arrangement, you convey, or propagate by procuring conveyance of, a |
||||
covered work, and grant a patent license to some of the parties |
||||
receiving the covered work authorizing them to use, propagate, modify |
||||
or convey a specific copy of the covered work, then the patent license |
||||
you grant is automatically extended to all recipients of the covered |
||||
work and works based on it. |
||||
|
||||
A patent license is "discriminatory" if it does not include within |
||||
the scope of its coverage, prohibits the exercise of, or is |
||||
conditioned on the non-exercise of one or more of the rights that are |
||||
specifically granted under this License. You may not convey a covered |
||||
work if you are a party to an arrangement with a third party that is |
||||
in the business of distributing software, under which you make payment |
||||
to the third party based on the extent of your activity of conveying |
||||
the work, and under which the third party grants, to any of the |
||||
parties who would receive the covered work from you, a discriminatory |
||||
patent license (a) in connection with copies of the covered work |
||||
conveyed by you (or copies made from those copies), or (b) primarily |
||||
for and in connection with specific products or compilations that |
||||
contain the covered work, unless you entered into that arrangement, |
||||
or that patent license was granted, prior to 28 March 2007. |
||||
|
||||
Nothing in this License shall be construed as excluding or limiting |
||||
any implied license or other defenses to infringement that may |
||||
otherwise be available to you under applicable patent law. |
||||
|
||||
12. No Surrender of Others' Freedom. |
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or |
||||
otherwise) that contradict the conditions of this License, they do not |
||||
excuse you from the conditions of this License. If you cannot convey a |
||||
covered work so as to satisfy simultaneously your obligations under this |
||||
License and any other pertinent obligations, then as a consequence you may |
||||
not convey it at all. For example, if you agree to terms that obligate you |
||||
to collect a royalty for further conveying from those to whom you convey |
||||
the Program, the only way you could satisfy both those terms and this |
||||
License would be to refrain entirely from conveying the Program. |
||||
|
||||
13. Use with the GNU Affero General Public License. |
||||
|
||||
Notwithstanding any other provision of this License, you have |
||||
permission to link or combine any covered work with a work licensed |
||||
under version 3 of the GNU Affero General Public License into a single |
||||
combined work, and to convey the resulting work. The terms of this |
||||
License will continue to apply to the part which is the covered work, |
||||
but the special requirements of the GNU Affero General Public License, |
||||
section 13, concerning interaction through a network will apply to the |
||||
combination as such. |
||||
|
||||
14. Revised Versions of this License. |
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of |
||||
the GNU General Public License from time to time. Such new versions will |
||||
be similar in spirit to the present version, but may differ in detail to |
||||
address new problems or concerns. |
||||
|
||||
Each version is given a distinguishing version number. If the |
||||
Program specifies that a certain numbered version of the GNU General |
||||
Public License "or any later version" applies to it, you have the |
||||
option of following the terms and conditions either of that numbered |
||||
version or of any later version published by the Free Software |
||||
Foundation. If the Program does not specify a version number of the |
||||
GNU General Public License, you may choose any version ever published |
||||
by the Free Software Foundation. |
||||
|
||||
If the Program specifies that a proxy can decide which future |
||||
versions of the GNU General Public License can be used, that proxy's |
||||
public statement of acceptance of a version permanently authorizes you |
||||
to choose that version for the Program. |
||||
|
||||
Later license versions may give you additional or different |
||||
permissions. However, no additional obligations are imposed on any |
||||
author or copyright holder as a result of your choosing to follow a |
||||
later version. |
||||
|
||||
15. Disclaimer of Warranty. |
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
||||
|
||||
16. Limitation of Liability. |
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
||||
SUCH DAMAGES. |
||||
|
||||
17. Interpretation of Sections 15 and 16. |
||||
|
||||
If the disclaimer of warranty and limitation of liability provided |
||||
above cannot be given local legal effect according to their terms, |
||||
reviewing courts shall apply local law that most closely approximates |
||||
an absolute waiver of all civil liability in connection with the |
||||
Program, unless a warranty or assumption of liability accompanies a |
||||
copy of the Program in return for a fee. |
||||
|
||||
END OF TERMS AND CONDITIONS |
||||
|
||||
How to Apply These Terms to Your New Programs |
||||
|
||||
If you develop a new program, and you want it to be of the greatest |
||||
possible use to the public, the best way to achieve this is to make it |
||||
free software which everyone can redistribute and change under these terms. |
||||
|
||||
To do so, attach the following notices to the program. It is safest |
||||
to attach them to the start of each source file to most effectively |
||||
state the exclusion of warranty; and each file should have at least |
||||
the "copyright" line and a pointer to where the full notice is found. |
||||
|
||||
<one line to give the program's name and a brief idea of what it does.> |
||||
Copyright (C) <year> <name of author> |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. |
||||
|
||||
Also add information on how to contact you by electronic and paper mail. |
||||
|
||||
If the program does terminal interaction, make it output a short |
||||
notice like this when it starts in an interactive mode: |
||||
|
||||
<program> Copyright (C) <year> <name of author> |
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
||||
This is free software, and you are welcome to redistribute it |
||||
under certain conditions; type `show c' for details. |
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate |
||||
parts of the General Public License. Of course, your program's commands |
||||
might be different; for a GUI interface, you would use an "about box". |
||||
|
||||
You should also get your employer (if you work as a programmer) or school, |
||||
if any, to sign a "copyright disclaimer" for the program, if necessary. |
||||
For more information on this, and how to apply and follow the GNU GPL, see |
||||
<https://www.gnu.org/licenses/>. |
||||
|
||||
The GNU General Public License does not permit incorporating your program |
||||
into proprietary programs. If your program is a subroutine library, you |
||||
may consider it more useful to permit linking proprietary applications with |
||||
the library. If this is what you want to do, use the GNU Lesser General |
||||
Public License instead of this License. But first, please read |
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>. |
@ -0,0 +1,355 @@
@@ -0,0 +1,355 @@
|
||||
*This repository is a mirror, for developpement and issues, please go to [gitlab](https://gitlab.com/dbeniamine/cheat.sh-vim/)* |
||||
|
||||
# Vim Cheat.sh |
||||
|
||||
This is a highly configurable vim plugin to browse cheat sheet from |
||||
[cheat.sh](https://github.com/chubin/cheat.sh) directly from vim. |
||||
|
||||
## Demo |
||||
|
||||
<!-- There is an asciinema showing how it works : |
||||
|
||||
[](https://asciinema.org/a/c6QRIhus7np2OOQzmQ2RNXzRZ) |
||||
--> |
||||
|
||||
There is a demo of most important features of the cheat.sh Vim plugin (5 Min), |
||||
courtesy of @chubin, CC-SA. |
||||
|
||||
** Note :** In the video, @chubin uses the `space` key as a `<leader>`, by |
||||
default vim `<leader>` is `backslash`. |
||||
|
||||
<p align="center"> |
||||
<img src='https://cheat.sh/files/vim-demo.gif'/> |
||||
</p> |
||||
|
||||
Or, if you want to scroll and/or pause, the same on YouTube: |
||||
|
||||
<p align="center"> |
||||
<a href="http://www.youtube.com/watch?feature=player_embedded&v=xyf6MJ0y-z8 |
||||
" target="_blank"><img src="http://img.youtube.com/vi/xyf6MJ0y-z8/0.jpg" |
||||
alt="cheat.sh-vim: Using cheat.sh from vim" width="700" height="490" border="10" /></a> |
||||
</p> |
||||
|
||||
## Features |
||||
|
||||
+ Browse existing cheat sheets from cheat.sh directly from vim |
||||
+ Get answers on any programming question directly on your vim with simple mappings |
||||
+ Answers depends of your current filetype or framework |
||||
+ Send compilation / syntax error to cht.sh and get answers |
||||
+ Manage session id to replay last query from other cht.sh clients |
||||
+ Quick navigation through answers |
||||
+ Everything is configurable |
||||
|
||||
### How to use it |
||||
|
||||
The easiest way to use this plugin is to use one of the following mappings : |
||||
|
||||
+ `K` get answer on the word under the cursor or the selection on a pager (this |
||||
feature requires vim >= 7.4.1833, you can check if have the right version with : |
||||
`:echo has("patch-7.4.1833")`) |
||||
+ `<leader>KK` same as `K` but works on lines or visual selection (not working |
||||
on neovim, because they killed interactive commands with `:!`) |
||||
+ `<leader>KB` get the answer on a special buffer |
||||
+ `<leader>KR` Replace your question by the answer |
||||
+ `<leader>KP` Past the answer below your question |
||||
+ `<leader>KC` Replay last query, toggling comments |
||||
+ `<leader>KE` Send first error to cht.sh |
||||
+ `<leader>C` Toggle showing comments by default see [configuration](#configuration) |
||||
+ `<leader>KL` Replay last query |
||||
|
||||
The plugins also provides four main commands : |
||||
|
||||
:Cheat |
||||
:CheatReplace |
||||
:CheatPast |
||||
:CheatPager |
||||
|
||||
+ These commands takes 0 or 1 argument. |
||||
+ If you give no argument, it will send the language of the current buffer and |
||||
the visual selection (or the current line / word in `normal` mode) as a plus |
||||
query to cheat.sh and show the answer in a new buffer (`:Cheat`), in place of |
||||
your question (`:CheatReplace`) or in a pager (`:CheatPager`). |
||||
+ If one argument is given, you can complete it from a list of available cheat |
||||
sheets or write your own [query](https://github.com/chubin/cheat.sh#search). |
||||
+ They also take a `bang` that make same transform the query into a plus query: |
||||
for instance : `:Cheat! factory` is the same as `:Cheat &ft/factory+`. |
||||
|
||||
#### HowIn |
||||
|
||||
The `:HowIn` command takes exaclty one argument. |
||||
|
||||
If the argument is one word, it is interpreted as a filetype (language), and |
||||
the current line (or word, depending on |cheat.sh-configuration|) is sent as a |
||||
query for this given language. |
||||
Else the first word of the query should be a filetype. |
||||
|
||||
Examples : |
||||
|
||||
```python |
||||
# Current postion in the buffer : |
||||
with open('foo') as f: |
||||
``` |
||||
```viml |
||||
:HowIn javascript |
||||
``` |
||||
Or |
||||
```viml |
||||
:Howin javascript open file |
||||
``` |
||||
|
||||
#### Frameworks |
||||
|
||||
#### Ids |
||||
|
||||
When you open a buffer, cheat.sh-vim will try to guess if you are using a |
||||
framework and if a framework is found, it will send queries using your |
||||
framework instead of your filetype. |
||||
|
||||
There are also some mappings to change the current framework : |
||||
|
||||
+ `<leader>Kt` : Use filetype instead of framework |
||||
+ `<leader>KT` : Use autodetected framework |
||||
+ `<leader>Kf` : Use next defined framework for current filetype |
||||
+ `<leader>KF` : Use previous defined framework for current filetype |
||||
|
||||
The available Frameworks can be overriden with the following code (adapt to |
||||
your needs) : |
||||
```viml |
||||
let g:CheatSheetFrameworks = { |
||||
\ 'python' : ['python', 'django', ], |
||||
\ 'javascript' : ['javascript', 'node', 'angular', 'jquery'], |
||||
\ 'php' : ['php', 'symphony', 'yii', 'zend'], |
||||
\} |
||||
``` |
||||
|
||||
As you can see the list is far from being exhaustive, please contribute if you |
||||
modify it (see below). |
||||
|
||||
##### Frameworks Detection |
||||
|
||||
This functionnality is in early stage and help is wanted to improve it. |
||||
To detect framework, the plugin go through the list of defined framework for |
||||
the current filetype. The following dictionnary tells the plugin how to detect |
||||
a few frameworks. |
||||
```viml |
||||
let g:CheatSheetFrameworkDetectionMethods = { |
||||
\'django' : { 'type' : 'file', 'value' : 'manage.py' }, |
||||
\'symfony' : { 'type' : 'file', 'value' : 'symfony.phar' }, |
||||
\'jquery' : {'type' :'search', 'value' : 'jquery.*\.js'}, |
||||
\} |
||||
``` |
||||
|
||||
This dictionnary can be overriden by the user. |
||||
|
||||
There are three types of detections : |
||||
|
||||
1. 'file' : 'value' is an argument for the `find` command to locate a file |
||||
`find . -name "value"` |
||||
2. 'search', 'value' is a pattern that should be present in the current file |
||||
3. 'func' : 'value' is the name of a user defined function which should return |
||||
something true if the framework is detected. The function takes one argument |
||||
which is the name of the framework we are currently testing for. |
||||
|
||||
Please report any contribution on [this |
||||
issue](https://gitlab.com/dbeniamine/cheat.sh-vim/issues/51#note_95268282), or |
||||
do MR (PR) on gitlab (resp github) : |
||||
|
||||
|
||||
The `:CheatId` command can be used to manage ids : |
||||
|
||||
:Cheat[!] [newid] " Generates a new id or set id to newid |
||||
" Id will not be overwritten if ! is not given |
||||
:Cheat remove " Completely removes the id |
||||
|
||||
#### Errors |
||||
|
||||
Cheat.sh-vim can directly send the syntaxt and compilation errors / warning to |
||||
cht.sh. To do so, hit `<leader>KE` or run `:CheatError`. |
||||
|
||||
By default, the answer will be displayed on the cheat buffer, to change this |
||||
behavior : |
||||
|
||||
let g:CheatSheetDefaultMode = x |
||||
|
||||
Where x is : |
||||
|
||||
+ 0 : Cheat buffer (default) |
||||
+ 1 : Replace current line (sounds like a very bad idea) |
||||
+ 2 : Use the pager |
||||
+ 3 : Append answer below current line (sounds like a bad idea) |
||||
|
||||
##### Error providers |
||||
|
||||
Currently errors are search from the quickfix, then from syntastic errors. |
||||
To change this order : |
||||
|
||||
let g:CheatSheetProviders = ['syntastic', 'quickfix'] |
||||
|
||||
You can easily add an error provider in 5 steps : |
||||
|
||||
1. Copy the file `cheat.sh/autoload/cheat/providers/quickfix.vim` to |
||||
`cheat.sh/autoload/cheat/providers/myprovider.vim` |
||||
2. Adapt and rename the function (only change quickfix in the name), it must |
||||
return the error string without special chars or an empty string if there are |
||||
no errors / warning |
||||
3. Add your provider name (filename) to the `CheatSheatProvider` list in |
||||
`cheat.sh/autoload/cheat/providers.vim` |
||||
4. Test it |
||||
5. Do a merge request on [gitlab](https://gitlab.com/dbeniamine/cheat.sh-vim/) |
||||
|
||||
##### Syntastic hooks |
||||
|
||||
Cheat.sh-vim uses syntastic hooks to retrieve the error list, if you also need |
||||
to use synstastic hook, make sure that your function calls ours with the initial |
||||
error list : |
||||
|
||||
function SyntasticCheckHook(errors) |
||||
call cheat#providers#syntastic#Hook(a:errors) |
||||
" Do whatever you want to do |
||||
endfunction |
||||
|
||||
#### Navigate |
||||
|
||||
Once you have called on of these commands, you can navigate through questions, |
||||
answers and related with the following mappings : |
||||
|
||||
+ `<leader>KQN` Next Question |
||||
+ `<leader>KAN` Next Answer |
||||
+ `<leader>KSN` Next "See also" |
||||
+ `<leader>KHN` Next in history |
||||
+ `<leader>KQP` Previous Question |
||||
+ `<leader>KAP` Previous Answer |
||||
+ `<leader>KSP` Previous "See also" |
||||
+ `<leader>KHP` Previous in history |
||||
|
||||
In the cheat buffer, the following mappings are also available : |
||||
|
||||
+ `<localleader>h` Previous Answer |
||||
+ `<localleader>j` Next Question |
||||
+ `<localleader>k` Previous Question |
||||
+ `<localleader>l` Next Answer |
||||
+ `<localleader>H` Previous history |
||||
+ `<localleader>J` Next "See also" |
||||
+ `<localleader>K` Previous "See also" |
||||
+ `<localleader>L` Next history |
||||
|
||||
|
||||
You can also directly use the function : |
||||
|
||||
:call cheat#navigate(delta, type) |
||||
|
||||
Where delta is a numeric value for moving (1, or -1 for next or previous) And |
||||
type is one of : `'Q'`, `'A'`, `'S'`, `H` (history), and `C` (replay last |
||||
query, toggling comments). |
||||
|
||||
For instance : |
||||
|
||||
:call cheat#navigate(-3, 'A') |
||||
|
||||
goes back three answers before the current |
||||
|
||||
When navigating, the same mode (pager, buffer, replace) is used as for the last |
||||
request. |
||||
|
||||
#### Notes |
||||
|
||||
+ `<leader>` is usually '\'. |
||||
+ **This plugin is still in beta, Replace mode might remove some of your code, |
||||
use with caution.** |
||||
+ For more info on cheat sheet sources, see |
||||
[cheat.sh](https://github.com/chubin/cheat.sh). |
||||
|
||||
## Install |
||||
|
||||
### Vizardry |
||||
|
||||
If you have [Vizardry](https://github.com/dbeniamine/vizardry) installed, you |
||||
can run from vim: |
||||
|
||||
:Invoke -u dbeniamine cheat.sh-vim |
||||
|
||||
### Vundle |
||||
|
||||
Add the following to your Vundle Plugin list (not tested, but should work) : |
||||
|
||||
Plugin 'dbeniamine/cheat.sh-vim' |
||||
|
||||
### Pathogen install |
||||
|
||||
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/bundle/cheat.sh-vim |
||||
|
||||
### Quick install |
||||
|
||||
git clone https://github.com/dbeniamine/cheat.sh-vim.git |
||||
cd cheat.sh-vim/ |
||||
cp -r ./* ~/.vim |
||||
|
||||
## Configuration |
||||
|
||||
Every parameter used to retrieve and display the cheat sheet can be changed, to |
||||
do so, just put the following in you vimrc and ajust to your needs (these are |
||||
the default values that will be used if you do not change them) : |
||||
|
||||
" Vim command used to open new buffer |
||||
let g:CheatSheetReaderCmd='new"' |
||||
|
||||
" Cheat sheet file type |
||||
let g:CheatSheetFt='markdown' |
||||
|
||||
" Program used to retrieve cheat sheet with its arguments |
||||
let g:CheatSheetUrlGetter='curl --silent' |
||||
|
||||
" Flag to add cookie file to the query |
||||
let g:CheatSheetUrlGetterIdFlag='-b' |
||||
|
||||
" cheat sheet base url |
||||
let g:CheatSheetBaseUrl='https://cht.sh' |
||||
|
||||
" cheat sheet settings do not include style settings neiter comments, |
||||
" see other options below |
||||
let g:CheatSheetUrlSettings='q' |
||||
|
||||
" cheat sheet pager |
||||
let g:CheatPager='less -R' |
||||
|
||||
" pygmentize theme used for pager output, see :CheatPager :styles-demo |
||||
let g:CheatSheetPagerStyle=rrt |
||||
|
||||
" Show comments in answers by default |
||||
" (setting this to 0 means giving ?Q to the server) |
||||
let g:CheatSheetShowCommentsByDefault=1 |
||||
|
||||
" cheat sheet buffer name |
||||
let g:CheatSheetBufferName="_cheat" |
||||
|
||||
" Default selection in normal mode (line for whole line, word for word under cursor) |
||||
let g:CheatSheetDefaultSelection="line" |
||||
|
||||
" Default query mode |
||||
" 0 => buffer |
||||
" 1 => replace (do not use or you might loose some lines of code) |
||||
" 2 => pager |
||||
" 3 => paste after query |
||||
" 4 => paste before query |
||||
let g:CheatSheetDefaultMode=0 |
||||
|
||||
Path to cheat sheet cookie |
||||
let g:CheatSheetIdPath=expand('~/.cht.sh/id') |
||||
|
||||
|
||||
|
||||
You can also disable the mappings (see plugin/cheat.vim to redo the mappings |
||||
manually) |
||||
|
||||
let g:CheatSheetDoNotMap=1 |
||||
|
||||
To disable the replacement of man by cheat sheets : |
||||
|
||||
Let g:CheatDoNotReplaceKeywordPrg=1 |
||||
|
||||
## License |
||||
|
||||
This plugin is distributed under GPL Licence v3.0, see |
||||
https://www.gnu.org/licenses/gpl.txt |
||||
|
||||
The demo are creative Commons, CC-SA Igor Chubin. |
@ -0,0 +1,128 @@
@@ -0,0 +1,128 @@
|
||||
" Vim plugin for accessing cheat sheets from cheat.sh. |
||||
" Maintainer: David Beniamine |
||||
" |
||||
" Copyright (C) 2018 David Beniamine. All rights reserved. |
||||
" |
||||
" This program is free software: you can redistribute it and/or modify |
||||
" it under the terms of the GNU General Public License as published by |
||||
" the Free Software Foundation, either version 3 of the License, or |
||||
" (at your option) any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, |
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
" GNU General Public License for more details. |
||||
" |
||||
" You should have received a copy of the GNU General Public License |
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
let save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
if(!exists("g:CheatSheetFrameworks")) |
||||
let g:CheatSheetFrameworks = { |
||||
\ 'python' : [ 'python', 'django', ], |
||||
\ 'javascript' : ['javascript', 'node', 'angular', 'jquery'], |
||||
\ 'php' : ['php', 'symfony', 'yii', 'zend'], |
||||
\} |
||||
endif |
||||
|
||||
if(!exists("g:CheatSheetFrameworkDetectionMethods")) |
||||
let g:CheatSheetFrameworkDetectionMethods = { |
||||
\'django' : { 'type' : 'file', 'value' : 'manage.py' }, |
||||
\'symfony' : { 'type' : 'file', 'value' : 'symfony.phar' }, |
||||
\'jquery' : {'type' :'search', 'value' : 'jquery.*\.js'}, |
||||
\} |
||||
endif |
||||
|
||||
if(!exists("b:CheatSheetCurrentFramework")) |
||||
let b:CheatSheetCurrentFramework = 0 |
||||
endif |
||||
|
||||
function! s:Detectfromfile(value, fm) |
||||
let dir=expand('%:p:h') |
||||
" Forward search |
||||
silent let ret=system('find '.shellescape(dir).' -name '. |
||||
\shellescape(a:value).' 2>/dev/null') |
||||
" Backward search |
||||
if ret == "" |
||||
let dirs="" |
||||
let parent=substitute(dir, '/[^/]*$', '', '') |
||||
while parent != "" |
||||
let dirs.=" ".shellescape(parent) |
||||
let parent=substitute(parent, '/[^/]*$', '', '') |
||||
endwhile |
||||
silent let ret=system('find '.dirs.' -maxdepth 1 -name '. |
||||
\shellescape(a:value).' 2>/dev/null') |
||||
endif |
||||
return ret != "" |
||||
endfunction |
||||
|
||||
function! s:Detectfromsearch(value, fm) |
||||
return search(a:value, 'cnw') |
||||
endfunction |
||||
|
||||
function! s:Detectfromfunc(value, fm) |
||||
return function(a:value)(a:fm) |
||||
endfunction |
||||
|
||||
function! cheat#frameworks#autodetect(print) |
||||
if(!has_key(g:CheatSheetFrameworks, &ft)) |
||||
return |
||||
endif |
||||
let framework = &ft |
||||
" Try autodetect |
||||
for fm in g:CheatSheetFrameworks[&ft] |
||||
if(has_key(g:CheatSheetFrameworkDetectionMethods, fm) && |
||||
\ function("s:Detectfrom". |
||||
\g:CheatSheetFrameworkDetectionMethods[fm].type)( |
||||
\g:CheatSheetFrameworkDetectionMethods[fm].value, fm) |
||||
\) |
||||
let framework=fm |
||||
break |
||||
endif |
||||
endfor |
||||
" Set framework |
||||
let b:CheatSheetCurrentFramework = index(g:CheatSheetFrameworks[&ft], |
||||
\framework) |
||||
|
||||
if(a:print) |
||||
call cheat#echo('Language for cheat queries changed to : "'. |
||||
\cheat#frameworks#getFt().'"', 's') |
||||
endif |
||||
endfunction |
||||
|
||||
" Try to use a framework if defined or return current filetype |
||||
function! cheat#frameworks#getFt() |
||||
try |
||||
let ft=g:CheatSheetFrameworks[&ft][b:CheatSheetCurrentFramework] |
||||
catch |
||||
let ft=&ft |
||||
endtry |
||||
return ft |
||||
endfunction |
||||
|
||||
" Switch to next filetype |
||||
function! cheat#frameworks#cycle(num) |
||||
if(!has_key(g:CheatSheetFrameworks, &ft)) |
||||
call cheat#echo('No frameworks define for "'.&ft. |
||||
\'", see :help cheat.sh-frameworks', 'E') |
||||
return |
||||
endif |
||||
|
||||
if(a:num == 0) |
||||
" Reset |
||||
let b:CheatSheetCurrentFramework = 0 |
||||
else |
||||
if(abs(b:CheatSheetCurrentFramework) >= len(g:CheatSheetFrameworks[&ft])) |
||||
let b:CheatSheetCurrentFramework = 0 |
||||
endif |
||||
let b:CheatSheetCurrentFramework += a:num |
||||
endif |
||||
|
||||
call cheat#echo('Language for cheat queries changed to : "'. |
||||
\cheat#frameworks#getFt().'"', 's') |
||||
endfunction |
||||
|
||||
let cpo=save_cpo |
||||
" vim:set et sw=4: |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
" Vim plugin for accessing cheat sheets from cheat.sh. |
||||
" Maintainer: David Beniamine |
||||
" |
||||
" Copyright (C) 2018 David Beniamine. All rights reserved. |
||||
" |
||||
" This program is free software: you can redistribute it and/or modify |
||||
" it under the terms of the GNU General Public License as published by |
||||
" the Free Software Foundation, either version 3 of the License, or |
||||
" (at your option) any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, |
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
" GNU General Public License for more details. |
||||
" |
||||
" You should have received a copy of the GNU General Public License |
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
let save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
function! cheat#providers#quickfix#GetError() |
||||
return cheat#providers#GetErrorFromList(getqflist()) |
||||
endfunction |
||||
|
||||
let cpo=save_cpo |
||||
" vim:set et sw=4: |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
" Vim plugin for accessing cheat sheets from cheat.sh. |
||||
" Maintainer: David Beniamine |
||||
" |
||||
" Copyright (C) 2018 David Beniamine. All rights reserved. |
||||
" |
||||
" This program is free software: you can redistribute it and/or modify |
||||
" it under the terms of the GNU General Public License as published by |
||||
" the Free Software Foundation, either version 3 of the License, or |
||||
" (at your option) any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, |
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
" GNU General Public License for more details. |
||||
" |
||||
" You should have received a copy of the GNU General Public License |
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
let g:save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
let s:errors=[] |
||||
|
||||
function! cheat#providers#syntastic#GetError() |
||||
return cheat#providers#GetErrorFromList(s:errors) |
||||
endfunction |
||||
|
||||
function! cheat#providers#syntastic#Hook(errors) |
||||
let s:errors=a:errors |
||||
endfunction |
||||
|
||||
" vim:set et sw=4: |
@ -0,0 +1,129 @@
@@ -0,0 +1,129 @@
|
||||
" Vim plugin for accessing cheat sheets from cheat.sh. |
||||
" Maintainer: David Beniamine |
||||
" |
||||
" Copyright (C) 2018 David Beniamine. All rights reserved. |
||||
" |
||||
" This program is free software: you can redistribute it and/or modify |
||||
" it under the terms of the GNU General Public License as published by |
||||
" the Free Software Foundation, either version 3 of the License, or |
||||
" (at your option) any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, |
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
" GNU General Public License for more details. |
||||
" |
||||
" You should have received a copy of the GNU General Public License |
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
let save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
" Transforms a high level request into a query ready to be processed by cht.sh |
||||
function! cheat#requests#toquery(request) |
||||
if(a:request.useFt == 1) |
||||
let query='vim:'.a:request.ft.'/' |
||||
else |
||||
let query='' |
||||
endif |
||||
if(a:request.isCheatSheet == 0) |
||||
let query.=substitute(a:request.query, ' ', '+', 'g') |
||||
" There must be a + in the query |
||||
if(match(query, '+') == -1) |
||||
let query.='+' |
||||
endif |
||||
let query.='/'.a:request.q.'/'.a:request.a.','.a:request.s |
||||
else |
||||
let query.=a:request.query |
||||
endif |
||||
let query.='?' |
||||
let query.=g:CheatSheetUrlSettings |
||||
" Color pager requests |
||||
if(a:request.mode!=2) |
||||
let query.='T' |
||||
endif |
||||
if(a:request.comments==0) |
||||
let query.='Q' |
||||
endif |
||||
if(exists("g:CheatSheetPagerStyle") && a:request.mode==2) |
||||
let query.="&style=".g:CheatSheetPagerStyle |
||||
endif |
||||
return query |
||||
endfunction |
||||
|
||||
" Parse the query to update the given request |
||||
function! s:parseQuery(query, request) |
||||
let opts=split(a:query, '/') |
||||
if(len(opts) >= 2) |
||||
let a:request.ft=opts[0] |
||||
let a:request.query=opts[1] |
||||
else |
||||
let a:request.ft=g:CheatSheetFt |
||||
let a:request.query=opts[0] |
||||
let a:request.useFt = 0 |
||||
endif |
||||
if(len(opts) >=3) |
||||
let a:request.q=opts[2] |
||||
else |
||||
let a:request.q=0 |
||||
endif |
||||
if(len(opts) >=4) |
||||
" Remove see related if present |
||||
let a:request.a=substitute(opts[3], '\(.*\),\+.*$', '\1', '') |
||||
else |
||||
let a:request.a=0 |
||||
endif |
||||
" Remove see related uses , not / |
||||
if(match(a:query, ',\d\+$')!=-1) |
||||
let a:request.s=substitute(a:query, '^.*,\(\d\+\)$', '\1', '') |
||||
else |
||||
let a:request.s=0 |
||||
endif |
||||
if(match(a:query,'+')!=-1) |
||||
let a:request.isCheatSheet=0 |
||||
let a:request.useFt = 1 |
||||
else |
||||
let a:request.isCheatSheet=1 |
||||
endif |
||||
return a:request |
||||
endfunction |
||||
|
||||
|
||||
" Prepare an empty request |
||||
function! cheat#requests#init(query, mode, parseQuery) |
||||
let request={ |
||||
\'a' : 0, |
||||
\'q' : 0, |
||||
\'s' : 0, |
||||
\'comments' : g:CheatSheetShowCommentsByDefault, |
||||
\'ft' : cheat#frameworks#getFt(), |
||||
\'isCheatSheet' : 0, |
||||
\'appendpos' : 0, |
||||
\'numLines' : 0, |
||||
\'mode' : g:CheatSheetDefaultMode, |
||||
\'useFt' : 1, |
||||
\'query' : a:query, |
||||
\} |
||||
if(a:mode != 5) |
||||
let request.mode=a:mode |
||||
endif |
||||
|
||||
" Set append pos / remove query if required |
||||
if(request.mode == 1) |
||||
call cheat#echo('removing lines', 'e') |
||||
normal dd |
||||
let request.appendpos=getcurpos()[1]-1 |
||||
elseif(request.mode == 3) |
||||
let request.appendpos=getcurpos()[1] |
||||
elseif(request.mode == 4) |
||||
let request.appendpos=getcurpos()[1]-1 |
||||
endif |
||||
|
||||
if(a:parseQuery) |
||||
call s:parseQuery(a:query, request) |
||||
endif |
||||
return request |
||||
endfunction |
||||
|
||||
let cpo=save_cpo |
||||
" vim:set et sw=4: |
@ -0,0 +1,314 @@
@@ -0,0 +1,314 @@
|
||||
*cheat.sh-vim* ~ |
||||
|
||||
This is a vim plugin to browse cheat sheet from |
||||
cheat.sh (https://github.com/chubin/cheat.sh) directly from vim. |
||||
|
||||
=============================================================================== |
||||
Features *cheat.sh-features* ~ |
||||
|
||||
|
||||
+ Browse existing cheat sheets from cheat.sh directly from vim |
||||
+ Get answers on any programming question directly on your vim with simple mappings |
||||
+ Answers depends of your current filetype or framework see |cheat.sh-frameworks| |
||||
+ Send compilation / syntax error to cht.sh and get answers |
||||
+ Quick navigation through answers |
||||
+ Everything is configurable |
||||
|
||||
How to use it *cheat.sh-how-to-use* ~ |
||||
|
||||
The easiest way to use this plugin is to use one of the following mappings : |
||||
The easiest way to use this plugin is to use one of the following mappings : |
||||
|
||||
+ `K` get answer on the word under the cursor or the selection on a pager (this |
||||
feature requires vim >= 7.4.1833, you can check if have the right version with : |
||||
`:echo has("patch-7.4.1833")`) |
||||
+ `<leader>KK` same as `K` but works on lines or visual selection (not working |
||||
on neovim, because they killed interactive commands with `:!`) |
||||
+ `<leader>KB` get the answer on a special buffer |
||||
+ `<leader>KR` Replace your question by the answer |
||||
+ `<leader>KP` Past the answer below your question |
||||
+ `<leader>KC` Replay last query, toggling comments |
||||
+ `<leader>KE` Send first error to cht.sh |
||||
+ `<leader>C` Toggle showing comments by default see |cheat.sh-configuration| |
||||
+ `<leader>KL` Replay last query |
||||
|
||||
The plugins also provides four main commands : |
||||
> |
||||
:Cheat |
||||
:CheatReplace |
||||
:CheatPast |
||||
:CheatPager |
||||
< |
||||
+ These commands takes 0 or 1 argument. |
||||
+ If you give no argument, it will send the language of the current buffer and |
||||
the visual selection (or the current line / word in `normal` mode) as a plus |
||||
query to cheat.sh and show the answer in a new buffer (`:Cheat`), in place of |
||||
your question (`:CheatReplace`) or in a pager (`:CheatPager`). |
||||
+ If one argument is given, you can complete it from a list of available cheat |
||||
sheets or write your own [query](https://github.com/chubin/cheat.sh#search). |
||||
+ They also take a `bang` that make same transform the query into a plus query: |
||||
for instance : `:Cheat! factory` is the same as `:Cheat &ft/factory+`. |
||||
|
||||
HowIn *cheat.sh-howin* ~ |
||||
|
||||
The `:HowIn` command takes exaclty one argument. |
||||
|
||||
If the argument is one word, it is interpreted as a filetype (language), and |
||||
the current line (or word, depending on |cheat.sh-configuration|) is sent as a |
||||
query for this given language. |
||||
Else the first word of the query should be a filetype. |
||||
|
||||
Examples : |
||||
|
||||
> |
||||
# Current postion in the buffer : |
||||
with open('foo') as f: |
||||
:HowIn javascript |
||||
< |
||||
Or |
||||
> |
||||
:Howin javascript open file |
||||
< |
||||
|
||||
|
||||
Frameworks *cheat.sh-frameworks* ~ |
||||
|
||||
When you open a buffer, cheat.sh-vim will try to guess if you are using a |
||||
framework (see |cheat.sh-framework-detection|) and if a framework is found, it |
||||
will send queries using your framework instead of your filetype. |
||||
|
||||
There are also some mappings to change the current framework : |
||||
|
||||
+ `<leader>Kt` : Use filetype instead of framework |
||||
+ `<leader>KT` : Use autodetected framework |
||||
+ `<leader>Kf` : Use next defined framework for current filetype |
||||
+ `<leader>KF` : Use previous defined framework for current filetype |
||||
|
||||
The available Frameworks can be overriden with the following code (adapt to |
||||
your needs) : |
||||
> |
||||
let g:CheatSheetFrameworks = { |
||||
\ 'python' : ['python', 'django', ], |
||||
\ 'javascript' : ['javascript', 'node', 'angular', 'jquery'], |
||||
\ 'php' : ['php', 'symphony', 'yii', 'zend'], |
||||
\} |
||||
|
||||
As you can see the list is far from being exhaustive, please contribute if you |
||||
modify it (see below). |
||||
|
||||
*cheat.sh-frameworks-detection* |
||||
|
||||
This functionnality is in early stage and help is wanted to improve it. |
||||
To detect framework, the plugin go through the list of defined framework for |
||||
the current filetype. The following dictionnary tells the plugin how to detect |
||||
a few frameworks. |
||||
> |
||||
let g:CheatSheetFrameworkDetectionMethods = { |
||||
\'django' : { 'type' : 'file', 'value' : 'manage.py' }, |
||||
\'symfony' : { 'type' : 'file', 'value' : 'symfony.phar' }, |
||||
\'jquery' : {'type' :'search', 'value' : 'jquery.*\.js'}, |
||||
\} |
||||
|
||||
This dictionnary can be overriden by the user. |
||||
|
||||
There are three types of detections : |
||||
|
||||
1. 'file' : 'value' is an argument for the `find` command to locate a file |
||||
`find . -name "value"` |
||||
2. 'search', 'value' is a pattern that should be present in the current file |
||||
3. 'func' : 'value' is the name of a user defined function which should return |
||||
something true if the framework is detected. The function takes one argument |
||||
which is the name of the framework we are currently testing for. |
||||
|
||||
Please report any contribution on the followin issue, or do MR (PR) on gitlab |
||||
(resp github). |
||||
|
||||
https://gitlab.com/dbeniamine/cheat.sh-vim/issues/51#note_95268282 |
||||
|
||||
<Ids *cheat.sh-ids* ~ |
||||
|
||||
You can manage ids through the `:CheatId` command : |
||||
|
||||
:Cheat[!] [newid] " Generates a new id or set id to newid |
||||
" Id will not be overwritten if ! is not given |
||||
:Cheat remove " Completely removes the id |
||||
|
||||
Id is used to replay query from different clients |
||||
|
||||
Errors *cheat.sh-errors* ~ |
||||
|
||||
Cheat.sh-vim can directly send the syntaxt and compilation errors / warning to |
||||
cht.sh. To do so, hit `<leader>KE` or run `:CheatError`. |
||||
|
||||
By default, the answer will be displayed on the cheat buffer, to change this |
||||
behavior : |
||||
> |
||||
let g:CheatSheetDefaultMode = x |
||||
< |
||||
Where x is : |
||||
|
||||
+ 0 : Cheat buffer (default) |
||||
+ 1 : Replace current line (sounds like a very bad idea) |
||||
+ 2 : Use the pager |
||||
+ 3 : Append answer below current line (sounds like a bad idea) |
||||
|
||||
Error providers *cheat.sh-errors-providers* ~ |
||||
|
||||
Currently errors are search from the quickfix, then from syntastic errors. |
||||
To change this order : |
||||
> |
||||
let g:CheatSheetProviders = ['syntastic', 'quickfix'] |
||||
< |
||||
|
||||
You can easily add an error provider in 5 steps : |
||||
|
||||
1. Copy the file `cheat.sh/autoload/cheat/providers/quickfix.vim` to |
||||
`cheat.sh/autoload/cheat/providers/myprovider.vim` |
||||
2. Adapt and rename the function (only change quickfix in the name), it must |
||||
return the error string without special chars or an empty string if there are |
||||
no errors / warning |
||||
3. Add your provider name (filename) to the `CheatSheatProvider` list in |
||||
`cheat.sh/autoload/cheat/providers.vim` |
||||
4. Test it |
||||
5. Do a merge request on [gitlab](https://gitlab.com/dbeniamine/cheat.sh-vim/) |
||||
|
||||
Syntastic hooks *cheat.sh-syntastic-hook* ~ |
||||
|
||||
Cheat.sh-vim uses syntastic hooks to retrieve the error list, if you also need |
||||
to use synstastic hook, make sure that your function calls ours with the initial |
||||
error list : |
||||
|
||||
function SyntasticCheckHook(errors) |
||||
call cheat#providers#syntastic#Hook(a:errors) |
||||
" Do whatever you want to do |
||||
endfunction |
||||
|
||||
|
||||
|
||||
Navigate *cheat.sh-navigate* ~ |
||||
|
||||
Once you have called on of these commands, you can navigate through questions, |
||||
answers and related with the following mappings : |
||||
|
||||
+ `<leader>KQN` Next Question |
||||
+ `<leader>KAN` Next Answer |
||||
+ `<leader>KSN` Next "See also" |
||||
+ `<leader>KHN` Next in history |
||||
+ `<leader>KQP` Previous Question |
||||
+ `<leader>KAP` Previous Answer |
||||
+ `<leader>KSP` Previous "See also" |
||||
+ `<leader>KHP` Previous in history |
||||
|
||||
In the cheat buffer, the following mappings are available : |
||||
|
||||
+ `<localleader>h` Previous Answer |
||||
+ `<localleader>j` Next Question |
||||
+ `<localleader>k` Previous Question |
||||
+ `<localleader>l` Next Answer |
||||
+ `<localleader>H` Previous history |
||||
+ `<localleader>J` Next "See also" |
||||
+ `<localleader>K` Previous "See also" |
||||
+ `<localleader>L` Next history |
||||
|
||||
You can also directly use the function : |
||||
> |
||||
:call cheat#navigate(delta, type) |
||||
< |
||||
Where delta is a numeric value for moving (1, or -1 for next or previous) And |
||||
type is one of : `'Q'`, `'A'`, `'S'`, `H` (history), and `C` (replay last |
||||
query, toggling comments). |
||||
|
||||
For instance : |
||||
> |
||||
:call cheat#navigate(-3, 'A') |
||||
< |
||||
goes back three answers before the current |
||||
|
||||
When navigating, the same mode (pager, buffer, replace) is used as for the last |
||||
request. |
||||
|
||||
Notes *cheat.sh-notes* ~ |
||||
|
||||
+ `<leader>` is usually '\', see |<leader>| |
||||
+ **This plugin is still in beta, Replace mode might remove some of your code, |
||||
use with caution.** |
||||
+ For more info on cheat sheet sources, see |
||||
[cheat.sh](https://github.com/chubin/cheat.sh). |
||||
|
||||
|
||||
This plugin provides a `:Cheat` command to browse cheat sheets from vim. This |
||||
command takes one argument : a Cheat.sh |
||||
query (https://github.com/chubin/cheat.sh#search), and supports completion. |
||||
|
||||
For more info on cheat sheet source, see |
||||
cheat.sh (https://github.com/chubin/cheat.sh). |
||||
|
||||
============================================================================== |
||||
Configuration *cheat.sh-configuration* ~ |
||||
|
||||
Every parameter used to retrieve and display the cheat sheet can be changed, |
||||
to do so, just put the following in you vimrc and ajust to your needs (these |
||||
are the default values that will be used if you do not change them) : |
||||
> |
||||
" Vim command used to open new buffer |
||||
let g:CheatSheetReaderCmd='new"' |
||||
|
||||
" Cheat sheet file type |
||||
let g:CheatSheetFt='markdown' |
||||
|
||||
" Program used to retrieve cheat sheet with its arguments |
||||
let g:CheatSheetUrlGetter='curl --silent' |
||||
|
||||
" Flag to add cookie file to the query |
||||
let g:CheatSheetUrlGetterIdFlag='-b' |
||||
|
||||
" cheat sheet base url |
||||
let g:CheatSheetBaseUrl='https://cht.sh' |
||||
|
||||
" cheat sheet settings do not include style settings neiter comments, |
||||
" see other options below |
||||
let g:CheatSheetUrlSettings='q' |
||||
|
||||
" cheat sheet pager |
||||
let g:CheatPager='less -R' |
||||
|
||||
" pygmentize theme used for pager output, see :CheatPager :styles-demo |
||||
let g:CheatSheetPagerStyle=rrt |
||||
|
||||
" Show comments in answers by default |
||||
" (setting this to 0 means giving ?Q to the server) |
||||
let g:CheatSheetShowCommentsByDefault=1 |
||||
|
||||
" cheat sheet buffer name |
||||
let g:CheatSheetBufferName="_cheat" |
||||
|
||||
" Default selection in normal mode (line for whole line, word for word under cursor) |
||||
let g:CheatSheetDefaultSelection="line" |
||||
|
||||
" Default query mode |
||||
" 0 => buffer |
||||
" 1 => replace (do not use or you might loose some lines of code) |
||||
" 2 => pager |
||||
" 3 => paste after query |
||||
" 4 => paste before query |
||||
let g:CheatSheetDefaultMode=0 |
||||
|
||||
Path to cheat sheet cookie |
||||
let g:CheatSheetIdPath=expand('~/.cht.sh/id') |
||||
|
||||
< |
||||
You can also disable the mappings (see plugin/cheat.vim to redo the mappings |
||||
manually) |
||||
> |
||||
let g:CheatSheetDoNotMap=1 |
||||
< |
||||
To disable the replacement of man by cheat sheets : |
||||
> |
||||
Let g:CheatDoNotReplaceKeywordPrg=1 |
||||
< |
||||
|
||||
============================================================================== |
||||
Licence *cheat.sh-licence* ~ |
||||
|
||||
This plugin is distributed under GPL Licence v3.0, see |
||||
https://www.gnu.org/licenses/gpl.txt |
@ -0,0 +1,174 @@
@@ -0,0 +1,174 @@
|
||||
" Vim plugin for accessing cheat sheets from cheat.sh. |
||||
" Maintainer: David Beniamine |
||||
" |
||||
" Copyright (C) 2018 David Beniamine. All rights reserved. |
||||
" |
||||
" This program is free software: you can redistribute it and/or modify |
||||
" it under the terms of the GNU General Public License as published by |
||||
" the Free Software Foundation, either version 3 of the License, or |
||||
" (at your option) any later version. |
||||
" |
||||
" This program is distributed in the hope that it will be useful, |
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
" GNU General Public License for more details. |
||||
" |
||||
" You should have received a copy of the GNU General Public License |
||||
" along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
if exists("g:loaded_cheat_sh") |
||||
finish |
||||
endif |
||||
|
||||
let save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
let g:loaded_cheat_sh = "v0.2" |
||||
|
||||
" Default query mode |
||||
if(!exists("g:CheatSheetDefaultMode")) |
||||
let g:CheatSheetDefaultMode=0 |
||||
endif |
||||
|
||||
" cheat sheet base url |
||||
if(!exists("g:CheatSheetBaseUrl")) |
||||
let g:CheatSheetBaseUrl='https://cht.sh' |
||||
endif |
||||
|
||||
" command definition |
||||
command! -nargs=? -bang -count -complete=custom,cheat#completeargs Cheat |
||||
\ call cheat#cheat(<q-args>, <line1>, <line2>, <count>, 0, "<bang>") |
||||
|
||||
command! -nargs=? -count CheatError |
||||
\ call cheat#cheat('', -1, -1, -1, 4, '!') |
||||
|
||||
command! -nargs=? -bang -count -complete=custom,cheat#completeargs CheatReplace |
||||
\ call cheat#cheat(<q-args>, <line1>, <line2>, <count>, 1, "<bang>") |
||||
|
||||
command! -nargs=? -bang -count -complete=custom,cheat#completeargs CheatPager |
||||
\ call cheat#cheat(<q-args>, <line1>, <line2>, <count>, 2, "<bang>") |
||||
|
||||
command! -nargs=? -bang -count -complete=custom,cheat#completeargs CheatPaste |
||||
\ call cheat#cheat(<q-args>, <line1>, <line2>, <count>, 3, "<bang>") |
||||
|
||||
command! -nargs=1 CheatNavigateQuestions call cheat#navigate(<q-args>, 'Q') |
||||
command! -nargs=1 CheatNavigateAnswers call cheat#navigate(<q-args>, 'A') |
||||
command! -nargs=1 CheatSeeAlso call cheat#navigate(<q-args>, 'S') |
||||
command! -nargs=1 CheatHistory call cheat#navigate(<q-args>, 'H') |
||||
command! -nargs=? -bang CheatId call cheat#session#id(<q-args>, "<bang>") |
||||
|
||||
|
||||
command! -nargs=1 -bang -count -complete=custom,cheat#completeargs HowIn |
||||
\ call cheat#howin(<q-args>, <line1>, <line2>, <count>) |
||||
|
||||
if((!exists("g:CheatDoNotReplaceKeywordPrg") || |
||||
\ g:CheatDoNotReplaceKeywordPrg ==0)) |
||||
if(has("patch-7.4.1833")) |
||||
set keywordprg=:CheatPager! |
||||
else |
||||
exe 'set keywordprg='.expand('<sfile>:p:h').'/../scripts/chtpager.sh' |
||||
endif |
||||
endif |
||||
|
||||
if(!exists("g:CheatSheetDoNotMap") || g:CheatSheetDoNotMap ==0) |
||||
nnoremap <script> <silent> <leader>C :call cheat#toggleComments()<CR> |
||||
|
||||
" Buffer |
||||
nnoremap <script> <silent> <leader>KB |
||||
\ :call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 0, '!')<CR> |
||||
vnoremap <script> <silent> <leader>KB |
||||
\ :call cheat#cheat("", -1, -1, 2, 0, '!')<CR> |
||||
|
||||
" Pager |
||||
nnoremap <script> <silent> <leader>KK |
||||
\ :call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 2, '!')<CR> |
||||
vnoremap <script> <silent> <leader>KK |
||||
\ :call cheat#cheat("", -1, -1, 2, 2, '!')<CR> |
||||
|
||||
vnoremap <script> <silent> <leader>KL :call cheat#session#last()<CR> |
||||
nnoremap <script> <silent> <leader>KL :call cheat#session#last()<CR> |
||||
|
||||
|
||||
" Replace |
||||
nnoremap <script> <silent> <leader>KR |
||||
\ :call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 1, '!')<CR> |
||||
vnoremap <script> <silent> <leader>KR |
||||
\ :call cheat#cheat("", -1, -1, 2, 1, '!')<CR> |
||||
|
||||
" Paste |
||||
nnoremap <script> <silent> <leader>KP |
||||
\ :call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 4, '!')<CR> |
||||
vnoremap <script> <silent> <leader>KP |
||||
\ :call cheat#cheat("", -1, -1, 4, 1, '!')<CR> |
||||
|
||||
nnoremap <script> <silent> <leader>Kp |
||||
\ :call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 3, '!')<CR> |
||||
vnoremap <script> <silent> <leader>Kp |
||||
\ :call cheat#cheat("", -1, -1, 3, 1, '!')<CR> |
||||
|
||||
" Buffer |
||||
nnoremap <script> <silent> <leader>KE |
||||
\ :call cheat#cheat("", -1, -1 , -1, 5, '!')<CR> |
||||
vnoremap <script> <silent> <leader>KE |
||||
\ :call cheat#cheat("", -1, -1, -1, 5, '!')<CR> |
||||
" Toggle comments |
||||
nnoremap <script> <silent> <leader>KC :call cheat#navigate(0, 'C')<CR> |
||||
vnoremap <script> <silent> <leader>KC :call cheat#navigate(0, 'C')<CR> |
||||
|
||||
" Next |
||||
nnoremap <script> <silent> <leader>KQN :call cheat#navigate(1,'Q')<CR> |
||||
vnoremap <script> <silent> <leader>KQN :call cheat#navigate(1,'Q')<CR> |
||||
nnoremap <script> <silent> <leader>KAN :call cheat#navigate(1, 'A')<CR> |
||||
vnoremap <script> <silent> <leader>KAN :call cheat#navigate(1, 'A')<CR> |
||||
nnoremap <script> <silent> <leader>KHN :call cheat#navigate(1, 'H')<CR> |
||||
vnoremap <script> <silent> <leader>KHN :call cheat#navigate(1, 'H')<CR> |
||||
|
||||
" Prev |
||||
nnoremap <script> <silent> <leader>KQP :call cheat#navigate(-1,'Q')<CR> |
||||
vnoremap <script> <silent> <leader>KQP :call cheat#navigate(-1,'Q')<CR> |
||||
nnoremap <script> <silent> <leader>KAP :call cheat#navigate(-1,'A')<CR> |
||||
vnoremap <script> <silent> <leader>KAP :call cheat#navigate(-1,'A')<CR> |
||||
nnoremap <script> <silent> <leader>KHP :call cheat#navigate(-1, 'H')<CR> |
||||
vnoremap <script> <silent> <leader>KHP :call cheat#navigate(-1, 'H')<CR> |
||||
|
||||
" See Also |
||||
nnoremap <script> <silent> <leader>KSN :call cheat#navigate(1,'S')<CR> |
||||
vnoremap <script> <silent> <leader>KSN :call cheat#navigate(1,'S')<CR> |
||||
nnoremap <script> <silent> <leader>KSP :call cheat#navigate(-1,'S')<CR> |
||||
vnoremap <script> <silent> <leader>KSP :call cheat#navigate(-1,'S')<CR> |
||||
|
||||
" Frameworks switch |
||||
nnoremap <script> <silent> <leader>Kf |
||||
\ :call cheat#frameworks#cycle(1)<CR> |
||||
vnoremap <script> <silent> <leader>Kf |
||||
\ :call cheat#frameworks#cycle(1)<CR> |
||||
nnoremap <script> <silent> <leader>KF |
||||
\ :call cheat#frameworks#cycle(-1)<CR> |
||||
vnoremap <script> <silent> <leader>KF |
||||
\ :call cheat#frameworks#cycle(-1)<CR> |
||||
nnoremap <script> <silent> <leader>Kt |
||||
\ :call cheat#frameworks#cycle(0)<CR> |
||||
vnoremap <script> <silent> <leader>Kt |
||||
\ :call cheat#frameworks#cycle(0)<CR> |
||||
nnoremap <script> <silent> <leader>KT |
||||
\ :call cheat#frameworks#autodetect(1)<CR> |
||||
vnoremap <script> <silent> <leader>KT |
||||
\ :call cheat#frameworks#autodetect(1)<CR> |
||||
endif |
||||
|
||||
if(!exists("g:CheatSheetDisableFrameworkDetection") |
||||
\ || g:CheatSheetDisableFrameworkDetection == 0) |
||||
augroup cheat_group |
||||
autocmd! |
||||
autocmd BufReadPost,BufNewFile * call cheat#frameworks#autodetect(0) |
||||
augroup END |
||||
endif |
||||
|
||||
try |
||||
function SyntasticCheckHook(errors) |
||||
call cheat#providers#syntastic#Hook(a:errors) |
||||
endfunction |
||||
endtry |
||||
|
||||
let cpo=save_cpo |
||||
" vim:set et sw=4: |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash |
||||
\vim -E -c "CheatPager! $@" -c q |
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
" cheat.sh {{{ |
||||
|
||||
" Cheat sheet file type |
||||
let g:CheatSheetFt='markdown' |
||||
|
||||
" Program used to retrieve cheat sheet with its arguments |
||||
let g:CheatSheetUrlGetter='curl --silent' |
||||
|
||||
" Flag to add cookie file to the query |
||||
let g:CheatSheetUrlGetterIdFlag='-b' |
||||
|
||||
" cheat sheet base url |
||||
let g:CheatSheetBaseUrl='https://cht.sh' |
||||
|
||||
" cheat sheet settings do not include style settings neiter comments, |
||||
" see other options below |
||||
let g:CheatSheetUrlSettings='q' |
||||
|
||||
" cheat sheet pager |
||||
let g:CheatPager='less -R' |
||||
|
||||
" Show comments in answers by default |
||||
" (setting this to 0 means giving ?Q to the server) |
||||
let g:CheatSheetShowCommentsByDefault=0 |
||||
|
||||
" cheat sheet buffer name |
||||
let g:CheatSheetBufferName="_cheat" |
||||
|
||||
" Default selection in normal mode (line for whole line, word for word under cursor) |
||||
let g:CheatSheetDefaultSelection="line" |
||||
|
||||
" Default query mode |
||||
" 0 => buffer |
||||
" 1 => replace (do not use or you might loose some lines of code) |
||||
" 2 => pager |
||||
" 3 => paste after query |
||||
" 4 => paste before query |
||||
let g:CheatSheetDefaultMode=0 |
||||
|
||||
let g:CheatSheetFrameworks = {} |
||||
|
||||
" imap <script> <silent> <C-O> |
||||
" \ <ESC>:call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 0, '!')<CR> |
||||
|
||||
" }}} |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
--- ./commentToggle.vim 2010-10-30 17:29:40.000000000 +0600
|
||||
+++ /home/maks/.shellrc/config/soft/vim_old/vim/plugin/commentToggle.vim 2010-09-04 13:06:25.000000000 +0600
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
" all languages are defined as a list with the comment opening string in position 0 and the closing string in position 1
|
||||
" languages which support single line comments simply have an empty string in position 1
|
||||
-let s:commStrings = {"abap":['\*',''], "abc":['%',''], "ada":['--',''], "apache":['#',''], "asterisk":[';',''], "awk":['#',''], "basic":['rem',''], "bcpl":['//',''], "c":['//',''], "cecil":['--',''], "cfg":['#',''], "clean":['//',''], "cmake":['#',''], "cobol":['\*',''], "cpp":['//',''], "cs":['//',''], "css":['/\*','\*/'], "d":['//',''], "debcontrol":['#',''], "diff":['#',''], "dtml":['<!--','-->'], "dylan":['//',''], "e":['#',''], "eiffel":['--',''], "erlang":['%',''], "euphora":['--',''], "forth":['\',''], "fortan":['C ',''], "foxpro":['\*',''], "fs":['//',''], "groovy":['//',''], "grub":['#',''], "icon":['#',''], "io":['#',''], "j":['NB.',''], "java":['//',''], "javascript":['//',''], "haskell":['--',''], "html":['<!--','-->'], "htmldjango":['<!--','-->'], "htmlm4":['<!--','-->'], "lex":['//',''], "lhaskell":['%',''], "lilo":['#',''], "lisp":[';',''], "logo":[';',''], "lua":['--',''], "make":['#',''], "matlab":['%',''], "maple":['#',''], "merd":['#',''], "mma":['(\*','\*)'], "modula3":['(\*','\*)'], "mumps":[';',''], "natural":['\*',''], "nemerle":['//',''], "objc":['//',''], "objcpp":['//',''], "ocaml":['(\*','\*)'], "oz":['%',''], "pascal":['{','}'], "perl":['#',''], "php":['//',''], "pike":['//',''], "pliant":['#',''], "plsql":['--',''], "postscr":['%',''], "prolog":['%',''], "python":['#',''], "rebol":[';',''], "rexx":['/\*','\*/'], "ruby":['#',''], "sas":['/\*','\*/'], "sather":['--',''], "scala":['//',''], "scheme":[';',''], "sed":['#',''], "sgml":['<!--','-->'], "sh":['#',''], "sieve":['#',''], "simula":['--',''], "sql":['--',''], "st":['"','"'], "tcl":['#',''], "tex":['%',''], "vhdl":['--',''], "vim":['"',''], "xf86conf":['#',''], "xhtml":['<!--','-->'], "xml":['<!--','-->'], "xquery":['<!--','-->'], "xsd":['<!--','-->'], "yacc":['//',''], "yaml":['#',''], "ycp":['//',''], "yorick":['//','']}
|
||||
+let s:commStrings = {"alex":['--',''],"abap":['\*',''], "abc":['%',''], "ada":['--',''], "apache":['#',''], "asterisk":[';',''], "awk":['#',''], "basic":['rem',''], "bcpl":['//',''], "c":['//',''], "cecil":['--',''], "cfg":['#',''], "clean":['//',''], "cmake":['#',''], "cobol":['\*',''], "cpp":['//',''], "cs":['//',''], "css":['/\*','\*/'], "d":['//',''], "debcontrol":['#',''], "diff":['#',''], "dtml":['<!--','-->'], "dylan":['//',''], "e":['#',''], "eiffel":['--',''], "erlang":['%',''], "euphora":['--',''], "forth":['\',''], "fortan":['C ',''], "foxpro":['\*',''], "fs":['//',''], "groovy":['//',''], "grub":['#',''], "icon":['#',''], "io":['#',''], "j":['NB.',''], "java":['//',''], "javascript":['//',''], "haskell":['--',''], "html":['<!--','-->'], "htmldjango":['<!--','-->'], "htmlm4":['<!--','-->'], "lex":['//',''], "lhaskell":['%',''], "lilo":['#',''], "lisp":[';',''], "logo":[';',''], "lua":['--',''], "make":['#',''], "matlab":['%',''], "maple":['#',''], "merd":['#',''], "mma":['(\*','\*)'], "modula3":['(\*','\*)'], "mumps":[';',''], "natural":['\*',''], "nemerle":['//',''], "objc":['//',''], "objcpp":['//',''], "ocaml":['(\*','\*)'], "oz":['%',''], "pascal":['{','}'], "perl":['#',''], "php":['//',''], "pike":['//',''], "pliant":['#',''], "plsql":['--',''], "postscr":['%',''], "prolog":['%',''], "python":['#',''], "rebol":[';',''], "rexx":['/\*','\*/'], "ruby":['#',''], "sas":['/\*','\*/'], "sather":['--',''], "scala":['//',''], "scheme":[';',''], "sed":['#',''], "sgml":['<!--','-->'], "sh":['#',''], "sieve":['#',''], "simula":['--',''], "sql":['--',''], "st":['"','"'], "tcl":['#',''], "tex":['%',''], "vhdl":['--',''], "vim":['"',''], "xf86conf":['#',''], "xhtml":['<!--','-->'], "xml":['<!--','-->'], "xquery":['<!--','-->'], "xsd":['<!--','-->'], "yacc":['//',''], "yaml":['#',''], "ycp":['//',''], "yorick":['//',''], "mysql":['--','']}
|
||||
|
||||
" ===============================================================================================================================
|
||||
|
@ -0,0 +1,114 @@
@@ -0,0 +1,114 @@
|
||||
" description: a simple line-based commenting toggler |
||||
" maintainer: kamil.stachowski@gmail.com |
||||
" license: gpl 3+ |
||||
" version: 0.2 (2008.11.11) |
||||
|
||||
" changelog: |
||||
" 0.2: 2008.11.11 |
||||
" improved whitespace handling |
||||
" added languages: apache, asterisk, c, cfg, clean, cmake, css, d, debcontrol, diff, dtml, euphoria, foxpro, groovy, grub, htmldjango, htmlm4, lex, lhaskell, lilo, make, natural, nemerle, objc, objcpp, ,plsql, rexx, sas, scala, sed, sieve, sgml, xf86conf, xhtml, xquery, xsd, yacc, xhtml (total 93) |
||||
" 0.1: 2008.11.08 |
||||
" initial version |
||||
" |
||||
" TODO: do sth about block comments |
||||
" TODO: better guessing for undefined languages |
||||
" TODO: add support for scheme's multiple ;'s |
||||
|
||||
|
||||
|
||||
" =============================================================================================================================== |
||||
|
||||
" make sure the plugin hasn't been loaded yet and save something |
||||
if exists("g:loaded_commentToggle") || &cp |
||||
finish |
||||
endif |
||||
let g:loaded_commentToggle = "v0.2" |
||||
let s:cpoSave = &cpo |
||||
set cpo&vim |
||||
|
||||
" ------------------------------------------------------------------------------------------------------------------------------- |
||||
|
||||
" assign a shortcut |
||||
if !hasmapto('<Plug>CommentToggle') |
||||
map <unique> <Leader>; <Plug>CommentToggle |
||||
endif |
||||
noremap <silent> <unique> <script> <Plug>CommentToggle :call <SID>CommentToggle()<CR> |
||||
noremenu <script> Plugin.Add\ CommentToggle <SID>CommentToggle |
||||
|
||||
" and a command just in case |
||||
if !exists(":commentToggle") |
||||
command -nargs=1 CommentToggle :call s:CommentToggle() |
||||
endif |
||||
|
||||
" =============================================================================================================================== |
||||
|
||||
" all languages are defined as a list with the comment opening string in position 0 and the closing string in position 1 |
||||
" languages which support single line comments simply have an empty string in position 1 |
||||
let s:commStrings = {"alex":['--',''],"abap":['\*',''], "abc":['%',''], "ada":['--',''], "apache":['#',''], "asterisk":[';',''], "awk":['#',''], "basic":['rem',''], "bcpl":['//',''], "c":['//',''], "cecil":['--',''], "cfg":['#',''], "clean":['//',''], "cmake":['#',''], "cobol":['\*',''], "cpp":['//',''], "cs":['//',''], "css":['/\*','\*/'], "d":['//',''], "debcontrol":['#',''], "diff":['#',''], "dtml":['<!--','-->'], "dylan":['//',''], "e":['#',''], "eiffel":['--',''], "erlang":['%',''], "euphora":['--',''], "forth":['\',''], "fortan":['C ',''], "foxpro":['\*',''], "fs":['//',''], "groovy":['//',''], "grub":['#',''], "icon":['#',''], "io":['#',''], "j":['NB.',''], "java":['//',''], "javascript":['//',''], "haskell":['--',''], "html":['<!--','-->'], "htmldjango":['<!--','-->'], "htmlm4":['<!--','-->'], "lex":['//',''], "lhaskell":['%',''], "lilo":['#',''], "lisp":[';',''], "logo":[';',''], "lua":['--',''], "make":['#',''], "matlab":['%',''], "maple":['#',''], "merd":['#',''], "mma":['(\*','\*)'], "modula3":['(\*','\*)'], "mumps":[';',''], "natural":['\*',''], "nemerle":['//',''], "objc":['//',''], "objcpp":['//',''], "ocaml":['(\*','\*)'], "oz":['%',''], "pascal":['{','}'], "perl":['#',''], "php":['//',''], "pike":['//',''], "pliant":['#',''], "plsql":['--',''], "postscr":['%',''], "prolog":['%',''], "python":['#',''], "rebol":[';',''], "rexx":['/\*','\*/'], "ruby":['#',''], "sas":['/\*','\*/'], "sather":['--',''], "scala":['//',''], "scheme":[';',''], "sed":['#',''], "sgml":['<!--','-->'], "sh":['#',''], "sieve":['#',''], "simula":['--',''], "sql":['--',''], "st":['"','"'], "tcl":['#',''], "tex":['%',''], "vhdl":['--',''], "vim":['"',''], "xf86conf":['#',''], "xhtml":['<!--','-->'], "xml":['<!--','-->'], "xquery":['<!--','-->'], "xsd":['<!--','-->'], "yacc":['//',''], "yaml":['#',''], "ycp":['//',''], "yorick":['//',''], "mysql":['--',''], "dockerfile":['#',''], "terraform":['#','']} |
||||
|
||||
" =============================================================================================================================== |
||||
|
||||
" check if line aLineNr begins with string |
||||
function! s:CommentCheckCommented(aLineNr, aCommStr) |
||||
" check if the line begins with the comment opening string, ignoring whitespace |
||||
return match(getline(a:aLineNr), '^\s*' . a:aCommStr[0]) == "" |
||||
endfunction |
||||
|
||||
" ------------------------------------------------------------------------------------------------------------------------------- |
||||
|
||||
" find the comment string for syntax aSynCurr |
||||
function! s:CommentCheckString(aSynCurr) |
||||
if has_key(s:commStrings, a:aSynCurr) |
||||
" if we have the comment strings for the current syntax defined, take those |
||||
return s:commStrings[a:aSynCurr] |
||||
else |
||||
" TODO: doesn't work for all syntaxes |
||||
" i don't know how to properly extract the comment string for the current syntax; &comments is probably not the way |
||||
" check &comments and extract the one without any flags; alas, it's not always the string we're looking for |
||||
let s:result = "" |
||||
for s:tmp in split(&comments, ",") |
||||
if s:tmp[0] == ":" |
||||
let s:result = s:tmp[1:-1] |
||||
break |
||||
endif |
||||
endfor |
||||
return [s:result, ""] |
||||
endif |
||||
endfunction |
||||
|
||||
" ------------------------------------------------------------------------------------------------------------------------------- |
||||
|
||||
" the main part |
||||
" finds the comment string for the current syntax, and if the current line is already commented; |
||||
" if it is, it uncomments it; if it's not, it uncomments it |
||||
function! s:CommentToggle() |
||||
let s:commStr = s:CommentCheckString(&syntax) |
||||
let s:commed = s:CommentCheckCommented(line("."), s:commStr) |
||||
if match(getline(line(".")), '\S') != -1 " no point commenting empty lines |
||||
call s:CommentToggleHelper(line("."), s:commStr, s:commed) |
||||
endif |
||||
endfunction |
||||
|
||||
" ------------------------------------------------------------------------------------------------------------------------------- |
||||
|
||||
" toggles comment on line aLineNr with string aCommStr depending on whether the line is already commented (aCommed) |
||||
function! s:CommentToggleHelper(aLineNr, aCommStr, aCommed) |
||||
if a:aCommed |
||||
let s:tmpToBeSubsted = '\(\s*\)' . a:aCommStr[0] . '\(\s*\)\(.\{-}\)\(\s*\)' . a:aCommStr[1] |
||||
let s:tmpToSubst = '\1\3' " remove the comment string(s) and all superfluous whitespace (hence greedy match in \3) |
||||
else |
||||
let s:tmpToBeSubsted='\(\s*\)\(.*\)'" leave the whitespace in the beginning untouched |
||||
let s:tmpToSubst = '\1' . a:aCommStr[0] . ' \2' " add extra spaces inside the comment string |
||||
if a:aCommStr[1] != "" " but not after it in case the language supports single line comments |
||||
let s:tmpToSubst = s:tmpToSubst . ' ' . a:aCommStr[1] |
||||
endif |
||||
endif |
||||
call setline(a:aLineNr, substitute(getline(a:aLineNr), s:tmpToBeSubsted, s:tmpToSubst, "")) |
||||
endfunction |
||||
|
||||
|
||||
" =============================================================================================================================== |
||||
|
||||
|
||||
let &cpo = s:cpoSave |
||||
unlet s:cpoSave |
@ -0,0 +1,123 @@
@@ -0,0 +1,123 @@
|
||||
*errormarker* Plugin to highlight error positions v0.1.13 |
||||
|
||||
ERROR MARKER REFERENCE MANUAL ~ |
||||
|
||||
1. Usage |errormarker-usage| |
||||
2. Customization |errormarker-customization| |
||||
3. Credits |errormarker-credits| |
||||
4. Changelog |errormarker-changelog| |
||||
|
||||
This plugin is only available if Vim was compiled with the |+signs| feature |
||||
and 'compatible' is not set. |
||||
|
||||
============================================================================== |
||||
1. USAGE *errormarker-usage* |
||||
|
||||
This plugin hooks the quickfix command |QuickFixCmdPost| and generates error |
||||
markers for every line that contains an error. Vim has to be compiled with |
||||
|+signs| for this to work. |
||||
|
||||
Additionally, a tooltip with the error message is shown when you hover with |
||||
the mouse over a line with an error (only available when compiled with the |
||||
|+balloon_eval| feature), or when you press <Leader>cc in normal mode. This |
||||
functionality is also available with the |:ErrorAtCursor| command. |
||||
|
||||
The functionality mentioned here is a plugin, see |add-plugin|. This plugin is |
||||
only available if 'compatible' is not set and Vim was compiled with |+signs| |
||||
and |+autocmd| support. You can avoid loading this plugin by setting the |
||||
"loaded_errormarker" variable in your |vimrc| file: > |
||||
:let loaded_errormarker = 1 |
||||
|
||||
============================================================================== |
||||
2. CUSTOMIZATION *errormarker-customization* |
||||
|
||||
You can customize the signs that are used by Vim to mark warnings and errors |
||||
(see |:sign-define| for details). |
||||
|
||||
*errormarker_erroricon* *errormarker_warningicon* |
||||
The icons that are used for the warnings and error signs in the GUI version of |
||||
Vim can be set by > |
||||
:let errormarker_erroricon = "/path/to/error/icon/name.png" |
||||
:let errormarker_warningicon = "/path/to/warning/icon/name.png" |
||||
If an icon is not found, text-only markers are displayed instead. The bitmap |
||||
should fit into the place of two characters. |
||||
|
||||
You must use full paths for these variables, for icons in your home directory |
||||
expand the paths in your .vimrc with something like > |
||||
:let errormarker_erroricon = expand ("~/.vim/icons/error.png") |
||||
To get working icons on Microsoft Windows, place icons for errors and warnings |
||||
(you can use Google at http://images.google.com/images?q=error&imgsz=icon to |
||||
find some nice ones) as error.bmp and warning.bmp in your home directory at |
||||
C:\Documents and Settings\<user>\vimfiles\icons. |
||||
|
||||
*errormarker_errortext* *errormarker_warningtext* |
||||
The text that is displayed without a GUI or if the icon files can not be found |
||||
can be set by > |
||||
:let errormarker_errortext = "Er" |
||||
:let errormarker_warningtext = "Wa" |
||||
The maximum length is two characters. |
||||
|
||||
*errormarker_errorgroup* *errormarker_warninggroup* |
||||
The hightlighting groups that are used to mark the lines that contain warnings |
||||
and errors can be set by > |
||||
:let errormarker_errorgroup = "ErrorMsg" |
||||
:let errormarker_warninggroup = "Todo" |
||||
< |
||||
*errormarker_warningtypes* |
||||
If the compiler reports a severity for the error messages this can be used to |
||||
distinguish between warnings and errors. Vim uses a single character error |
||||
type that can be parsed with |errorformat| (%t). The error types that should |
||||
be treated as warnings can be set by > |
||||
let errormarker_warningtypes = "wWiI" |
||||
|
||||
For example, the severity of error messages from gcc |
||||
averagergui.cpp|18 warning| unused parameter ‘file’ ~ |
||||
averagergui.cpp|33 error| expected class-name before ‘I’ ~ |
||||
can be parsed by adding the following lines to your .vimrc > |
||||
let &errorformat="%f:%l: %t%*[^:]:%m," . &errorformat |
||||
let &errorformat="%f:%l:%c: %t%*[^:]:%m," . &errorformat |
||||
let errormarker_warningtypes = "wW" |
||||
|
||||
If you use a different locale than English, this may also be needed: > |
||||
set makeprg=LANGUAGE=C\ make |
||||
< |
||||
*errormarker_disablemappings* *\cc* *:ErrorAtCursor* |
||||
To show the error message at the cursor position (e.g. if you are working from |
||||
within a terminal, where tooltips are not available), the following command |
||||
and shortcut are defined: > |
||||
:ErrorAtCursor |
||||
:nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR> |
||||
|
||||
The shortcut is only defined if no other mapping to ErrorAtCursor<CR> can be |
||||
found, and can be completely disabled by > |
||||
let errormarker_disablemappings = 1 |
||||
< |
||||
|
||||
============================================================================== |
||||
3. CREDITS *errormarker-credits* |
||||
|
||||
Author: Michael Hofmann <mh21 at piware dot de> |
||||
|
||||
============================================================================== |
||||
4. CHANGELOG *errormarker-changelog* |
||||
|
||||
0.1.13 - shortcut can be disabled (thanks Michael Jansen) |
||||
0.1.12 - shortcut (<Leader>cc) to show error at cursor (thanks Eric Rannaud) |
||||
0.1.11 - changelog fix |
||||
0.1.10 - removes accidental dependency on NerdEcho |
||||
0.1.9 - fixes Win32 icon display |
||||
0.1.8 - check for Vim version |
||||
0.1.7 - fixes gcc error message parsing example |
||||
0.1.6 - support for GetLatestVimScripts (vimscript#642) |
||||
0.1.5 - clarified documentation about paths |
||||
0.1.4 - fixes icon name and variable escaping |
||||
0.1.3 - customizable signs |
||||
- distinguishes between warnings and errors |
||||
0.1.2 - documentation |
||||
0.1.1 - handles nonexistent icons gracefully |
||||
- tooltips only used if Vim has balloon-eval support |
||||
0.1 - initial release |
||||
|
||||
============================================================================== |
||||
|
||||
vim:tw=78:ts=8:ft=help:norl: |
@ -0,0 +1,401 @@
@@ -0,0 +1,401 @@
|
||||
" ============================================================================ |
||||
" Copyright: Copyright (C) 2007,2010 Michael Hofmann |
||||
" Permission is hereby granted to use and distribute this code, |
||||
" with or without modifications, provided that this copyright |
||||
" notice is copied with it. Like anything else that's free, |
||||
" errormarker.vim is provided *as is* and comes with no |
||||
" warranty of any kind, either expressed or implied. In no |
||||
" event will the copyright holder be liable for any damages |
||||
" resulting from the use of this software. |
||||
" Name Of File: errormarker.vim |
||||
" Description: Sets markers for compile errors |
||||
" Maintainer: Michael Hofmann (mh21 at piware dot de) |
||||
" Version: See g:loaded_errormarker for version number. |
||||
" Usage: Normally, this file should reside in the plugins |
||||
" directory and be automatically sourced. If not, you must |
||||
" manually source this file using ':source errormarker.vim'. |
||||
|
||||
" === Support for automatic retrieval (Vim script 642) ==================={{{1 |
||||
|
||||
" GetLatestVimScripts: 1861 1 :AutoInstall: errormarker.vim |
||||
|
||||
" === Initialization ====================================================={{{1 |
||||
|
||||
" Exit when the Vim version is too old or missing some features |
||||
if v:version < 700 || !has("signs") || !has("autocmd") |
||||
finish |
||||
endif |
||||
|
||||
" Exit quickly when the script has already been loaded or when 'compatible' |
||||
" is set. |
||||
if exists("g:loaded_errormarker") || &compatible |
||||
finish |
||||
endif |
||||
|
||||
" Version number. |
||||
let g:loaded_errormarker = "0.1.13" |
||||
|
||||
let s:save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
command ErrorAtCursor call ShowErrorAtCursor() |
||||
if !hasmapto(":ErrorAtCursor<cr>", "n") && |
||||
\ (!exists('g:errormarker_disablemappings') || !g:errormarker_disablemappings) |
||||
nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR> |
||||
endif |
||||
|
||||
function! s:DefineVariable(name, default) |
||||
if !exists(a:name) |
||||
execute 'let ' . a:name . ' = "' . escape(a:default, '\"') . '"' |
||||
endif |
||||
endfunction |
||||
|
||||
" === Variables =========================================================={{{1 |
||||
|
||||
" Defines the icon to show for errors in the gui |
||||
call s:DefineVariable("g:errormarker_erroricon", |
||||
\ has('win32') ? expand("~/vimfiles/icons/error.bmp") : |
||||
\ "/usr/share/icons/gnome/16x16/status/dialog-error.png") |
||||
|
||||
" Defines the icon to show for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warningicon", |
||||
\ has('win32') ? expand("~/vimfiles/icons/warning.bmp") : |
||||
\ "/usr/share/icons/gnome/16x16/status/dialog-warning.png") |
||||
|
||||
" Defines the text (two characters) to show for errors in the gui |
||||
call s:DefineVariable("g:errormarker_errortext", "EE") |
||||
|
||||
" Defines the text (two characters) to show for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warningtext", "WW") |
||||
|
||||
" Defines the highlighting group to use for errors in the gui |
||||
call s:DefineVariable("g:errormarker_errorgroup", "Todo") |
||||
|
||||
" Defines the highlighting group to use for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warninggroup", "Todo") |
||||
|
||||
" Defines the error types that should be treated as warning |
||||
call s:DefineVariable("g:errormarker_warningtypes", "wW") |
||||
|
||||
" === Global ============================================================={{{1 |
||||
|
||||
" Define the signs |
||||
let s:erroricon = "" |
||||
if filereadable(g:errormarker_erroricon) |
||||
let s:erroricon = " icon=" . escape(g:errormarker_erroricon, '| \') |
||||
endif |
||||
let s:warningicon = "" |
||||
if filereadable(g:errormarker_warningicon) |
||||
let s:warningicon = " icon=" . escape(g:errormarker_warningicon, '| \') |
||||
endif |
||||
execute "sign define errormarker_error text=" . g:errormarker_errortext . |
||||
\ " linehl=" . g:errormarker_errorgroup . s:erroricon |
||||
|
||||
execute "sign define errormarker_warning text=" . g:errormarker_warningtext . |
||||
\ " linehl=" . g:errormarker_warninggroup . s:warningicon |
||||
|
||||
" Setup the autocommands that handle the MRUList and other stuff. |
||||
augroup errormarker |
||||
autocmd QuickFixCmdPost make call <SID>SetErrorMarkers() |
||||
augroup END |
||||
|
||||
" === Functions =========================================================={{{1 |
||||
|
||||
function! ShowErrorAtCursor() |
||||
let [l:bufnr, l:lnum] = getpos(".")[0:1] |
||||
let l:bufnr = bufnr("%") |
||||
for l:d in getqflist() |
||||
if (l:d.bufnr != l:bufnr || l:d.lnum != l:lnum) |
||||
continue |
||||
endif |
||||
redraw | echomsg l:d.text |
||||
endfor |
||||
echo |
||||
endfunction |
||||
|
||||
function! s:SetErrorMarkers() |
||||
if has ('balloon_eval') |
||||
let &balloonexpr = "<SNR>" . s:SID() . "_ErrorMessageBalloons()" |
||||
set ballooneval |
||||
endif |
||||
|
||||
sign unplace * |
||||
|
||||
let l:positions = {} |
||||
for l:d in getqflist() |
||||
if (l:d.bufnr == 0 || l:d.lnum == 0) |
||||
continue |
||||
endif |
||||
|
||||
let l:key = l:d.bufnr . l:d.lnum |
||||
if has_key(l:positions, l:key) |
||||
continue |
||||
endif |
||||
let l:positions[l:key] = 1 |
||||
|
||||
if strlen(l:d.type) && |
||||
\ stridx(g:errormarker_warningtypes, l:d.type) >= 0 |
||||
let l:name = "errormarker_warning" |
||||
else |
||||
let l:name = "errormarker_error" |
||||
endif |
||||
execute ":sign place " . l:key . " line=" . l:d.lnum . " name=" . |
||||
\ l:name . " buffer=" . l:d.bufnr |
||||
endfor |
||||
endfunction |
||||
|
||||
function! s:ErrorMessageBalloons() |
||||
for l:d in getqflist() |
||||
if (d.bufnr == v:beval_bufnr && d.lnum == v:beval_lnum) |
||||
return l:d.text |
||||
endif |
||||
endfor |
||||
return "" |
||||
endfunction |
||||
|
||||
function! s:SID() |
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$') |
||||
endfunction |
||||
|
||||
" === Help file installation ============================================={{{1 |
||||
|
||||
" Original version: Copyright (C) Mathieu Clabaut, author of vimspell |
||||
" http://www.vim.org/scripts/script.php?script_id=465 |
||||
function! s:InstallDocumentation(full_name, revision) |
||||
" Name of the document path based on the system we use: |
||||
if has("vms") |
||||
" No chance that this script will work with |
||||
" VMS - to much pathname juggling here. |
||||
return 1 |
||||
elseif (has("unix")) |
||||
" On UNIX like system, using forward slash: |
||||
let l:slash_char = '/' |
||||
let l:mkdir_cmd = ':silent !mkdir -p ' |
||||
else |
||||
" On M$ system, use backslash. Also mkdir syntax is different. |
||||
" This should only work on W2K and up. |
||||
let l:slash_char = '\' |
||||
let l:mkdir_cmd = ':silent !mkdir ' |
||||
endif |
||||
|
||||
let l:doc_path = l:slash_char . 'doc' |
||||
let l:doc_home = l:slash_char . '.vim' . l:slash_char . 'doc' |
||||
|
||||
" Figure out document path based on full name of this script: |
||||
let l:vim_plugin_path = fnamemodify(a:full_name, ':h') |
||||
let l:vim_doc_path = fnamemodify(a:full_name, ':h:h') . l:doc_path |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
echo "Creating doc path: " . l:vim_doc_path |
||||
execute l:mkdir_cmd . '"' . l:vim_doc_path . '"' |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
" Try a default configuration in user home: |
||||
let l:vim_doc_path = expand("~") . l:doc_home |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
execute l:mkdir_cmd . '"' . l:vim_doc_path . '"' |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
echohl WarningMsg |
||||
echo "Unable to create documentation directory.\ntype :help add-local-help for more information." |
||||
echohl None |
||||
return 0 |
||||
endif |
||||
endif |
||||
endif |
||||
endif |
||||
|
||||
" Exit if we have problem to access the document directory: |
||||
if (!isdirectory(l:vim_plugin_path) || !isdirectory(l:vim_doc_path) || filewritable(l:vim_doc_path) != 2) |
||||
return 0 |
||||
endif |
||||
|
||||
" Full name of script and documentation file: |
||||
let l:script_name = fnamemodify(a:full_name, ':t') |
||||
let l:doc_name = fnamemodify(a:full_name, ':t:r') . '.txt' |
||||
let l:plugin_file = l:vim_plugin_path . l:slash_char . l:script_name |
||||
let l:doc_file = l:vim_doc_path . l:slash_char . l:doc_name |
||||
|
||||
" Bail out if document file is still up to date: |
||||
if (filereadable(l:doc_file) && getftime(l:plugin_file) < getftime(l:doc_file)) |
||||
return 0 |
||||
endif |
||||
|
||||
" Prepare window position restoring command: |
||||
if (strlen(@%)) |
||||
let l:go_back = 'b ' . bufnr("%") |
||||
else |
||||
let l:go_back = 'enew!' |
||||
endif |
||||
|
||||
" Create a new buffer & read in the plugin file (me): |
||||
setl nomodeline |
||||
exe 'enew!' |
||||
silent exe 'r ' . l:plugin_file |
||||
|
||||
setl modeline |
||||
let l:buf = bufnr("%") |
||||
setl noswapfile modifiable |
||||
|
||||
norm zR |
||||
norm gg |
||||
|
||||
" Delete from first line to a line starts with |
||||
" === START_DOC |
||||
silent 1,/^=\{3,}\s\+START_DOC\C/ d |
||||
|
||||
" Delete from a line starts with |
||||
" === END_DOC |
||||
" to the end of the documents: |
||||
silent /^=\{3,}\s\+END_DOC\C/,$ d |
||||
|
||||
" Add modeline for help doc: the modeline string is mangled intentionally |
||||
" to avoid it be recognized by Vim: |
||||
call append(line('$'), '') |
||||
call append(line('$'), ' v' . 'im:tw=78:ts=8:ft=help:norl:') |
||||
|
||||
" Replace revision: |
||||
silent exe "normal :1s/#version#/ v" . a:revision . "/\<CR>" |
||||
|
||||
" Save the help document: |
||||
silent exe 'w! ' . l:doc_file |
||||
exe l:go_back |
||||
exe 'bw ' . l:buf |
||||
|
||||
" Build help tags: |
||||
exe 'helptags ' . l:vim_doc_path |
||||
|
||||
return 1 |
||||
endfunction |
||||
|
||||
call s:InstallDocumentation(expand('<sfile>:p'), g:loaded_errormarker) |
||||
|
||||
" === Cleanup ============================================================{{{1 |
||||
|
||||
let &cpo = s:save_cpo |
||||
|
||||
finish |
||||
|
||||
" === Help file =========================================================={{{1 |
||||
=== START_DOC |
||||
*errormarker* Plugin to highlight error positions #version# |
||||
|
||||
ERROR MARKER REFERENCE MANUAL ~ |
||||
|
||||
1. Usage |errormarker-usage| |
||||
2. Customization |errormarker-customization| |
||||
3. Credits |errormarker-credits| |
||||
4. Changelog |errormarker-changelog| |
||||
|
||||
This plugin is only available if Vim was compiled with the |+signs| feature |
||||
and 'compatible' is not set. |
||||
|
||||
============================================================================== |
||||
1. USAGE *errormarker-usage* |
||||
|
||||
This plugin hooks the quickfix command |QuickFixCmdPost| and generates error |
||||
markers for every line that contains an error. Vim has to be compiled with |
||||
|+signs| for this to work. |
||||
|
||||
Additionally, a tooltip with the error message is shown when you hover with |
||||
the mouse over a line with an error (only available when compiled with the |
||||
|+balloon_eval| feature), or when you press <Leader>cc in normal mode. This |
||||
functionality is also available with the |:ErrorAtCursor| command. |
||||
|
||||
The functionality mentioned here is a plugin, see |add-plugin|. This plugin is |
||||
only available if 'compatible' is not set and Vim was compiled with |+signs| |
||||
and |+autocmd| support. You can avoid loading this plugin by setting the |
||||
"loaded_errormarker" variable in your |vimrc| file: > |
||||
:let loaded_errormarker = 1 |
||||
|
||||
============================================================================== |
||||
2. CUSTOMIZATION *errormarker-customization* |
||||
|
||||
You can customize the signs that are used by Vim to mark warnings and errors |
||||
(see |:sign-define| for details). |
||||
|
||||
*errormarker_erroricon* *errormarker_warningicon* |
||||
The icons that are used for the warnings and error signs in the GUI version of |
||||
Vim can be set by > |
||||
:let errormarker_erroricon = "/path/to/error/icon/name.png" |
||||
:let errormarker_warningicon = "/path/to/warning/icon/name.png" |
||||
If an icon is not found, text-only markers are displayed instead. The bitmap |
||||
should fit into the place of two characters. |
||||
|
||||
You must use full paths for these variables, for icons in your home directory |
||||
expand the paths in your .vimrc with something like > |
||||
:let errormarker_erroricon = expand ("~/.vim/icons/error.png") |
||||
To get working icons on Microsoft Windows, place icons for errors and warnings |
||||
(you can use Google at http://images.google.com/images?q=error&imgsz=icon to |
||||
find some nice ones) as error.bmp and warning.bmp in your home directory at |
||||
C:\Documents and Settings\<user>\vimfiles\icons. |
||||
|
||||
*errormarker_errortext* *errormarker_warningtext* |
||||
The text that is displayed without a GUI or if the icon files can not be found |
||||
can be set by > |
||||
:let errormarker_errortext = "Er" |
||||
:let errormarker_warningtext = "Wa" |
||||
The maximum length is two characters. |
||||
|
||||
*errormarker_errorgroup* *errormarker_warninggroup* |
||||
The hightlighting groups that are used to mark the lines that contain warnings |
||||
and errors can be set by > |
||||
:let errormarker_errorgroup = "ErrorMsg" |
||||
:let errormarker_warninggroup = "Todo" |
||||
< |
||||
*errormarker_warningtypes* |
||||
If the compiler reports a severity for the error messages this can be used to |
||||
distinguish between warnings and errors. Vim uses a single character error |
||||
type that can be parsed with |errorformat| (%t). The error types that should |
||||
be treated as warnings can be set by > |
||||
let errormarker_warningtypes = "wWiI" |
||||
|
||||
For example, the severity of error messages from gcc |
||||
averagergui.cpp|18 warning| unused parameter ‘file’ ~ |
||||
averagergui.cpp|33 error| expected class-name before ‘I’ ~ |
||||
can be parsed by adding the following lines to your .vimrc > |
||||
let &errorformat="%f:%l: %t%*[^:]:%m," . &errorformat |
||||
let &errorformat="%f:%l:%c: %t%*[^:]:%m," . &errorformat |
||||
let errormarker_warningtypes = "wW" |
||||
|
||||
If you use a different locale than English, this may also be needed: > |
||||
set makeprg=LANGUAGE=C\ make |
||||
< |
||||
*errormarker_disablemappings* *\cc* *:ErrorAtCursor* |
||||
To show the error message at the cursor position (e.g. if you are working from |
||||
within a terminal, where tooltips are not available), the following command |
||||
and shortcut are defined: > |
||||
:ErrorAtCursor |
||||
:nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR> |
||||
|
||||
The shortcut is only defined if no other mapping to ErrorAtCursor<CR> can be |
||||
found, and can be completely disabled by > |
||||
let errormarker_disablemappings = 1 |
||||
< |
||||
|
||||
============================================================================== |
||||
3. CREDITS *errormarker-credits* |
||||
|
||||
Author: Michael Hofmann <mh21 at piware dot de> |
||||
|
||||
============================================================================== |
||||
4. CHANGELOG *errormarker-changelog* |
||||
|
||||
0.1.13 - shortcut can be disabled (thanks Michael Jansen) |
||||
0.1.12 - shortcut (<Leader>cc) to show error at cursor (thanks Eric Rannaud) |
||||
0.1.11 - changelog fix |
||||
0.1.10 - removes accidental dependency on NerdEcho |
||||
0.1.9 - fixes Win32 icon display |
||||
0.1.8 - check for Vim version |
||||
0.1.7 - fixes gcc error message parsing example |
||||
0.1.6 - support for GetLatestVimScripts (vimscript#642) |
||||
0.1.5 - clarified documentation about paths |
||||
0.1.4 - fixes icon name and variable escaping |
||||
0.1.3 - customizable signs |
||||
- distinguishes between warnings and errors |
||||
0.1.2 - documentation |
||||
0.1.1 - handles nonexistent icons gracefully |
||||
- tooltips only used if Vim has balloon-eval support |
||||
0.1 - initial release |
||||
|
||||
============================================================================== |
||||
=== END_DOC |
||||
|
||||
" vim:ft=vim foldmethod=marker tw=78 |
@ -0,0 +1,401 @@
@@ -0,0 +1,401 @@
|
||||
" ============================================================================ |
||||
" Copyright: Copyright (C) 2007,2010 Michael Hofmann |
||||
" Permission is hereby granted to use and distribute this code, |
||||
" with or without modifications, provided that this copyright |
||||
" notice is copied with it. Like anything else that's free, |
||||
" errormarker.vim is provided *as is* and comes with no |
||||
" warranty of any kind, either expressed or implied. In no |
||||
" event will the copyright holder be liable for any damages |
||||
" resulting from the use of this software. |
||||
" Name Of File: errormarker.vim |
||||
" Description: Sets markers for compile errors |
||||
" Maintainer: Michael Hofmann (mh21 at piware dot de) |
||||
" Version: See g:loaded_errormarker for version number. |
||||
" Usage: Normally, this file should reside in the plugins |
||||
" directory and be automatically sourced. If not, you must |
||||
" manually source this file using ':source errormarker.vim'. |
||||
|
||||
" === Support for automatic retrieval (Vim script 642) ==================={{{1 |
||||
|
||||
" GetLatestVimScripts: 1861 1 :AutoInstall: errormarker.vim |
||||
|
||||
" === Initialization ====================================================={{{1 |
||||
|
||||
" Exit when the Vim version is too old or missing some features |
||||
if v:version < 700 || !has("signs") || !has("autocmd") |
||||
finish |
||||
endif |
||||
|
||||
" Exit quickly when the script has already been loaded or when 'compatible' |
||||
" is set. |
||||
if exists("g:loaded_errormarker") || &compatible |
||||
finish |
||||
endif |
||||
|
||||
" Version number. |
||||
let g:loaded_errormarker = "0.1.13" |
||||
|
||||
let s:save_cpo = &cpo |
||||
set cpo&vim |
||||
|
||||
command ErrorAtCursor call ShowErrorAtCursor() |
||||
if !hasmapto(":ErrorAtCursor<cr>", "n") && |
||||
\ (!exists('g:errormarker_disablemappings') || !g:errormarker_disablemappings) |
||||
nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR> |
||||
endif |
||||
|
||||
function! s:DefineVariable(name, default) |
||||
if !exists(a:name) |
||||
execute 'let ' . a:name . ' = "' . escape(a:default, '\"') . '"' |
||||
endif |
||||
endfunction |
||||
|
||||
" === Variables =========================================================={{{1 |
||||
|
||||
" Defines the icon to show for errors in the gui |
||||
call s:DefineVariable("g:errormarker_erroricon", |
||||
\ has('win32') ? expand("~/vimfiles/icons/error.bmp") : |
||||
\ "/usr/share/icons/gnome/16x16/status/dialog-error.png") |
||||
|
||||
" Defines the icon to show for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warningicon", |
||||
\ has('win32') ? expand("~/vimfiles/icons/warning.bmp") : |
||||
\ "/usr/share/icons/gnome/16x16/status/dialog-warning.png") |
||||
|
||||
" Defines the text (two characters) to show for errors in the gui |
||||
call s:DefineVariable("g:errormarker_errortext", "EE") |
||||
|
||||
" Defines the text (two characters) to show for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warningtext", "WW") |
||||
|
||||
" Defines the highlighting group to use for errors in the gui |
||||
call s:DefineVariable("g:errormarker_errorgroup", "Todo") |
||||
|
||||
" Defines the highlighting group to use for warnings in the gui |
||||
call s:DefineVariable("g:errormarker_warninggroup", "Todo") |
||||
|
||||
" Defines the error types that should be treated as warning |
||||
call s:DefineVariable("g:errormarker_warningtypes", "wW") |
||||
|
||||
" === Global ============================================================={{{1 |
||||
|
||||
" Define the signs |
||||
let s:erroricon = "" |
||||
if filereadable(g:errormarker_erroricon) |
||||
let s:erroricon = " icon=" . escape(g:errormarker_erroricon, '| \') |
||||
endif |
||||
let s:warningicon = "" |
||||
if filereadable(g:errormarker_warningicon) |
||||
let s:warningicon = " icon=" . escape(g:errormarker_warningicon, '| \') |
||||
endif |
||||
execute "sign define errormarker_error text=" . g:errormarker_errortext . |
||||
\ ' texthl=' . g:errormarker_errorgroup . ' linehl=' . g:errormarker_errorgroup |
||||
|
||||
execute "sign define errormarker_warning text=" . g:errormarker_warningtext . |
||||
\ ' texthl=' . g:errormarker_warninggroup . ' linehl=' . g:errormarker_warninggroup |
||||
|
||||
" Setup the autocommands that handle the MRUList and other stuff. |
||||
augroup errormarker |
||||
autocmd QuickFixCmdPost make call <SID>SetErrorMarkers() |
||||
augroup END |
||||
|
||||
" === Functions =========================================================={{{1 |
||||
|
||||
function! ShowErrorAtCursor() |
||||
let [l:bufnr, l:lnum] = getpos(".")[0:1] |
||||
let l:bufnr = bufnr("%") |
||||
for l:d in getqflist() |
||||
if (l:d.bufnr != l:bufnr || l:d.lnum != l:lnum) |
||||
continue |
||||
endif |
||||
redraw | echomsg l:d.text |
||||
endfor |
||||
echo |
||||
endfunction |
||||
|
||||
function! s:SetErrorMarkers() |
||||
if has ('balloon_eval') |
||||
let &balloonexpr = "<SNR>" . s:SID() . "_ErrorMessageBalloons()" |
||||
set ballooneval |
||||
endif |
||||
|
||||
sign unplace * |
||||
|
||||
let l:positions = {} |
||||
for l:d in getqflist() |
||||
if (l:d.bufnr == 0 || l:d.lnum == 0) |
||||
continue |
||||
endif |
||||
|
||||
let l:key = l:d.bufnr . l:d.lnum |
||||
if has_key(l:positions, l:key) |
||||
continue |
||||
endif |
||||
let l:positions[l:key] = 1 |
||||
|
||||
if strlen(l:d.type) && |
||||
\ stridx(g:errormarker_warningtypes, l:d.type) >= 0 |
||||
let l:name = "errormarker_warning" |
||||
else |
||||
let l:name = "errormarker_error" |
||||
endif |
||||
execute ":sign place " . l:key . " line=" . l:d.lnum . " name=" . |
||||
\ l:name . " buffer=" . l:d.bufnr |
||||
endfor |
||||
endfunction |
||||
|
||||
function! s:ErrorMessageBalloons() |
||||
for l:d in getqflist() |
||||
if (d.bufnr == v:beval_bufnr && d.lnum == v:beval_lnum) |
||||
return l:d.text |
||||
endif |
||||
endfor |
||||
return "" |
||||
endfunction |
||||
|
||||
function! s:SID() |
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$') |
||||
endfunction |
||||
|
||||
" === Help file installation ============================================={{{1 |
||||
|
||||
" Original version: Copyright (C) Mathieu Clabaut, author of vimspell |
||||
" http://www.vim.org/scripts/script.php?script_id=465 |
||||
function! s:InstallDocumentation(full_name, revision) |
||||
" Name of the document path based on the system we use: |
||||
if has("vms") |
||||
" No chance that this script will work with |
||||
" VMS - to much pathname juggling here. |
||||
return 1 |
||||
elseif (has("unix")) |
||||
" On UNIX like system, using forward slash: |
||||
let l:slash_char = '/' |
||||
let l:mkdir_cmd = ':silent !mkdir -p ' |
||||
else |
||||
" On M$ system, use backslash. Also mkdir syntax is different. |
||||
" This should only work on W2K and up. |
||||
let l:slash_char = '\' |
||||
let l:mkdir_cmd = ':silent !mkdir ' |
||||
endif |
||||
|
||||
let l:doc_path = l:slash_char . 'doc' |
||||
let l:doc_home = l:slash_char . '.vim' . l:slash_char . 'doc' |
||||
|
||||
" Figure out document path based on full name of this script: |
||||
let l:vim_plugin_path = fnamemodify(a:full_name, ':h') |
||||
let l:vim_doc_path = fnamemodify(a:full_name, ':h:h') . l:doc_path |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
echo "Creating doc path: " . l:vim_doc_path |
||||
execute l:mkdir_cmd . '"' . l:vim_doc_path . '"' |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
" Try a default configuration in user home: |
||||
let l:vim_doc_path = expand("~") . l:doc_home |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
execute l:mkdir_cmd . '"' . l:vim_doc_path . '"' |
||||
if (!(filewritable(l:vim_doc_path) == 2)) |
||||
echohl WarningMsg |
||||
echo "Unable to create documentation directory.\ntype :help add-local-help for more information." |
||||
echohl None |
||||
return 0 |
||||
endif |
||||
endif |
||||
endif |
||||
endif |
||||
|
||||
" Exit if we have problem to access the document directory: |
||||
if (!isdirectory(l:vim_plugin_path) || !isdirectory(l:vim_doc_path) || filewritable(l:vim_doc_path) != 2) |
||||
return 0 |
||||
endif |
||||
|
||||
" Full name of script and documentation file: |
||||
let l:script_name = fnamemodify(a:full_name, ':t') |
||||
let l:doc_name = fnamemodify(a:full_name, ':t:r') . '.txt' |
||||
let l:plugin_file = l:vim_plugin_path . l:slash_char . l:script_name |
||||
let l:doc_file = l:vim_doc_path . l:slash_char . l:doc_name |
||||
|
||||
" Bail out if document file is still up to date: |
||||
if (filereadable(l:doc_file) && getftime(l:plugin_file) < getftime(l:doc_file)) |
||||
return 0 |
||||
endif |
||||
|
||||
" Prepare window position restoring command: |
||||
if (strlen(@%)) |
||||
let l:go_back = 'b ' . bufnr("%") |
||||
else |
||||
let l:go_back = 'enew!' |
||||
endif |
||||
|
||||
" Create a new buffer & read in the plugin file (me): |
||||
setl nomodeline |
||||
exe 'enew!' |
||||
silent exe 'r ' . l:plugin_file |
||||
|
||||
setl modeline |
||||
let l:buf = bufnr("%") |
||||
setl noswapfile modifiable |
||||
|
||||
norm zR |
||||
norm gg |
||||
|
||||
" Delete from first line to a line starts with |
||||
" === START_DOC |
||||
silent 1,/^=\{3,}\s\+START_DOC\C/ d |
||||
|
||||
" Delete from a line starts with |
||||
" === END_DOC |
||||
" to the end of the documents: |
||||
silent /^=\{3,}\s\+END_DOC\C/,$ d |
||||
|
||||
" Add modeline for help doc: the modeline string is mangled intentionally |
||||
" to avoid it be recognized by Vim: |
||||
call append(line('$'), '') |
||||
call append(line('$'), ' v' . 'im:tw=78:ts=8:ft=help:norl:') |
||||
|
||||
" Replace revision: |
||||
silent exe "normal :1s/#version#/ v" . a:revision . "/\<CR>" |
||||
|
||||
" Save the help document: |
||||
silent exe 'w! ' . l:doc_file |
||||
exe l:go_back |
||||
exe 'bw ' . l:buf |
||||
|
||||
" Build help tags: |
||||
exe 'helptags ' . l:vim_doc_path |
||||
|
||||
return 1 |
||||
endfunction |
||||
|
||||
call s:InstallDocumentation(expand('<sfile>:p'), g:loaded_errormarker) |
||||
|
||||
" === Cleanup ============================================================{{{1 |
||||
|
||||
let &cpo = s:save_cpo |
||||
|
||||
finish |
||||
|
||||
" === Help file =========================================================={{{1 |
||||
=== START_DOC |
||||
*errormarker* Plugin to highlight error positions #version# |
||||
|
||||
ERROR MARKER REFERENCE MANUAL ~ |
||||
|
||||
1. Usage |errormarker-usage| |
||||
2. Customization |errormarker-customization| |
||||
3. Credits |errormarker-credits| |
||||
4. Changelog |errormarker-changelog| |
||||
|
||||
This plugin is only available if Vim was compiled with the |+signs| feature |
||||
and 'compatible' is not set. |
||||
|
||||
============================================================================== |
||||
1. USAGE *errormarker-usage* |
||||
|
||||
This plugin hooks the quickfix command |QuickFixCmdPost| and generates error |
||||
markers for every line that contains an error. Vim has to be compiled with |
||||
|+signs| for this to work. |
||||
|
||||
Additionally, a tooltip with the error message is shown when you hover with |
||||
the mouse over a line with an error (only available when compiled with the |
||||
|+balloon_eval| feature), or when you press <Leader>cc in normal mode. This |
||||
functionality is also available with the |:ErrorAtCursor| command. |
||||
|
||||
The functionality mentioned here is a plugin, see |add-plugin|. This plugin is |
||||
only available if 'compatible' is not set and Vim was compiled with |+signs| |
||||
and |+autocmd| support. You can avoid loading this plugin by setting the |
||||
"loaded_errormarker" variable in your |vimrc| file: > |
||||
:let loaded_errormarker = 1 |
||||
|
||||
============================================================================== |
||||
2. CUSTOMIZATION *errormarker-customization* |
||||
|
||||
You can customize the signs that are used by Vim to mark warnings and errors |
||||
(see |:sign-define| for details). |
||||
|
||||
*errormarker_erroricon* *errormarker_warningicon* |
||||
The icons that are used for the warnings and error signs in the GUI version of |
||||
Vim can be set by > |
||||
:let errormarker_erroricon = "/path/to/error/icon/name.png" |
||||
:let errormarker_warningicon = "/path/to/warning/icon/name.png" |
||||
If an icon is not found, text-only markers are displayed instead. The bitmap |
||||
should fit into the place of two characters. |
||||
|
||||
You must use full paths for these variables, for icons in your home directory |
||||
expand the paths in your .vimrc with something like > |
||||
:let errormarker_erroricon = expand ("~/.vim/icons/error.png") |
||||
To get working icons on Microsoft Windows, place icons for errors and warnings |
||||
(you can use Google at http://images.google.com/images?q=error&imgsz=icon to |
||||
find some nice ones) as error.bmp and warning.bmp in your home directory at |
||||
C:\Documents and Settings\<user>\vimfiles\icons. |
||||
|
||||
*errormarker_errortext* *errormarker_warningtext* |
||||
The text that is displayed without a GUI or if the icon files can not be found |
||||
can be set by > |
||||
:let errormarker_errortext = "Er" |
||||
:let errormarker_warningtext = "Wa" |
||||
The maximum length is two characters. |
||||
|
||||
*errormarker_errorgroup* *errormarker_warninggroup* |
||||
The hightlighting groups that are used to mark the lines that contain warnings |
||||
and errors can be set by > |
||||
:let errormarker_errorgroup = "ErrorMsg" |
||||
:let errormarker_warninggroup = "Todo" |
||||
< |
||||
*errormarker_warningtypes* |
||||
If the compiler reports a severity for the error messages this can be used to |
||||
distinguish between warnings and errors. Vim uses a single character error |
||||
type that can be parsed with |errorformat| (%t). The error types that should |
||||
be treated as warnings can be set by > |
||||
let errormarker_warningtypes = "wWiI" |
||||
|
||||
For example, the severity of error messages from gcc |
||||
averagergui.cpp|18 warning| unused parameter ‘file’ ~ |
||||
averagergui.cpp|33 error| expected class-name before ‘I’ ~ |
||||
can be parsed by adding the following lines to your .vimrc > |
||||
let &errorformat="%f:%l: %t%*[^:]:%m," . &errorformat |
||||
let &errorformat="%f:%l:%c: %t%*[^:]:%m," . &errorformat |
||||
let errormarker_warningtypes = "wW" |
||||
|
||||
If you use a different locale than English, this may also be needed: > |
||||
set makeprg=LANGUAGE=C\ make |
||||
< |
||||
*errormarker_disablemappings* *\cc* *:ErrorAtCursor* |
||||
To show the error message at the cursor position (e.g. if you are working from |
||||
within a terminal, where tooltips are not available), the following command |
||||
and shortcut are defined: > |
||||
:ErrorAtCursor |
||||
:nmap <silent> <unique> <Leader>cc :ErrorAtCursor<CR> |
||||
|
||||
The shortcut is only defined if no other mapping to ErrorAtCursor<CR> can be |
||||
found, and can be completely disabled by > |
||||
let errormarker_disablemappings = 1 |
||||
< |
||||
|
||||
============================================================================== |
||||
3. CREDITS *errormarker-credits* |
||||
|
||||
Author: Michael Hofmann <mh21 at piware dot de> |
||||
|
||||
============================================================================== |
||||
4. CHANGELOG *errormarker-changelog* |
||||
|
||||
0.1.13 - shortcut can be disabled (thanks Michael Jansen) |
||||
0.1.12 - shortcut (<Leader>cc) to show error at cursor (thanks Eric Rannaud) |
||||
0.1.11 - changelog fix |
||||
0.1.10 - removes accidental dependency on NerdEcho |
||||
0.1.9 - fixes Win32 icon display |
||||
0.1.8 - check for Vim version |
||||
0.1.7 - fixes gcc error message parsing example |
||||
0.1.6 - support for GetLatestVimScripts (vimscript#642) |
||||
0.1.5 - clarified documentation about paths |
||||
0.1.4 - fixes icon name and variable escaping |
||||
0.1.3 - customizable signs |
||||
- distinguishes between warnings and errors |
||||
0.1.2 - documentation |
||||
0.1.1 - handles nonexistent icons gracefully |
||||
- tooltips only used if Vim has balloon-eval support |
||||
0.1 - initial release |
||||
|
||||
============================================================================== |
||||
=== END_DOC |
||||
|
||||
" vim:ft=vim foldmethod=marker tw=78 |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
|
||||
" Author: Cornelius <cornelius.howl@gmail.com> |
||||
" Date: 一 12/21 20:29:23 2009 |
||||
" Script type: plugin |
||||
" Script id: |
||||
|
||||
" filetype completion hacks |
||||
fun! FiletypeCompletion(lead,cmd,pos) |
||||
let list = glob(expand('$VIMRUNTIME/syntax'). '/*.vim') |
||||
let items = split(list,"\n") |
||||
cal map(items,'matchstr(v:val,''\w\+\(.vim$\)\@='')') |
||||
cal filter(items,"v:val =~ '^" . a:lead . "'") |
||||
return items |
||||
endf |
||||
com! -complete=customlist,FiletypeCompletion -nargs=1 SetFiletype :setf <args> |
||||
cabbr sft SetFiletype |
||||
cabbr setf SetFiletype |
||||
|
||||
|
||||
|
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
Copyright (c) 2018, Tobias Wolf |
||||
All rights reserved. |
||||
|
||||
Contains syntax portions licensed from: |
||||
https://github.com/fatih/vim-go |
||||
|
||||
Copyright (c) 2015, Fatih Arslan |
||||
All rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are met: |
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this |
||||
list of conditions and the following disclaimer. |
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, |
||||
this list of conditions and the following disclaimer in the documentation |
||||
and/or other materials provided with the distribution. |
||||
|
||||
* Neither the name of the copyright holder nor the names of its |
||||
contributors may be used to endorse or promote products derived from |
||||
this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
# vim-helm |
||||
vim syntax for helm templates (yaml + gotmpl + sprig + custom) |
||||
|
||||
Install via vundle: |
||||
|
||||
```vim |
||||
Plugin 'towolf/vim-helm' |
||||
``` |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
autocmd BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl set ft=helm |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
if exists("b:current_syntax") |
||||
finish |
||||
endif |
||||
|
||||
if !exists("main_syntax") |
||||
let main_syntax = 'yaml' |
||||
endif |
||||
|
||||
let b:current_syntax = '' |
||||
unlet b:current_syntax |
||||
runtime! syntax/yaml.vim |
||||
|
||||
let b:current_syntax = '' |
||||
unlet b:current_syntax |
||||
syntax include @Yaml syntax/yaml.vim |
||||
|
||||
syn case match |
||||
|
||||
" Go escapes |
||||
syn match goEscapeOctal display contained "\\[0-7]\{3}" |
||||
syn match goEscapeC display contained +\\[abfnrtv\\'"]+ |
||||
syn match goEscapeX display contained "\\x\x\{2}" |
||||
syn match goEscapeU display contained "\\u\x\{4}" |
||||
syn match goEscapeBigU display contained "\\U\x\{8}" |
||||
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ |
||||
|
||||
hi def link goEscapeOctal goSpecialString |
||||
hi def link goEscapeC goSpecialString |
||||
hi def link goEscapeX goSpecialString |
||||
hi def link goEscapeU goSpecialString |
||||
hi def link goEscapeBigU goSpecialString |
||||
hi def link goSpecialString Special |
||||
hi def link goEscapeError Error |
||||
|
||||
" Strings and their contents |
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError |
||||
syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup |
||||
syn region goRawString contained start=+`+ end=+`+ |
||||
|
||||
hi def link goString String |
||||
hi def link goRawString String |
||||
|
||||
" Characters; their contents |
||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU |
||||
syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup |
||||
|
||||
hi def link goCharacter Character |
||||
|
||||
" Integers |
||||
syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>" |
||||
syn match goHexadecimalInt contained "\<0x\x\+\>" |
||||
syn match goOctalInt contained "\<0\o\+\>" |
||||
syn match goOctalError contained "\<0\o*[89]\d*\>" |
||||
syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt |
||||
" Floating point |
||||
syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" |
||||
syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>" |
||||
syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>" |
||||
" Imaginary literals |
||||
syn match goImaginary contained "\<\d\+i\>" |
||||
syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" |
||||
syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" |
||||
syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>" |
||||
|
||||
hi def link goInt Number |
||||
hi def link goFloat Number |
||||
hi def link goImaginary Number |
||||
|
||||
" Token groups |
||||
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary |
||||
syn keyword gotplControl contained if else end range with template include tpl required define |
||||
syn keyword gotplFunctions contained and call html index js len not or print printf println urlquery eq ne lt le gt ge |
||||
syn keyword goSprigFunctions contained abbrev abbrevboth add add1 adler32sum ago append atoi b32dec b32enc b64dec b64enc base biggest buildCustomCert camelcase cat ceil clean coalesce \contains compact date dateInZone dateModify date_in_zone date_modify default derivePassword dict dir div empty ext fail first float64 floor fromJson fromYaml genCA genPrivateKey genSelfSignedCert genSignedCert has hasKey hasPrefix hasSuffix hello htmlDate htmlDateInZone indent initial initials int int64 isAbs join kebabcase keys kindIs kindOf last list lower max merge mergeOverwrite min mod mul nindent nospace now omit pick pluck plural prepend quote randAlpha randAlphaNum randAscii randNumeric regexFind regexFindAll regexMatch regexReplaceAll regexReplaceAllLiteral regexSplit repeat replace rest reverse round semver semverCompare set sha1sum sha256sum shuffle slice snakecase sortAlpha split splitList splitn squote sub substr swapcase ternary title toDate toJson toPrettyJson toString toStrings toToml toYaml trim trimAll trimPrefix trimSuffix trimall trunc tuple typeIs typeIsLike typeOf uniq unixEpoch unset until untilStep untitle upper uuidv4 values without wrap wrapWith |
||||
syn match goTplVariable contained /\$[a-zA-Z0-9_]*\>/ |
||||
syn match goTplIdentifier contained /\.[^\s}]+\>/ |
||||
|
||||
" hi def link gotplControl Keyword |
||||
" hi def link gotplFunctions Function |
||||
" hi def link goSprigFunctions Function |
||||
" hi def link goTplVariable Special |
||||
hi def link gotplControl goConditional |
||||
hi def link gotplFunctions goConditional |
||||
hi def link goSprigFunctions goConditional |
||||
hi def link goTplVariable goStatement |
||||
|
||||
syn region gotplAction start="{{\(-? \)\?" end="\( -?\)\?}}" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable,goTplIdentifier containedin=yamlFlowString display |
||||
syn region gotplAction start="\[\[\(-? \)\?" end="\( -?\)\?\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable containedin=yamlFlowString display |
||||
syn region goTplComment start="{{\(-? \)\?/\*" end="\*/\( -?\)\?}}" display |
||||
syn region goTplComment start="\[\[\(-? \)\?/\*" end="\*/\( -?\)\?\]\]" display |
||||
|
||||
hi def link goTplAction Operator |
||||
hi def link goTplComment Comment |
||||
let b:current_syntax = "helm" |
||||
|
||||
" vim: sw=2 ts=2 et |
@ -0,0 +1,361 @@
@@ -0,0 +1,361 @@
|
||||
" {{{ |
||||
" Name: help.vim ("help subsystem") |
||||
" Version: 1.19 |
||||
" Authors: Slava Gorbanev (author 1.16 version) and |
||||
" Nikolay Panov (author >1.16 version) |
||||
" Date: 09/03/2003 (21:03) |
||||
" Description: call man or perldoc -f or many other help system in dependent from context |
||||
" Changes: |
||||
" * 1.20 now pydoc is supported |
||||
" * 1.19 several bugfixes, impruvements and other... |
||||
" * 1.18 several bugfixes, added call apropos if man page not found. |
||||
" * 1.17 support fvwm, muttrc filetype, many fixes... |
||||
" * 1.17g new, extended implementation of help.vim (http://www.vim.org/scripts/script.php?script_id=561) |
||||
" * 1.17b forked by help.vim,v 1.16 2002/01/05 19:58:38 from Slava Gorbanev, added support tcl/tk and many fixes |
||||
" Installation: put this into your plugin directory (~/.vim/plugin) |
||||
" Usage: |
||||
" use <F1> by default or other key (if you remap it) to call Help(expand("<cword>")) |
||||
" this function creating in half window buffer with contex-dependent |
||||
" manual (or other) page about word under corsor. |
||||
" You can use new commands now: |
||||
" Man something the same as man into your system |
||||
" Perldoc something the same as perldoc into your system |
||||
" GoToSection something try to find <something> section into window |
||||
" Help something try to show context-dependent help |
||||
" Dict something the same as dict into your system |
||||
" |
||||
" By default in help-buffer set key-mapping: |
||||
" q for exit (and ``Esc'' in GUI mode) |
||||
" o for command :only |
||||
" D for go to DESCRIPTION section |
||||
" S for go to SYN section |
||||
" (and other --- see source code by detail) |
||||
" |
||||
" You can mapping go to any other section: |
||||
" for example for go to NAME section by N key call next command: |
||||
" map N :call GoToSection('NAME') |
||||
" |
||||
" Now support: sh, vim, perl, python, tcl/tk, C/C++, fvwm, muttrc and many other. |
||||
" |
||||
" TODO nicier documentation (oh - my terrible english)... |
||||
" TODO support many other language" }}} |
||||
|
||||
" {{{ Builtin function (sh, perl) |
||||
let sh_builtin='^\(alias\|bg\|bind\|break\|builtin\|case\|cd\|co\(mmand\|ntinue\)\|declare\|dirs\|echo\|enable\|eval\|ex\(ec\|it\|port\)\|fc\|fg\|for\|function\|getopts\|hash\|help\|history\|if\|jobs\|kill\|let\|lo\(cal\|gout\)\|popd\|pushd\|pwd\|read\(\|only\)\|return\|se\(lect\|t\)\|shift\|source\|suspend\|test\|times\|trap\|ty\(pe\|peset\)\|ulimit\|umask\|un\(alias\|set\|til\)\|variables\|wait\|while\)$' |
||||
let perl_builtin='^\(abs\|accept\|alarm\|atan2\|bind\|binmode\|bless\|caller\|chdir\|chmod\|chom\=p\|chown\|chr\|chroot\|close\|closedir\|connect\|continue\|cos\|crypt\|dbmclose\|dbmopen\|defined\|delete\|die\|do\|dump\|each\|end\(grent\|hostent\|netent\|protoent\|pwent\|servent\)\|eof\|eval\|exec\|exp\|exists\|exit\|fcntl\|fileno\|flock\|fork\|format\|formline\|getc\|getgrent\|getgrgid\|getgrnam\|gethostbyaddr\|gethostbyname\|gethostent\|getlogin\|getnetbyaddr\|getnetbyname\|getnetent\|getpeername\|getpgrp\|getppid\|getpriority\|getprotobyname\|getprotobynumber\|getprotoent\|getpwent\|getpwnam\|getpwuid\|getservbyname\|getservbyport\|getservent\|getsockname\|getsockopt\|glob\|gmtime\|goto\|grep\|hex\|import\|index\|int\|ioctl\|join\|keys\|kill\|last\|lc\|lcfirst\|length\|link\|listen\|local\|localtime\|log\|lstat\|map\|mkdir\|msgctl\|msgget\|msgrcv\|msgsnd\|my\|next\|no\|open\|opendir\|ord\|pack\|package\|pipe\|po[ps]\|printf\=\|push\|quotemeta\|rand\|read\(\|dir\|link\)\|recv\|redo\|ref\|rename\|require\|reset\|return\|reverse\|rewinddir\|rindex\|rmdir\|scalar\|seek\|seekdir\|select\|semctl\|semget\|semop\|send\|set\(gr\|host\|net\)ent\|setp\(grp\|riority\|rotoent\|went\)\|setservent\|setsockopt\|shift\|shmctl\|shmget\|shmread\|shmwrite\|shutdown\|sin\|sleep\|socket\(\|pair\)\|sort\|splice\|split\|sprintf\|sqrt\|srand\|stat\|study\|sub\|substr\|symlink\|sys\(call\|read\|seek\|write\|tem\)\|tell\|telldir\|tied\=\|times\=\|truncate\|uc\|ucfirst\|umask\|undef\|unlink\|unpack\|unshift\|untie\|use\|utime\|values\|vec\|wait\(\|pid\)\|wa\(ntarray\|rn\)\|write\)$' |
||||
" }}} |
||||
" {{{ Global definition variables and command |
||||
let $MANPL='1100i' " no page breaks inside man pages |
||||
|
||||
command! -nargs=* Man call Man(<f-args>) |
||||
command! -nargs=1 Perldoc call Perldoc(<f-args>) |
||||
command! -nargs=1 Pydoc call Pydoc(<f-args>) |
||||
command! -nargs=1 GoToSection call GoToSection(<f-args>) |
||||
" }}} |
||||
" {{{ Mappings |
||||
nmap fs :call Src(expand("<cword>"))<CR> |
||||
nmap fm :call Help(expand("<cword>"))<CR> |
||||
nmap <F1> :call Help(expand("<cword>"))<CR> |
||||
nmap <F1><F1> :call Dict(expand("<cword>"))<CR> |
||||
imap <F1><F1> <ESC>:call Dict(expand("<cword>"))<CR> |
||||
imap <F1> <ESC>:call Help(expand("<cword>"))<CR> |
||||
" }}} |
||||
" {{{ Funcitions definition |
||||
" {{{ The GoToSection(section) function close all fond and go to... |
||||
fun! GoToSection(search) |
||||
let search = a:search |
||||
if search =~ '\/' |
||||
let cmd = search |
||||
else |
||||
let search = substitute(search, "^un", "", "") |
||||
let cmd = '/^\s*\(\[un\]\)\='.search.'.\{-,50}/' |
||||
endif |
||||
normal zM |
||||
silent exec cmd |
||||
normal zvjzvztk0 |
||||
endfun |
||||
" }}} |
||||
" {{{ The OpenHelpWin(cmd, ft, ...) function get manual page and creating window |
||||
fun! OpenHelpWin(cmd, ft, ...) |
||||
if a:0 |
||||
let buf_name = a:1 |
||||
else |
||||
let buf_name = 'Help' |
||||
endif |
||||
exe 'silent new' escape(buf_name, '\ ') |
||||
setlocal modifiable buftype=nofile noswapfile |
||||
""endif |
||||
let &ft = a:ft |
||||
exe "0r!".a:cmd |
||||
if line('$') == 1 |
||||
exe "0r! man ".a:1." 2>/dev/null" |
||||
if line('$') == 1 |
||||
exe "0r! apropos ".a:1." 2>/dev/null" |
||||
endif |
||||
endif |
||||
let helpsize = line('$') |
||||
if helpsize > &helpheight |
||||
let helpsize = &helpheight |
||||
endif |
||||
set nomod |
||||
if winheight(2) != -1 |
||||
exe 'resize' helpsize |
||||
endif |
||||
1 |
||||
" {{{ key-mapping and definition local parameter |
||||
noremap <buffer> <Space> <C-F> |
||||
noremap <buffer> <Backspace> <C-B> |
||||
noremap <buffer> o :only<CR> |
||||
noremap <buffer> q :bdel<CR> |
||||
noremap <buffer> D :call GoToSection('DESCRIPTION')<CR> |
||||
noremap <buffer> E :call GoToSection('EXAMPLE')<CR> |
||||
noremap <buffer> S :call GoToSection('SYN')<CR> |
||||
noremap <buffer> <C-Up> zM?^[A-Z]\+<CR>jzvztk0 |
||||
noremap <buffer> <C-Down> zM/^[A-Z]\+<CR>jzvztk0 |
||||
if has("gui_running") |
||||
noremap <buffer> <Esc> :bdel<CR> |
||||
endif |
||||
|
||||
setlocal foldmethod=indent |
||||
setlocal nohlsearch |
||||
setlocal nomodifiable |
||||
|
||||
hi Error ctermfg=NONE ctermbg=NONE |
||||
" }}} |
||||
""endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The Man(page, ...) function gets a man page |
||||
fun! Man(page, ...) |
||||
if a:0 |
||||
let page = a:1 |
||||
let section = '-S '.a:page.' ' |
||||
if a:0 > 1 |
||||
let go_to = a:2 |
||||
else |
||||
let go_to = '' |
||||
endif |
||||
else |
||||
let page = a:page |
||||
let section = '' |
||||
let go_to = '' |
||||
endif |
||||
call OpenHelpWin("man ".section.page." 2>/dev/null \|col -b\|uniq", 'man', page) |
||||
if go_to != '' |
||||
call GoToSection(go_to) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The Pydoc(word) function gets a python documentation for word |
||||
fun! Pydoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'man' |
||||
let cmd = 'pydoc '.a:word |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The Perldoc(word) function gets a perl documentation for word |
||||
fun! Perldoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'perl' |
||||
if a:word =~ g:perl_builtin |
||||
let cmd = 'perldoc -f '.a:word |
||||
elseif a:word =~# '^\(s\|m\|qr\)$' |
||||
let cmd = 'man perlop' |
||||
let move_to_pattern = '/^ \+'.a:word.'\/PATTERN\//' |
||||
elseif a:word =~# '^\(tr\|y\)$' |
||||
let cmd = 'man perlop' |
||||
let move_to_pattern = '/^ \+'.a:word.'\/SEARCHLIST\//' |
||||
elseif a:word =~# '^q[qxw]\=$' |
||||
let cmd = 'man perlop' |
||||
let move_to_pattern = '/^ \+'.a:word.'\/STRING\//' |
||||
elseif a:word =~# '^\(y\|tr\)$' |
||||
let cmd = 'man perlop' |
||||
let move_to_pattern = '/^ \+'.a:word.'\/SEARCHLIST\//' |
||||
else |
||||
let cmd = 'man -S 3perl:3pm:3 '.a:word |
||||
endif |
||||
call OpenHelpWin(cmd." 2>/dev/null \|col -b\|uniq", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The ShBuiltin(word) function gets a help for sh builin function |
||||
fun! ShBuiltin(word) |
||||
let WORD = expand("<cword>") |
||||
if a:word =~ g:sh_builtin |
||||
let cmd = "bash -c '\command \help ".a:word."'" |
||||
elseif WORD == '\[' || WORD =~ '^-[a-z]$' |
||||
let cmd = "bash -c '\command \help test'" |
||||
elseif WORD == ':' || WORD == '.' || WORD == '{' |
||||
let cmd = "bash -c '\command \help ".WORD."'" |
||||
else |
||||
call Man('1:5:8', a:word) |
||||
return |
||||
endif |
||||
call OpenHelpWin(cmd, 'man', WORD) |
||||
normal zR |
||||
endfun |
||||
" }}} |
||||
|
||||
" {{{ The PrologDoc(word) function gets a swi-prolog documentation for word |
||||
fun! PrologDoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'prolog' |
||||
let cmd = 'echo "help('.a:word.')." | swipl --nopce 2>/dev/null | cat -v | sed "s/.\^H//g"' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The GuileDoc(word) function gets a guile scheme documentation for word |
||||
fun! GuileDoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'scheme' |
||||
let cmd = 'echo "(help '.a:word.')" | guile | sed "s/guile.//g"' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The SBCLDoc(word) function gets a sbcl scheme documentation for word |
||||
fun! SBCLDoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'lisp' |
||||
" let cmd = "echo \\(documentation " |
||||
" \."\\'" .a:word. " \\'" |
||||
" \."function\\) | sbcl | tail -n +8" |
||||
let cmd = "echo \\(describe " ."\\'" .a:word ."\\) | sbcl | tail -n +8" |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The MySQL(word) function gets a guile scheme documentation for word |
||||
fun! MySQL(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'mysql' |
||||
let cmd = 'echo "help '.a:word.';" | mysql -u anonymous' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The RebolDoc(word) function gets a Rebol documentation for word |
||||
fun! RebolDoc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'rebol' |
||||
let cmd = 'echo "quit" | rebol -v --do "help '.a:word.'"' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" ---------------------------------------------------------------------- |
||||
" {{{ The GuileSrc(word) function gets a guile scheme documentation for word |
||||
fun! GuileSrc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'scheme' |
||||
let cmd = 'echo "(pretty-print (source '.a:word.'))" | guile | sed "s/guile.//g"' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The PrologSrc(word) function gets a prolog source for word |
||||
fun! PrologSrc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'prolog' |
||||
let cmd = 'echo "listing('.a:word.')." | swipl 2>/dev/null' |
||||
call OpenHelpWin(cmd." 2>/dev/null", filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The TclSrc(word) function gets a tcl source for word |
||||
fun! TclSrc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'tcl' |
||||
let cmd = '~/.config/nvim/+scripts/sources/getTclSrc '.a:word |
||||
" echo system(cmd) |
||||
call OpenHelpWin(cmd, filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" {{{ The RebolSrc(word) function gets a Rebol source for word |
||||
fun! RebolSrc(word) |
||||
let move_to_pattern = '' |
||||
let filetype = 'rebol' |
||||
let cmd = 'echo "quit" | rebol -v --do "source '.a:word.'"' |
||||
call OpenHelpWin(cmd, filetype, a:word) |
||||
if move_to_pattern != '' |
||||
call GoToSection(move_to_pattern) |
||||
endif |
||||
endfun |
||||
" }}} |
||||
" ---------------------------------------------------------------------- |
||||
" {{{ The Src(word) function gets a help for word (in depend on context) |
||||
fun! Src(word) |
||||
if &ft =~ 'scheme' |
||||
call GuileSrc(a:word) |
||||
elseif &ft =~ 'prolog' |
||||
call PrologSrc(a:word) |
||||
elseif &ft =~ 'tcl' |
||||
call TclSrc(expand("<cWORD>")) |
||||
elseif &ft =~ 'rebol' |
||||
call RebolSrc(a:word) |
||||
else |
||||
echohl Error | echo 'No identifier under cursor' | echohl None |
||||
endif |
||||
normal zv |
||||
endfun |
||||
" }}} |
||||
" ---------------------------------------------------------------------- |
||||
" {{{ The Help(word) function gets a help for word (in depend on context) |
||||
fun! Help(word) |
||||
if &ft == 'vim' || &ft == 'help' |
||||
exe "help" a:word |
||||
elseif &ft == 'c' || &ft == 'cpp' |
||||
call Man('2:3', a:word) |
||||
elseif &ft =~ 'perl' |
||||
call Perldoc(a:word) |
||||
elseif &ft =~ 'scheme' |
||||
call GuileDoc(a:word) |
||||
elseif &ft =~ 'lisp' |
||||
call SBCLDoc(a:word) |
||||
elseif &ft =~ 'rebol' |
||||
call RebolDoc(a:word) |
||||
elseif &ft =~ 'prolog' |
||||
call PrologDoc(a:word) |
||||
elseif &ft =~ 'mysql' |
||||
call MySQL(a:word) |
||||
elseif &ft =~ 'python' |
||||
call Pydoc(a:word) |
||||
elseif &ft =~ 'tcl' |
||||
call Man('3tcl:3tk:n', a:word) |
||||
elseif &ft =~ '^\(fvwm\|muttrc\)$' |
||||
call Man('1:5',&ft, a:word) |
||||
elseif &ft =~ '^z\=sh' |
||||
call ShBuiltin(a:word) |
||||
elseif a:word =~ '^\i\+' |
||||
call Man(a:word) |
||||
else |
||||
echohl Error | echo 'No identifier under cursor' | echohl None |
||||
endif |
||||
normal zv |
||||
endfun |
||||
" }}} |
||||
" }}} |
@ -0,0 +1,364 @@
@@ -0,0 +1,364 @@
|
||||
# vim:filetype=make:foldmethod=marker:fdl=0:
|
||||
#
|
||||
# Makefile: install/uninstall/link vim plugin files.
|
||||
# Author: Cornelius <cornelius.howl@gmail.com>
|
||||
# Date: 一 3/15 22:49:26 2010
|
||||
# Version: 1.0
|
||||
#
|
||||
# PLEASE DO NOT EDIT THIS FILE. THIS FILE IS AUTO-GENERATED FROM Makefile.tpl
|
||||
# LICENSE {{{
|
||||
# Copyright (c) 2010 <Cornelius (c9s)>
|
||||
#
|
||||
# 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.
|
||||
# }}}
|
||||
# VIM RECORD FORMAT: {{{
|
||||
# {
|
||||
# version => 0.2, # record spec version
|
||||
# generated_by => 'Vimana-' . $Vimana::VERSION,
|
||||
# install_type => 'auto', # auto , make , rake ... etc
|
||||
# package => $self->package_name,
|
||||
# files => \@e,
|
||||
# }
|
||||
# }}}
|
||||
|
||||
# INTERNAL VARIABLES {{{
|
||||
|
||||
RECORD_FILE=.record
|
||||
PWD=`pwd`
|
||||
README_FILES=`ls -1 | grep -i readme`
|
||||
WGET_OPT=-c -nv
|
||||
CURL_OPT=
|
||||
RECORD_SCRIPT=.mkrecord
|
||||
TAR=tar czvf
|
||||
|
||||
GIT_SOURCES=
|
||||
|
||||
# INTERNAL FUNCTIONS {{{
|
||||
record_file = \
|
||||
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||
echo $(VIMRUNTIME)/$$PTYPE/$(1) >> $(2)
|
||||
|
||||
# }}}
|
||||
|
||||
# PUBLIC FUNCTIONS {{{
|
||||
|
||||
GIT_SOURCES=
|
||||
DEPEND_DIR=/tmp/vim-deps
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# $(call install_git_sources)
|
||||
#
|
||||
|
||||
install_git_source = \
|
||||
PWD=$(PWD) ; \
|
||||
mkdir -p $(DEPEND_DIR) ; \
|
||||
cd $(DEPEND_DIR) ; \
|
||||
for git_uri in $(GIT_SOURCES) ; do \
|
||||
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
|
||||
echo $$OUTDIR ; \
|
||||
if [[ -e $$OUTDIR ]] ; then \
|
||||
cd $$OUTDIR ; \
|
||||
git pull origin master && \
|
||||
make install && cd .. ; \
|
||||
else \
|
||||
git clone $$git_uri $$OUTDIR && \
|
||||
cd $$OUTDIR && \
|
||||
make install && cd .. ; \
|
||||
fi; \
|
||||
done ;
|
||||
|
||||
|
||||
|
||||
|
||||
# install file by inspecting content
|
||||
install_file = \
|
||||
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||
cp -v $(1) $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||
|
||||
link_file = \
|
||||
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||
cp -v $(1) $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||
|
||||
unlink_file = \
|
||||
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
|
||||
rm -fv $(VIMRUNTIME)/$$PTYPE/$(1)
|
||||
|
||||
# fetch script from an url
|
||||
fetch_url = \
|
||||
@if [[ -e $(2) ]] ; then \
|
||||
exit \
|
||||
; fi \
|
||||
; echo " => $(2)" \
|
||||
; if [[ ! -z `which curl` ]] ; then \
|
||||
curl $(CURL_OPT) $(1) -o $(2) ; \
|
||||
; elif [[ ! -z `which wget` ]] ; then \
|
||||
wget $(WGET_OPT) $(1) -O $(2) \
|
||||
; fi \
|
||||
; echo $(2) >> .bundlefiles
|
||||
|
||||
|
||||
install_source = \
|
||||
for git_uri in $(GIT_SOURCES) ; do \
|
||||
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
|
||||
echo $$OUTDIR ; \
|
||||
done
|
||||
|
||||
# fetch script from github
|
||||
fetch_github = \
|
||||
@if [[ -e $(5) ]] ; then \
|
||||
exit \
|
||||
; fi \
|
||||
; echo " => $(5)" \
|
||||
; if [[ ! -z `which curl` ]] ; then \
|
||||
curl $(CURL_OPT) http://github.com/$(1)/$(2)/raw/$(3)/$(4) -o $(5) \
|
||||
; elif [[ ! -z `which wget` ]] ; then \
|
||||
wget $(WGET_OPT) http://github.com/$(1)/$(2)/raw/$(3)/$(4) -O $(5) \
|
||||
; fi \
|
||||
; echo $(5) >> .bundlefiles
|
||||
|
||||
# fetch script from local file
|
||||
fetch_local = @cp -v $(1) $(2) \
|
||||
; @echo $(2) >> .bundlefiles
|
||||
|
||||
# 1: NAME , 2: URI
|
||||
dep_from_git = \
|
||||
D=/tmp/$(1)-$$RANDOM ; git clone $(2) $$D ; cd $$D ; make install ;
|
||||
|
||||
dep_from_svn = \
|
||||
D=/tmp/$(1)-$$RANDOM ; svn checkout $(2) $$D ; cd $$D ; make install ;
|
||||
|
||||
# }}}
|
||||
# }}}
|
||||
# ======= DEFAULT CONFIG ======= {{{
|
||||
|
||||
# Default plugin name
|
||||
NAME=`basename \`pwd\``
|
||||
VERSION=0.1
|
||||
|
||||
# Files to add to tarball:
|
||||
DIRS=`ls -1F | grep / | sed -e 's/\///'`
|
||||
|
||||
# Runtime path to install:
|
||||
VIMRUNTIME=~/.vim
|
||||
|
||||
# Other Files to be added:
|
||||
FILES=`ls -1 | grep '.vim$$'`
|
||||
MKFILES=Makefile `ls -1 | grep '.mk$$'`
|
||||
|
||||
# ======== USER CONFIG ======= {{{
|
||||
# please write config in config.mk
|
||||
# this will override default config
|
||||
#
|
||||
# Custom Name:
|
||||
#
|
||||
# NAME=[plugin name]
|
||||
#
|
||||
# Custom dir list:
|
||||
#
|
||||
# DIRS=autoload after doc syntax plugin
|
||||
#
|
||||
# Files to add to tarball:
|
||||
#
|
||||
# FILES=
|
||||
#
|
||||
# Bundle dependent scripts:
|
||||
#
|
||||
# bundle-deps:
|
||||
# $(call fetch_github,[account id],[project],[branch],[source path],[target path])
|
||||
# $(call fetch_url,[file url],[target path])
|
||||
# $(call fetch_local,[from],[to])
|
||||
|
||||
SHELL=bash
|
||||
|
||||
CONFIG_FILE=config.mk
|
||||
-include ~/.vimauthor.mk |
||||
-include $(CONFIG_FILE) |
||||
|
||||
# }}}
|
||||
# }}}
|
||||
# ======= SECTIONS ======= {{{
|
||||
-include ext.mk |
||||
|
||||
all: install-deps install |
||||
|
||||
install-deps: |
||||
# check required binaries
|
||||
[[ -n $$(which git) ]]
|
||||
[[ -n $$(which bash) ]]
|
||||
[[ -n $$(which vim) ]]
|
||||
[[ -n $$(which wget) || -n $$(which curl) ]]
|
||||
$(call install_git_sources)
|
||||
|
||||
check-require: |
||||
@if [[ -n `which wget` || -n `which curl` || -n `which fetch` ]]; then echo "wget|curl|fetch: OK" ; else echo "wget|curl|fetch: NOT OK" ; fi
|
||||
@if [[ -n `which vim` ]] ; then echo "vim: OK" ; else echo "vim: NOT OK" ; fi
|
||||
|
||||
config: |
||||
@rm -f $(CONFIG_FILE)
|
||||
@echo "NAME=" >> $(CONFIG_FILE)
|
||||
@echo "VERSION=" >> $(CONFIG_FILE)
|
||||
@echo "#DIRS="
|
||||
@echo "#FILES="
|
||||
@echo "" >> $(CONFIG_FILE)
|
||||
@echo "bundle-deps:" >> $(CONFIG_FILE)
|
||||
@echo "\t\t\$$(call fetch_github,ID,REPOSITORY,BRANCH,PATH,TARGET_PATH)" >> $(CONFIG_FILE)
|
||||
@echo "\t\t\$$(call fetch_url,FILE_URL,TARGET_PATH)" >> $(CONFIG_FILE)
|
||||
|
||||
|
||||
init-author: |
||||
@echo "AUTHOR=" > ~/.vimauthor.mk
|
||||
|
||||
bundle-deps: |
||||
|
||||
bundle: bundle-deps |
||||
|
||||
dist: bundle mkfilelist |
||||
@$(TAR) $(NAME)-$(VERSION).tar.gz --exclude '*.svn' --exclude '.git' $(DIRS) $(README_FILES) $(FILES) $(MKFILES)
|
||||
@echo "$(NAME)-$(VERSION).tar.gz is ready."
|
||||
|
||||
init-runtime: |
||||
@mkdir -vp $(VIMRUNTIME)
|
||||
@mkdir -vp $(VIMRUNTIME)/record
|
||||
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type d | while read dir ; do \
|
||||
mkdir -vp $(VIMRUNTIME)/$$dir ; done ; fi
|
||||
|
||||
release: |
||||
if [[ -n `which vimup` ]] ; then \
|
||||
fi
|
||||
|
||||
pure-install: |
||||
@echo "Using Shell:" $(SHELL)
|
||||
@echo "Installing"
|
||||
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||
cp -v $$file $(VIMRUNTIME)/$$file ; done ; fi
|
||||
@echo "$(FILES)" | while read vimfile ; do \
|
||||
if [[ -n $$vimfile ]] ; then \
|
||||
$(call install_file,$$vimfile) ; fi ; done
|
||||
|
||||
install: init-runtime bundle pure-install record |
||||
|
||||
|
||||
uninstall-files: |
||||
@echo "Uninstalling"
|
||||
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||
rm -fv $(VIMRUNTIME)/$$file ; done ; fi
|
||||
@echo "$(FILES)" | while read vimfile ; do \
|
||||
if [[ -n $$vimfile ]] ; then \
|
||||
$(call unlink_file,$$vimfile) ; fi ; done
|
||||
|
||||
uninstall: uninstall-files rmrecord |
||||
|
||||
link: init-runtime |
||||
@echo "Linking"
|
||||
@if [[ -n "$(DIRS)" ]]; then find $(DIRS) -type f | while read file ; do \
|
||||
ln -sfv $(PWD)/$$file $(VIMRUNTIME)/$$file ; done ; fi
|
||||
@echo "$(FILES)" | while read vimfile ; do \
|
||||
if [[ -n $$vimfile ]] ; then \
|
||||
$(call link_file,$$vimfile) ; fi ; done
|
||||
|
||||
mkfilelist: |
||||
@echo $(NAME) > $(RECORD_FILE)
|
||||
@echo $(VERSION) >> $(RECORD_FILE)
|
||||
@if [[ -n "$(DIRS)" ]] ; then find $(DIRS) -type f | while read file ; do \
|
||||
echo $(VIMRUNTIME)/$$file >> $(RECORD_FILE) ; done ; fi
|
||||
@echo "$(FILES)" | while read vimfile ; do \
|
||||
if [[ -n $$vimfile ]] ; then \
|
||||
$(call record_file,$$vimfile,$(RECORD_FILE)) ; fi ; done
|
||||
|
||||
vimball-edit: |
||||
find $(DIRS) -type f > .tmp_list
|
||||
vim .tmp_list
|
||||
vim .tmp_list -c ":%MkVimball $(NAME)-$(VERSION) ." -c "q"
|
||||
@rm -vf .tmp_list
|
||||
@echo "$(NAME)-$(VERSION).vba is ready."
|
||||
|
||||
vimball: |
||||
find $(DIRS) -type f > .tmp_list
|
||||
vim .tmp_list -c ":%MkVimball $(NAME)-$(VERSION) ." -c "q"
|
||||
@rm -vf .tmp_list
|
||||
@echo "$(NAME)-$(VERSION).vba is ready."
|
||||
|
||||
mkrecordscript: |
||||
@echo "" > $(RECORD_SCRIPT)
|
||||
@echo "fun! s:mkmd5(file)" >> $(RECORD_SCRIPT)
|
||||
@echo " if executable('md5')" >> $(RECORD_SCRIPT)
|
||||
@echo " return system('cat ' . a:file . ' | md5')" >> $(RECORD_SCRIPT)
|
||||
@echo " else" >> $(RECORD_SCRIPT)
|
||||
@echo " return \"\"" >> $(RECORD_SCRIPT)
|
||||
@echo " endif" >> $(RECORD_SCRIPT)
|
||||
@echo "endf" >> $(RECORD_SCRIPT)
|
||||
@echo "let files = readfile('.record')" >> $(RECORD_SCRIPT)
|
||||
@echo "let package_name = remove(files,0)" >> $(RECORD_SCRIPT)
|
||||
@echo "let script_version = remove(files,0)" >> $(RECORD_SCRIPT)
|
||||
@echo "let record = { 'version' : 0.3 , 'generated_by': 'Vim-Makefile' , 'script_version': script_version , 'install_type' : 'makefile' , 'package' : package_name , 'files': [ ] }" >> $(RECORD_SCRIPT)
|
||||
@echo "for file in files " >> $(RECORD_SCRIPT)
|
||||
@echo " let md5 = s:mkmd5(file)" >> $(RECORD_SCRIPT)
|
||||
@echo " cal add( record.files , { 'checksum': md5 , 'file': file } )" >> $(RECORD_SCRIPT)
|
||||
@echo "endfor" >> $(RECORD_SCRIPT)
|
||||
@echo "redir => output" >> $(RECORD_SCRIPT)
|
||||
@echo "silent echon record" >> $(RECORD_SCRIPT)
|
||||
@echo "redir END" >> $(RECORD_SCRIPT)
|
||||
@echo "let content = join(split(output,\"\\\\n\"),'')" >> $(RECORD_SCRIPT)
|
||||
@echo "let record_file = expand('~/.vim/record/' . package_name )" >> $(RECORD_SCRIPT)
|
||||
@echo "cal writefile( [content] , record_file )" >> $(RECORD_SCRIPT)
|
||||
@echo "cal delete('.record')" >> $(RECORD_SCRIPT)
|
||||
@echo "echo \"Done\"" >> $(RECORD_SCRIPT)
|
||||
|
||||
|
||||
record: mkfilelist mkrecordscript |
||||
vim --noplugin -V10install.log -c "so $(RECORD_SCRIPT)" -c "q"
|
||||
@echo "Vim script record making log: install.log"
|
||||
# @rm -vf $(RECORD_FILE)
|
||||
|
||||
rmrecord: |
||||
@echo "Removing Record"
|
||||
@rm -vf $(VIMRUNTIME)/record/$(NAME)
|
||||
|
||||
clean: clean-bundle-deps |
||||
@rm -vf $(RECORD_FILE)
|
||||
@rm -vf $(RECORD_SCRIPT)
|
||||
@rm -vf install.log
|
||||
@rm -vf *.tar.gz
|
||||
|
||||
clean-bundle-deps: |
||||
@echo "Removing Bundled scripts..."
|
||||
@if [[ -e .bundlefiles ]] ; then \
|
||||
rm -fv `echo \`cat .bundlefiles\``; \
|
||||
fi
|
||||
@rm -fv .bundlefiles
|
||||
|
||||
update: |
||||
@echo "Updating Makefile..."
|
||||
@URL=http://github.com/c9s/vim-makefile/raw/master/Makefile ; \
|
||||
if [[ -n `which curl` ]]; then \
|
||||
curl $$URL -o Makefile ; \
|
||||
if [[ -n `which wget` ]]; then \
|
||||
wget -c $$URL ; \
|
||||
elif [[ -n `which fetch` ]]; then \
|
||||
fetch $$URL ; \
|
||||
fi
|
||||
|
||||
version: |
||||
@echo version - $(MAKEFILE_VERSION)
|
||||
|
||||
# }}}
|
@ -0,0 +1,182 @@
@@ -0,0 +1,182 @@
|
||||
javascript-libraries-syntax.vim |
||||
=============================== |
||||
|
||||
Syntax file for JavaScript libraries. Supports JavaScript libraries I am using (patches welcome). |
||||
Should work well with other JavaScript syntax files. [SyntaxComplete][] also works well on all |
||||
supported languages. |
||||
|
||||
[SyntaxComplete]:http://www.vim.org/scripts/script.php?script_id=3172 |
||||
|
||||
Libraries |
||||
--------- |
||||
|
||||
* [jQuery](http://jquery.com/) |
||||
* [underscore.js](http://underscorejs.org/) |
||||
* [lo-dash](http://lodash.com/) |
||||
* [Backbone.js](http://backbonejs.org/) |
||||
* [prelude.ls](http://gkz.github.com/prelude-ls/) |
||||
* [AngularJS](http://angularjs.org/) |
||||
* [AngularUI](http://angular-ui.github.io) |
||||
* [AngularUI Router](http://angular-ui.github.io/ui-router/) |
||||
* [React](https://facebook.github.io/react/) |
||||
* [Flux](https://facebook.github.io/flux/) |
||||
* [RequireJS](http://requirejs.org/) |
||||
* [Sugar.js](http://sugarjs.com/) |
||||
* [Jasmine](http://pivotal.github.io/jasmine/) |
||||
* [Chai](http://chaijs.com/) |
||||
* [Handlebars](http://handlebarsjs.com/) |
||||
|
||||
File Types |
||||
---------- |
||||
|
||||
* JavaScript |
||||
* [CoffeeScript](http://coffeescript.org/) |
||||
* [LiveScript](http://livescript.net/) |
||||
* [TypeScript](http://www.typescriptlang.org/) |
||||
|
||||
Will be more when SyntaxComplete has new version. |
||||
|
||||
Install |
||||
------- |
||||
|
||||
Use [pathogen][] or [vundle][] is recommended. |
||||
|
||||
[pathogen]:http://www.vim.org/scripts/script.php?script_id=2332 |
||||
[vundle]:https://github.com/gmarik/vundle |
||||
|
||||
Config |
||||
------ |
||||
|
||||
You can use g:used_javascript_libs to setup used libraries, ex: |
||||
|
||||
```viml |
||||
let g:used_javascript_libs = 'underscore,backbone' |
||||
``` |
||||
|
||||
Support libs id: |
||||
|
||||
* jQuery: jquery |
||||
* underscore.js: underscore |
||||
* Lo-Dash: underscore |
||||
* Backbone.js: backbone |
||||
* prelude.ls: prelude |
||||
* AngularJS: angularjs |
||||
* AngularUI: angularui |
||||
* AngularUI Router: angularuirouter |
||||
* React: react |
||||
* Flux: flux |
||||
* RequireJS: requirejs |
||||
* Sugar.js: sugar |
||||
* Jasmine: jasmine |
||||
* Chai: chai |
||||
* Handlebars: handlebars |
||||
|
||||
Default lib set is: `jquery,underscore,backbone` |
||||
|
||||
You can use [local vimrc][] to setup libraries used in project. Sample code for local vimrc: |
||||
|
||||
```viml |
||||
autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1 |
||||
autocmd BufReadPre *.js let b:javascript_lib_use_underscore = 1 |
||||
autocmd BufReadPre *.js let b:javascript_lib_use_backbone = 1 |
||||
autocmd BufReadPre *.js let b:javascript_lib_use_prelude = 0 |
||||
autocmd BufReadPre *.js let b:javascript_lib_use_angularjs = 0 |
||||
``` |
||||
|
||||
[local vimrc]:https://github.com/MarcWeber/vim-addon-local-vimrc |
||||
|
||||
Todo |
||||
---- |
||||
|
||||
* Support future version of SyntaxComplete |
||||
|
||||
Known Issue |
||||
----------- |
||||
|
||||
SyntaxComplete only accept groups with filetype prefixed. For example, 'javascript' files. |
||||
Only keywords in groups which's name matches /javascript.*/ will be available. So to make it |
||||
possible to use SyntaxComplete on CoffeeScript, LiveScript and other compile to JavaScript |
||||
languages. We must redefine all syntax many times, with different name prefix. SyntaxComplete |
||||
might have new feature to support a user define pattern for group name to include. |
||||
All repeat defination will be removed when SyntaxComplete supports this feature. |
||||
|
||||
Changes |
||||
------- |
||||
|
||||
### Version 0.4 |
||||
* Add React, Flux, Chai, Handlbars |
||||
* Default lib set |
||||
* Bug fix |
||||
|
||||
### Version 0.3.6 |
||||
* Add Jasmine, AngularUI |
||||
* Update underscore, jQuery |
||||
|
||||
### Version 0.3.5 |
||||
* Add sugar.js support |
||||
* b:current_syntax to detect current syntax |
||||
|
||||
### Version 0.3.4 |
||||
* Add $ to iskeyword for jQuery and angular (Issue #4) |
||||
* Support linecomment (Issue #6) |
||||
* Add augularjs HTML custom attribute support |
||||
|
||||
### Version 0.3.3 |
||||
* No strict mode, better compatibility. |
||||
|
||||
### Version 0.3.2 |
||||
* Fix coffee script compatible |
||||
* Update jQuery syntax to latest version |
||||
* Support lo-dash |
||||
* jQuery selector update |
||||
* Minor bug fix |
||||
|
||||
### Version 0.3.1 |
||||
* Fix performance issue |
||||
|
||||
### Version 0.3 |
||||
* Supports AngularJS, RequireJS |
||||
* Support TypeScript |
||||
* Setup used libraries |
||||
* Better init way |
||||
|
||||
### Version 0.2 |
||||
* Supports library selection |
||||
|
||||
### Version 0.1 |
||||
* First release. |
||||
|
||||
Credits |
||||
------- |
||||
|
||||
* Bruno Michel, [jQuery : Syntax file for jQuery][jquery.vim] |
||||
* [Peter Renström][], for [summarize and explain AngularJS stuff][issue1]. |
||||
|
||||
[jquery.vim]:http://www.vim.org/scripts/script.php?script_id=2416 |
||||
[Peter Renström]:https://github.com/renstrom |
||||
[issue1]:https://github.com/othree/javascript-libraries-syntax.vim/issues/1 |
||||
|
||||
License |
||||
------- |
||||
|
||||
Copyright (c) 2013 Wei-Ko Kao |
||||
|
||||
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. |
||||
|
||||
|
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
" Vim plugin file |
||||
" Language: |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/08/26 |
||||
" Version: 0.4.1 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
if b:current_syntax == 'coffee' |
||||
call jslibsyntax#load() |
||||
endif |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
" Vim plugin file |
||||
" Language: |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/08/26 |
||||
" Version: 0.5.1 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
if b:current_syntax == 'html' |
||||
call jslibsyntax#load() |
||||
endif |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
" Vim plugin file |
||||
" Language: |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/08/26 |
||||
" Version: 0.4.1 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
if b:current_syntax == 'javascript' |
||||
call jslibsyntax#load() |
||||
endif |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
" Vim plugin file |
||||
" Language: |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/08/26 |
||||
" Version: 0.4.1 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
if b:current_syntax == 'ls' |
||||
call jslibsyntax#load() |
||||
endif |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
" Vim plugin file |
||||
" Language: |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/08/26 |
||||
" Version: 0.4.1 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
if b:current_syntax == 'typescript' |
||||
call jslibsyntax#load() |
||||
endif |
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
" Vim plugin file |
||||
" Language: JS Lib syntax loader |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/30 |
||||
" Version: 0.4 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
|
||||
let s:libs = [ |
||||
\ 'jquery', |
||||
\ 'underscore', |
||||
\ 'backbone', |
||||
\ 'prelude', |
||||
\ 'angularjs', |
||||
\ 'angularui', |
||||
\ 'angularuirouter', |
||||
\ 'requirejs', |
||||
\ 'sugar', |
||||
\ 'jasmine', |
||||
\ 'chai', |
||||
\ 'react', |
||||
\ 'flux', |
||||
\ 'handlebars' |
||||
\ ] |
||||
|
||||
let s:default_libs = [ |
||||
\ 'jquery', |
||||
\ 'underscore', |
||||
\ 'backbone', |
||||
\ 'react' |
||||
\ ] |
||||
|
||||
let s:path = expand('<sfile>:p:h') |
||||
|
||||
function! jslibsyntax#load() |
||||
if !exists('g:used_javascript_libs') |
||||
let g:used_javascript_libs = join(s:default_libs, ',') |
||||
endif |
||||
|
||||
let index = 0 |
||||
let loaded = 0 |
||||
while index < len(s:libs) |
||||
let lib = s:libs[index] |
||||
let use = g:used_javascript_libs =~ lib |
||||
if exists('b:javascript_lib_use_'.lib) |
||||
exec('let use = b:javascript_lib_use_'.lib) |
||||
endif |
||||
if use |
||||
let fn = s:path.'/syntax/'.lib.'.'.b:current_syntax.'.vim' |
||||
if filereadable(fn) |
||||
exe('source '.fnameescape(fn)) |
||||
let loaded = loaded + 1 |
||||
endif |
||||
endif |
||||
let index = index + 1 |
||||
endwhile |
||||
let fn = s:path.'/syntax/postprocess.'.b:current_syntax.'.vim' |
||||
if loaded > 0 && filereadable(fn) |
||||
exe('source '.fnameescape(fn)) |
||||
endif |
||||
endfunction |
||||
|
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
" Vim syntax file |
||||
" Language: AngularJS for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 1.1.13.1 |
||||
" URL: http://angularjs.org/ |
||||
|
||||
syntax keyword coffeeAngular angular containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeAngulardot |
||||
syntax match coffeeAngulardot contained /\./ nextgroup=coffeeAngularMethods |
||||
syntax keyword coffeeAngularMethods contained bind bootstrap copy element equals |
||||
syntax keyword coffeeAngularMethods contained extend forEach fromJson identity injector |
||||
syntax keyword coffeeAngularMethods contained isArray isDate isDefined isElement isFunction |
||||
syntax keyword coffeeAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||
syntax keyword coffeeAngularMethods contained mock module noop toJson uppercase version |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $anchorScroll $cacheFactory $compile $controller $document |
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $exceptionHandler $filter $httpBackend |
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $locale $parse $rootElement |
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $routeParams $templateCache $window |
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $cookies $resource $sanitize |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $http nextgroup=coffeeAShttpdot |
||||
syntax match coffeeAShttpdot contained /\./ nextgroup=coffeeAShttpMethods |
||||
syntax keyword coffeeAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $interpolate nextgroup=coffeeASinterpolatedot |
||||
syntax match coffeeASinterpolatedot contained /\./ nextgroup=coffeeASinterpolateMethods |
||||
syntax keyword coffeeASinterpolateMethods contained endSymbol startSymbol |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $location nextgroup=coffeeASlocationdot |
||||
syntax match coffeeASlocationdot contained /\./ nextgroup=coffeeASlocationMethods |
||||
syntax keyword coffeeASlocationMethods contained absUrl hash host path port protocol replace search url |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $log nextgroup=coffeeASlogdot |
||||
syntax match coffeeASlogdot contained /\./ nextgroup=coffeeASlogMethods |
||||
syntax keyword coffeeASlogMethods contained error info log warn |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $q nextgroup=coffeeASqdot |
||||
syntax match coffeeASqdot contained /\./ nextgroup=coffeeASqMethods |
||||
syntax keyword coffeeASqMethods contained all defer reject when |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $route nextgroup=coffeeASroutedot |
||||
syntax match coffeeASroutedot contained /\./ nextgroup=coffeeASrouteMethods |
||||
syntax keyword coffeeASrouteMethods contained reload current route |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $timeout nextgroup=coffeeAStimeoutdot |
||||
syntax match coffeeAStimeoutdot contained /\./ nextgroup=coffeeAStimeoutMethods |
||||
syntax keyword coffeeAStimeoutMethods contained cancel |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $scope $rootScope nextgroup=coffeeASscopedot |
||||
syntax match coffeeASscopedot contained /\./ nextgroup=coffeeASscopeMethods |
||||
syntax keyword coffeeASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||
|
||||
syntax keyword coffeeAServices containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $cookieStore nextgroup=coffeeAScookieStoredot |
||||
syntax match coffeeAScookieStoredot contained /\./ nextgroup=coffeeAScookieStoreMethods |
||||
syntax keyword coffeeAScookieStoreMethods contained get put remove |
||||
|
||||
syntax cluster coffeeAFunctions contains=coffeeAMFunctions |
||||
syntax cluster coffeeAAttrs contains=coffeeAMAttrs |
||||
|
||||
syntax keyword coffeeAMFunctions contained config constant controller directive factory |
||||
syntax keyword coffeeAMFunctions contained filter provider run service value |
||||
syntax keyword coffeeAMAttrs contained name requires |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularjs_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_angularjs_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeAngular Constant |
||||
HiLink coffeeAServices Constant |
||||
|
||||
HiLink coffeeAngularMethods PreProc |
||||
HiLink coffeeAMFunctions PreProc |
||||
HiLink coffeeAMAttrs PreProc |
||||
|
||||
HiLink coffeeAShttpMethods PreProc |
||||
HiLink coffeeASinterpolateMethods PreProc |
||||
HiLink coffeeASlocationMethods PreProc |
||||
HiLink coffeeASlogMethods PreProc |
||||
HiLink coffeeASqMethods PreProc |
||||
HiLink coffeeASrouteMethods PreProc |
||||
HiLink coffeeAStimeoutMethods PreProc |
||||
HiLink coffeeASscopeMethods PreProc |
||||
HiLink coffeeAScookieStoreMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
" Vim syntax file |
||||
" Language: AngularJS for javascript |
||||
" Maintainer: othree <othree@gmail.com>, Rafael Benevides <rafabene@gmail.com> |
||||
" Last Change: 2015/10/04 |
||||
" Version: 1.4.5 - Taken from: https://code.angularjs.org/1.4.5/docs/api/ng/directive |
||||
" URL: http://angularjs.org/ |
||||
|
||||
setlocal iskeyword+=- |
||||
|
||||
syntax keyword htmlArg contained ng-app ng-bind ng-bind-html ng-bind-template ng-blur ng-change ng-checked ng-class |
||||
syntax keyword htmlArg contained ng-class-even ng-class-odd ng-click ng-cloak ng-controller ng-copy ng-csp ng-dblclick |
||||
syntax keyword htmlArg contained ng-disabled ng-form ng-hide ng-href ng-if ng-include ng-init ng-jq ng-keydown ng-keypress |
||||
syntax keyword htmlArg contained ng-keyup ng-list ng-model ng-model-options ng-mousedown ng-mouseenter ng-mouseleave ng-mousemove |
||||
syntax keyword htmlArg contained ng-mouseover ng-mouseup ng-non-bindable ng-open ng-options ng-paste ng-pluralize ng-readonly |
||||
syntax keyword htmlArg contained ng-repeat ng-selected ng-show ng-src ng-srcset ng-style ng-submit ng-switch ng-switch-when |
||||
syntax keyword htmlArg contained ng-switch-default ng-transclude ng-view |
||||
"Input directives |
||||
syntax keyword htmlArg contained ng-required ng-minlength ng-maxlength ng-pattern ng-trim ng-true-values ng-false-values ng-min ng-max |
||||
|
||||
" http://docs.angularjs.org/guide/directive |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(app\|bind\|bind-html\|blur\|bind-template\|change\|checked\|class\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(class-even\|class-odd\|click\|cloak\|controller\|copy\|csp\|dblclick\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(disabled\|form\|hide\|href\|if\|include\|init\|jq\|keydown\|keypress\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(keyup\|list\|model\|model-options\|mousedown\|mouseenter\|mouseleave\|mousemove\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(mouseover\|mouseup\|non-bindable\|open\|options\|paste\|pluralize\|readonly\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(repeat\|selected\|show\|src\|srset\|style\|submit\|switch\|switch-when\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(switch-default\|transclude\|view\)/ |
||||
syntax match htmlArg contained /\(ng_\|ng:\|x-ng-\)\(required\|minlength\|maxlength\|pattern\|trim\|true-values\|false-values\|min\|max\)/ |
||||
|
||||
syntax keyword htmlArg contained expression autoscroll count when offset on |
||||
|
||||
syntax keyword htmlTagName contained ng-form ng-include ng-pluralize ng-transclude ng-view |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
" Vim syntax file |
||||
" Language: AngularJS for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 1.1.13.1 |
||||
" URL: http://angularjs.org/ |
||||
|
||||
syntax keyword javascriptAngular angular containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptAngulardot |
||||
syntax match javascriptAngulardot contained /\./ nextgroup=javascriptAngularMethods |
||||
syntax keyword javascriptAngularMethods contained bind bootstrap copy element equals |
||||
syntax keyword javascriptAngularMethods contained extend forEach fromJson identity injector |
||||
syntax keyword javascriptAngularMethods contained isArray isDate isDefined isElement isFunction |
||||
syntax keyword javascriptAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||
syntax keyword javascriptAngularMethods contained mock module noop toJson uppercase version |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $anchorScroll $cacheFactory $compile $controller $document |
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $exceptionHandler $filter $httpBackend |
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $locale $parse $rootElement |
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $routeParams $templateCache $window |
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $cookies $resource $sanitize |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $http nextgroup=javascriptAShttpdot |
||||
syntax match javascriptAShttpdot contained /\./ nextgroup=javascriptAShttpMethods |
||||
syntax keyword javascriptAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $interpolate nextgroup=javascriptASinterpolatedot |
||||
syntax match javascriptASinterpolatedot contained /\./ nextgroup=javascriptASinterpolateMethods |
||||
syntax keyword javascriptASinterpolateMethods contained endSymbol startSymbol |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $location nextgroup=javascriptASlocationdot |
||||
syntax match javascriptASlocationdot contained /\./ nextgroup=javascriptASlocationMethods |
||||
syntax keyword javascriptASlocationMethods contained absUrl hash host path port protocol replace search url |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $log nextgroup=javascriptASlogdot |
||||
syntax match javascriptASlogdot contained /\./ nextgroup=javascriptASlogMethods |
||||
syntax keyword javascriptASlogMethods contained error info log warn |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $q nextgroup=javascriptASqdot |
||||
syntax match javascriptASqdot contained /\./ nextgroup=javascriptASqMethods |
||||
syntax keyword javascriptASqMethods contained all defer reject when |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $route nextgroup=javascriptASroutedot |
||||
syntax match javascriptASroutedot contained /\./ nextgroup=javascriptASrouteMethods |
||||
syntax keyword javascriptASrouteMethods contained reload current route |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $timeout nextgroup=javascriptAStimeoutdot |
||||
syntax match javascriptAStimeoutdot contained /\./ nextgroup=javascriptAStimeoutMethods |
||||
syntax keyword javascriptAStimeoutMethods contained cancel |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $scope $rootScope nextgroup=javascriptASscopedot |
||||
syntax match javascriptASscopedot contained /\./ nextgroup=javascriptASscopeMethods |
||||
syntax keyword javascriptASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||
|
||||
syntax keyword javascriptAServices containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $cookieStore nextgroup=javascriptAScookieStoredot |
||||
syntax match javascriptAScookieStoredot contained /\./ nextgroup=javascriptAScookieStoreMethods |
||||
syntax keyword javascriptAScookieStoreMethods contained get put remove |
||||
|
||||
syntax cluster javascriptAFunctions contains=javascriptAMFunctions |
||||
syntax cluster javascriptAAttrs contains=javascriptAMAttrs |
||||
|
||||
syntax keyword javascriptAMFunctions contained config constant controller directive factory |
||||
syntax keyword javascriptAMFunctions contained filter provider run service value |
||||
syntax keyword javascriptAMAttrs contained name requires |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularjs_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_angularjs_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptAngular Constant |
||||
HiLink javascriptAServices Constant |
||||
|
||||
HiLink javascriptAngularMethods PreProc |
||||
HiLink javascriptAMFunctions PreProc |
||||
HiLink javascriptAMAttrs PreProc |
||||
|
||||
HiLink javascriptAShttpMethods PreProc |
||||
HiLink javascriptASinterpolateMethods PreProc |
||||
HiLink javascriptASlocationMethods PreProc |
||||
HiLink javascriptASlogMethods PreProc |
||||
HiLink javascriptASqMethods PreProc |
||||
HiLink javascriptASrouteMethods PreProc |
||||
HiLink javascriptAStimeoutMethods PreProc |
||||
HiLink javascriptASscopeMethods PreProc |
||||
HiLink javascriptAScookieStoreMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
" Vim syntax file |
||||
" Language: AngularJS for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 1.1.13.1 |
||||
" URL: http://angularjs.org/ |
||||
|
||||
syntax keyword lsAngular angular containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsAngulardot |
||||
syntax match lsAngulardot contained /\./ nextgroup=lsAngularMethods |
||||
syntax keyword lsAngularMethods contained bind bootstrap copy element equals |
||||
syntax keyword lsAngularMethods contained extend forEach fromJson identity injector |
||||
syntax keyword lsAngularMethods contained isArray isDate isDefined isElement isFunction |
||||
syntax keyword lsAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||
syntax keyword lsAngularMethods contained mock module noop toJson uppercase version |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $anchorScroll $cacheFactory $compile $controller $document |
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $exceptionHandler $filter $httpBackend |
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $locale $parse $rootElement |
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $routeParams $templateCache $window |
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $cookies $resource $sanitize |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $http nextgroup=lsAShttpdot |
||||
syntax match lsAShttpdot contained /\./ nextgroup=lsAShttpMethods |
||||
syntax keyword lsAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $interpolate nextgroup=lsASinterpolatedot |
||||
syntax match lsASinterpolatedot contained /\./ nextgroup=lsASinterpolateMethods |
||||
syntax keyword lsASinterpolateMethods contained endSymbol startSymbol |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $location nextgroup=lsASlocationdot |
||||
syntax match lsASlocationdot contained /\./ nextgroup=lsASlocationMethods |
||||
syntax keyword lsASlocationMethods contained absUrl hash host path port protocol replace search url |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $log nextgroup=lsASlogdot |
||||
syntax match lsASlogdot contained /\./ nextgroup=lsASlogMethods |
||||
syntax keyword lsASlogMethods contained error info log warn |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $q nextgroup=lsASqdot |
||||
syntax match lsASqdot contained /\./ nextgroup=lsASqMethods |
||||
syntax keyword lsASqMethods contained all defer reject when |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $route nextgroup=lsASroutedot |
||||
syntax match lsASroutedot contained /\./ nextgroup=lsASrouteMethods |
||||
syntax keyword lsASrouteMethods contained reload current route |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $timeout nextgroup=lsAStimeoutdot |
||||
syntax match lsAStimeoutdot contained /\./ nextgroup=lsAStimeoutMethods |
||||
syntax keyword lsAStimeoutMethods contained cancel |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $scope $rootScope nextgroup=lsASscopedot |
||||
syntax match lsASscopedot contained /\./ nextgroup=lsASscopeMethods |
||||
syntax keyword lsASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||
|
||||
syntax keyword lsAServices containedin=ALLBUT,lsComment,lsLineComment,lsString $cookieStore nextgroup=lsAScookieStoredot |
||||
syntax match lsAScookieStoredot contained /\./ nextgroup=lsAScookieStoreMethods |
||||
syntax keyword lsAScookieStoreMethods contained get put remove |
||||
|
||||
syntax cluster lsAFunctions contains=lsAMFunctions |
||||
syntax cluster lsAAttrs contains=lsAMAttrs |
||||
|
||||
syntax keyword lsAMFunctions contained config constant controller directive factory |
||||
syntax keyword lsAMFunctions contained filter provider run service value |
||||
syntax keyword lsAMAttrs contained name requires |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularjs_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_angularjs_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsAngular Constant |
||||
HiLink lsAServices Constant |
||||
|
||||
HiLink lsAngularMethods PreProc |
||||
HiLink lsAMFunctions PreProc |
||||
HiLink lsAMAttrs PreProc |
||||
|
||||
HiLink lsAShttpMethods PreProc |
||||
HiLink lsASinterpolateMethods PreProc |
||||
HiLink lsASlocationMethods PreProc |
||||
HiLink lsASlogMethods PreProc |
||||
HiLink lsASqMethods PreProc |
||||
HiLink lsASrouteMethods PreProc |
||||
HiLink lsAStimeoutMethods PreProc |
||||
HiLink lsASscopeMethods PreProc |
||||
HiLink lsAScookieStoreMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
" Vim syntax file |
||||
" Language: AngularJS for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 1.1.13.1 |
||||
" URL: http://angularjs.org/ |
||||
|
||||
syntax keyword typescriptAngular angular containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptAngulardot |
||||
syntax match typescriptAngulardot contained /\./ nextgroup=typescriptAngularMethods |
||||
syntax keyword typescriptAngularMethods contained bind bootstrap copy element equals |
||||
syntax keyword typescriptAngularMethods contained extend forEach fromJson identity injector |
||||
syntax keyword typescriptAngularMethods contained isArray isDate isDefined isElement isFunction |
||||
syntax keyword typescriptAngularMethods contained isNumber isObject isString isUndefined lowercase |
||||
syntax keyword typescriptAngularMethods contained mock module noop toJson uppercase version |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $anchorScroll $cacheFactory $compile $controller $document |
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $exceptionHandler $filter $httpBackend |
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $locale $parse $rootElement |
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $routeParams $templateCache $window |
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $cookies $resource $sanitize |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $http nextgroup=typescriptAShttpdot |
||||
syntax match typescriptAShttpdot contained /\./ nextgroup=typescriptAShttpMethods |
||||
syntax keyword typescriptAShttpMethods contained get head post put delete jsonp defaults prendingRequests |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $interpolate nextgroup=typescriptASinterpolatedot |
||||
syntax match typescriptASinterpolatedot contained /\./ nextgroup=typescriptASinterpolateMethods |
||||
syntax keyword typescriptASinterpolateMethods contained endSymbol startSymbol |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $location nextgroup=typescriptASlocationdot |
||||
syntax match typescriptASlocationdot contained /\./ nextgroup=typescriptASlocationMethods |
||||
syntax keyword typescriptASlocationMethods contained absUrl hash host path port protocol replace search url |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $log nextgroup=typescriptASlogdot |
||||
syntax match typescriptASlogdot contained /\./ nextgroup=typescriptASlogMethods |
||||
syntax keyword typescriptASlogMethods contained error info log warn |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $q nextgroup=typescriptASqdot |
||||
syntax match typescriptASqdot contained /\./ nextgroup=typescriptASqMethods |
||||
syntax keyword typescriptASqMethods contained all defer reject when |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $route nextgroup=typescriptASroutedot |
||||
syntax match typescriptASroutedot contained /\./ nextgroup=typescriptASrouteMethods |
||||
syntax keyword typescriptASrouteMethods contained reload current route |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $timeout nextgroup=typescriptAStimeoutdot |
||||
syntax match typescriptAStimeoutdot contained /\./ nextgroup=typescriptAStimeoutMethods |
||||
syntax keyword typescriptAStimeoutMethods contained cancel |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $scope $rootScope nextgroup=typescriptASscopedot |
||||
syntax match typescriptASscopedot contained /\./ nextgroup=typescriptASscopeMethods |
||||
syntax keyword typescriptASscopeMethods contained $apply $broadcast $destroy $digest $emit $eval $evalAsync $new $on $watch $id |
||||
|
||||
syntax keyword typescriptAServices containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $cookieStore nextgroup=typescriptAScookieStoredot |
||||
syntax match typescriptAScookieStoredot contained /\./ nextgroup=typescriptAScookieStoreMethods |
||||
syntax keyword typescriptAScookieStoreMethods contained get put remove |
||||
|
||||
syntax cluster typescriptAFunctions contains=typescriptAMFunctions |
||||
syntax cluster typescriptAAttrs contains=typescriptAMAttrs |
||||
|
||||
syntax keyword typescriptAMFunctions contained config constant controller directive factory |
||||
syntax keyword typescriptAMFunctions contained filter provider run service value |
||||
syntax keyword typescriptAMAttrs contained name requires |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularjs_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_angularjs_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptAngular Constant |
||||
HiLink typescriptAServices Constant |
||||
|
||||
HiLink typescriptAngularMethods PreProc |
||||
HiLink typescriptAMFunctions PreProc |
||||
HiLink typescriptAMAttrs PreProc |
||||
|
||||
HiLink typescriptAShttpMethods PreProc |
||||
HiLink typescriptASinterpolateMethods PreProc |
||||
HiLink typescriptASlocationMethods PreProc |
||||
HiLink typescriptASlogMethods PreProc |
||||
HiLink typescriptASqMethods PreProc |
||||
HiLink typescriptASrouteMethods PreProc |
||||
HiLink typescriptAStimeoutMethods PreProc |
||||
HiLink typescriptASscopeMethods PreProc |
||||
HiLink typescriptAScookieStoreMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
" Vim syntax file |
||||
" Language: AngularUI for HTML |
||||
" Maintainer: Tom Vincent <http://tlvince.com/contact> |
||||
" URL: http://angular-ui.github.io |
||||
|
||||
setlocal iskeyword+=- |
||||
|
||||
syntax keyword htmlArg contained ui-view ui-event ui-match ui-include ui-jq |
||||
syntax keyword htmlArg contained ui-keypress ui-keydown ui-keyup ui-options |
||||
syntax keyword htmlArg contained ui-reset ui-route ui-scrollfixed ui-show |
||||
syntax keyword htmlArg contained ui-hide ui-toggle ui-validate ui-date |
||||
syntax keyword htmlArg contained ui-codemirror ui-ace ui-calendar ui-map |
||||
syntax keyword htmlArg contained ui-select2 ui-tinymce ui-sortable ui-sref |
||||
syntax keyword htmlArg contained ui-sref-active |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file |
||||
" Language: AngularUI Router for coffee |
||||
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||
" URL: http://angular-ui.github.io/ui-router/ |
||||
|
||||
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $stateProvider nextgroup=coffeeASstateProviderdot |
||||
syntax match coffeeASstateProverdot contained /\./ nextgroup=coffeeASstateProviderMethods |
||||
syntax keyword coffeeASstateProviderMethods contained state decorator |
||||
|
||||
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $urlRouterProvider nextgroup=coffeeASurlRouterProviderdot |
||||
syntax match coffeeASstateProverdot contained /\./ nextgroup=coffeeASurlRouterProviderMethods |
||||
syntax keyword coffeeASurlRouterProviderMethods contained when otherwise rule |
||||
|
||||
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $state nextgroup=coffeeASstatedot |
||||
syntax match coffeeASstatedot contained /\./ nextgroup=coffeeASstateMethods |
||||
syntax keyword coffeeASstateMethods contained current get go href includes is reload transitionTo |
||||
|
||||
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $urlRouter nextgroup=coffeeASurlRouterdot |
||||
syntax match coffeeASurlRouterdot contained /\./ nextgroup=coffeeASurlRouterMethods |
||||
syntax keyword coffeeASurlRouterMethods contained href sync |
||||
|
||||
syntax keyword coffeeUIRouter containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString $stateParams $uiViewScroll |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularui_router_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_angularui_router_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeUIRouter Constant |
||||
|
||||
HiLink coffeeASstateProviderMethods PreProc |
||||
HiLink coffeeASurlRouterProviderMethods PreProc |
||||
HiLink coffeeASstateMethods PreProc |
||||
HiLink coffeeASurlRouterMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file |
||||
" Language: AngularUI Router for javascript |
||||
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||
" URL: http://angular-ui.github.io/ui-router/ |
||||
|
||||
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $stateProvider nextgroup=javascriptASstateProviderdot |
||||
syntax match javascriptASstateProverdot contained /\./ nextgroup=javascriptASstateProviderMethods |
||||
syntax keyword javascriptASstateProviderMethods contained state decorator |
||||
|
||||
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $urlRouterProvider nextgroup=javascriptASurlRouterProviderdot |
||||
syntax match javascriptASstateProverdot contained /\./ nextgroup=javascriptASurlRouterProviderMethods |
||||
syntax keyword javascriptASurlRouterProviderMethods contained when otherwise rule |
||||
|
||||
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $state nextgroup=javascriptASstatedot |
||||
syntax match javascriptASstatedot contained /\./ nextgroup=javascriptASstateMethods |
||||
syntax keyword javascriptASstateMethods contained current get go href includes is reload transitionTo |
||||
|
||||
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $urlRouter nextgroup=javascriptASurlRouterdot |
||||
syntax match javascriptASurlRouterdot contained /\./ nextgroup=javascriptASurlRouterMethods |
||||
syntax keyword javascriptASurlRouterMethods contained href sync |
||||
|
||||
syntax keyword javascriptUIRouter containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString $stateParams $uiViewScroll |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularui_router_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_angularui_router_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptUIRouter Constant |
||||
|
||||
HiLink javascriptASstateProviderMethods PreProc |
||||
HiLink javascriptASurlRouterProviderMethods PreProc |
||||
HiLink javascriptASstateMethods PreProc |
||||
HiLink javascriptASurlRouterMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file |
||||
" Language: AngularUI Router for ls |
||||
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||
" URL: http://angular-ui.github.io/ui-router/ |
||||
|
||||
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $stateProvider nextgroup=lsASstateProviderdot |
||||
syntax match lsASstateProverdot contained /\./ nextgroup=lsASstateProviderMethods |
||||
syntax keyword lsASstateProviderMethods contained state decorator |
||||
|
||||
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $urlRouterProvider nextgroup=lsASurlRouterProviderdot |
||||
syntax match lsASstateProverdot contained /\./ nextgroup=lsASurlRouterProviderMethods |
||||
syntax keyword lsASurlRouterProviderMethods contained when otherwise rule |
||||
|
||||
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $state nextgroup=lsASstatedot |
||||
syntax match lsASstatedot contained /\./ nextgroup=lsASstateMethods |
||||
syntax keyword lsASstateMethods contained current get go href includes is reload transitionTo |
||||
|
||||
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $urlRouter nextgroup=lsASurlRouterdot |
||||
syntax match lsASurlRouterdot contained /\./ nextgroup=lsASurlRouterMethods |
||||
syntax keyword lsASurlRouterMethods contained href sync |
||||
|
||||
syntax keyword lsUIRouter containedin=ALLBUT,lsComment,lsLineComment,lsString $stateParams $uiViewScroll |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularui_router_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_angularui_router_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsUIRouter Constant |
||||
|
||||
HiLink lsASstateProviderMethods PreProc |
||||
HiLink lsASurlRouterProviderMethods PreProc |
||||
HiLink lsASstateMethods PreProc |
||||
HiLink lsASurlRouterMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file |
||||
" Language: AngularUI Router for typescript |
||||
" Maintainer: Dan Hansen <https://www.linkedin.com/in/dansomething> |
||||
" URL: http://angular-ui.github.io/ui-router/ |
||||
|
||||
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $stateProvider nextgroup=typescriptASstateProviderdot |
||||
syntax match typescriptASstateProverdot contained /\./ nextgroup=typescriptASstateProviderMethods |
||||
syntax keyword typescriptASstateProviderMethods contained state decorator |
||||
|
||||
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $urlRouterProvider nextgroup=typescriptASurlRouterProviderdot |
||||
syntax match typescriptASstateProverdot contained /\./ nextgroup=typescriptASurlRouterProviderMethods |
||||
syntax keyword typescriptASurlRouterProviderMethods contained when otherwise rule |
||||
|
||||
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $state nextgroup=typescriptASstatedot |
||||
syntax match typescriptASstatedot contained /\./ nextgroup=typescriptASstateMethods |
||||
syntax keyword typescriptASstateMethods contained current get go href includes is reload transitionTo |
||||
|
||||
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $urlRouter nextgroup=typescriptASurlRouterdot |
||||
syntax match typescriptASurlRouterdot contained /\./ nextgroup=typescriptASurlRouterMethods |
||||
syntax keyword typescriptASurlRouterMethods contained href sync |
||||
|
||||
syntax keyword typescriptUIRouter containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString $stateParams $uiViewScroll |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_angularui_router_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_angularui_router_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptUIRouter Constant |
||||
|
||||
HiLink typescriptASstateProviderMethods PreProc |
||||
HiLink typescriptASurlRouterProviderMethods PreProc |
||||
HiLink typescriptASstateMethods PreProc |
||||
HiLink typescriptASurlRouterMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
" Vim syntax file |
||||
" Language: Backbone.js for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2016/01/07 |
||||
" Version: 1.2.3 |
||||
" URL: http://backbonejs.org/ |
||||
|
||||
syntax keyword coffeeBackbone Backbone containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution,coffeeBDot |
||||
syntax match coffeeBDot contained /\./ nextgroup=coffeeBObjects |
||||
syntax keyword coffeeBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||
|
||||
syntax cluster coffeeBFunctions contains=coffeeBEvents,coffeeBModel,coffeeBCollection,coffeeBRouter,coffeeBHistory,coffeeBSync,coffeeBView,coffeeBUtility |
||||
syntax cluster coffeeBAttrs contains=coffeeBModelAttrs,coffeeBCollectionAttrs,coffeeBRouterAttrs,coffeeBSyncAttrs,coffeeBViewAttrs |
||||
|
||||
syntax keyword coffeeBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||
syntax keyword coffeeBModel contained extend constructor initialize get set escape has unset clear |
||||
syntax keyword coffeeBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||
syntax keyword coffeeBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||
syntax keyword coffeeBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||
syntax keyword coffeeBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||
syntax keyword coffeeBCollection contained findWhere url parse clone fetch create |
||||
syntax keyword coffeeBRouter contained extend constructor initialize route navigate execute |
||||
syntax keyword coffeeBHistory contained start |
||||
syntax keyword coffeeBSync contained ajax |
||||
syntax keyword coffeeBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||
syntax keyword coffeeBUtility contained noConflict |
||||
|
||||
syntax keyword coffeeBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||
syntax keyword coffeeBCollectionAttrs contained model modelId models length comparator url |
||||
syntax keyword coffeeBRouterAttrs contained routes |
||||
syntax keyword coffeeBViewAttrs contained el attributes events |
||||
syntax keyword coffeeBViewAttrs match /$el/ |
||||
syntax keyword coffeeBViewAttrs match /$/ |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_backbone_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_backbone_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeBackbone Constant |
||||
HiLink coffeeBObjects Constant |
||||
|
||||
HiLink coffeeBEvents PreProc |
||||
HiLink coffeeBModel PreProc |
||||
HiLink coffeeBCollection PreProc |
||||
HiLink coffeeBRouter PreProc |
||||
HiLink coffeeBHistory PreProc |
||||
HiLink coffeeBSync PreProc |
||||
HiLink coffeeBView PreProc |
||||
HiLink coffeeBUtility PreProc |
||||
|
||||
HiLink coffeeBModelAttrs PreProc |
||||
HiLink coffeeBCollectionAttrs PreProc |
||||
HiLink coffeeBRouterAttrs PreProc |
||||
HiLink coffeeBSyncAttrs PreProc |
||||
HiLink coffeeBViewAttrs PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
" Vim syntax file |
||||
" Language: Backbone.js for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2016/01/07 |
||||
" Version: 1.2.3 |
||||
" URL: http://backbonejs.org/ |
||||
|
||||
syntax keyword javascriptBackbone Backbone containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution,javascriptBDot |
||||
syntax match javascriptBDot contained /\./ nextgroup=javascriptBObjects |
||||
syntax keyword javascriptBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||
|
||||
syntax cluster javascriptBFunctions contains=javascriptBEvents,javascriptBModel,javascriptBCollection,javascriptBRouter,javascriptBHistory,javascriptBSync,javascriptBView,javascriptBUtility |
||||
syntax cluster javascriptBAttrs contains=javascriptBModelAttrs,javascriptBCollectionAttrs,javascriptBRouterAttrs,javascriptBSyncAttrs,javascriptBViewAttrs |
||||
|
||||
syntax keyword javascriptBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||
syntax keyword javascriptBModel contained extend constructor initialize get set escape has unset clear |
||||
syntax keyword javascriptBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||
syntax keyword javascriptBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||
syntax keyword javascriptBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||
syntax keyword javascriptBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||
syntax keyword javascriptBCollection contained findWhere url parse clone fetch create |
||||
syntax keyword javascriptBRouter contained extend constructor initialize route navigate execute |
||||
syntax keyword javascriptBHistory contained start |
||||
syntax keyword javascriptBSync contained ajax |
||||
syntax keyword javascriptBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||
syntax keyword javascriptBUtility contained noConflict |
||||
|
||||
syntax keyword javascriptBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||
syntax keyword javascriptBCollectionAttrs contained model modelId models length comparator url |
||||
syntax keyword javascriptBRouterAttrs contained routes |
||||
syntax keyword javascriptBViewAttrs contained el attributes events |
||||
syntax keyword javascriptBViewAttrs match /$el/ |
||||
syntax keyword javascriptBViewAttrs match /$/ |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_backbone_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_backbone_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptBackbone Constant |
||||
HiLink javascriptBObjects Constant |
||||
|
||||
HiLink javascriptBEvents PreProc |
||||
HiLink javascriptBModel PreProc |
||||
HiLink javascriptBCollection PreProc |
||||
HiLink javascriptBRouter PreProc |
||||
HiLink javascriptBHistory PreProc |
||||
HiLink javascriptBSync PreProc |
||||
HiLink javascriptBView PreProc |
||||
HiLink javascriptBUtility PreProc |
||||
|
||||
HiLink javascriptBModelAttrs PreProc |
||||
HiLink javascriptBCollectionAttrs PreProc |
||||
HiLink javascriptBRouterAttrs PreProc |
||||
HiLink javascriptBSyncAttrs PreProc |
||||
HiLink javascriptBViewAttrs PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
" Vim syntax file |
||||
" Language: Backbone.js for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2016/01/07 |
||||
" Version: 1.2.3 |
||||
" URL: http://backbonejs.org/ |
||||
|
||||
syntax keyword lsBackbone Backbone containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution,lsBDot |
||||
syntax match lsBDot contained /\./ nextgroup=lsBObjects |
||||
syntax keyword lsBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||
|
||||
syntax cluster lsBFunctions contains=lsBEvents,lsBModel,lsBCollection,lsBRouter,lsBHistory,lsBSync,lsBView,lsBUtility |
||||
syntax cluster lsBAttrs contains=lsBModelAttrs,lsBCollectionAttrs,lsBRouterAttrs,lsBSyncAttrs,lsBViewAttrs |
||||
|
||||
syntax keyword lsBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||
syntax keyword lsBModel contained extend constructor initialize get set escape has unset clear |
||||
syntax keyword lsBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||
syntax keyword lsBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||
syntax keyword lsBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||
syntax keyword lsBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||
syntax keyword lsBCollection contained findWhere url parse clone fetch create |
||||
syntax keyword lsBRouter contained extend constructor initialize route navigate execute |
||||
syntax keyword lsBHistory contained start |
||||
syntax keyword lsBSync contained ajax |
||||
syntax keyword lsBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||
syntax keyword lsBUtility contained noConflict |
||||
|
||||
syntax keyword lsBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||
syntax keyword lsBCollectionAttrs contained model modelId models length comparator url |
||||
syntax keyword lsBRouterAttrs contained routes |
||||
syntax keyword lsBViewAttrs contained el attributes events |
||||
syntax keyword lsBViewAttrs match /$el/ |
||||
syntax keyword lsBViewAttrs match /$/ |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_backbone_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_backbone_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsBackbone Constant |
||||
HiLink lsBObjects Constant |
||||
|
||||
HiLink lsBEvents PreProc |
||||
HiLink lsBModel PreProc |
||||
HiLink lsBCollection PreProc |
||||
HiLink lsBRouter PreProc |
||||
HiLink lsBHistory PreProc |
||||
HiLink lsBSync PreProc |
||||
HiLink lsBView PreProc |
||||
HiLink lsBUtility PreProc |
||||
|
||||
HiLink lsBModelAttrs PreProc |
||||
HiLink lsBCollectionAttrs PreProc |
||||
HiLink lsBRouterAttrs PreProc |
||||
HiLink lsBSyncAttrs PreProc |
||||
HiLink lsBViewAttrs PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
" Vim syntax file |
||||
" Language: Backbone.js for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2016/01/07 |
||||
" Version: 1.2.3 |
||||
" URL: http://backbonejs.org/ |
||||
|
||||
syntax keyword typescriptBackbone Backbone containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution,typescriptBDot |
||||
syntax match typescriptBDot contained /\./ nextgroup=typescriptBObjects |
||||
syntax keyword typescriptBObjects contained Collection Model View Events Router History Utility sync ajax emulateHTTP emulateJSON |
||||
|
||||
syntax cluster typescriptBFunctions contains=typescriptBEvents,typescriptBModel,typescriptBCollection,typescriptBRouter,typescriptBHistory,typescriptBSync,typescriptBView,typescriptBUtility |
||||
syntax cluster typescriptBAttrs contains=typescriptBModelAttrs,typescriptBCollectionAttrs,typescriptBRouterAttrs,typescriptBSyncAttrs,typescriptBViewAttrs |
||||
|
||||
syntax keyword typescriptBEvents contained on off trigger once listenTo stopListening listenToOnce |
||||
syntax keyword typescriptBModel contained extend constructor initialize get set escape has unset clear |
||||
syntax keyword typescriptBModel contained toJSON sync fetch save destroy validate validationError url parse |
||||
syntax keyword typescriptBModel contained clone isNew hasChanged changedAttributes previous previousAttributes |
||||
syntax keyword typescriptBCollection contained extend constructor initialize toJSON sync add remove reset set get at |
||||
syntax keyword typescriptBCollection contained push pop unshift shift slice length comparator sort pluck where |
||||
syntax keyword typescriptBCollection contained findWhere url parse clone fetch create |
||||
syntax keyword typescriptBRouter contained extend constructor initialize route navigate execute |
||||
syntax keyword typescriptBHistory contained start |
||||
syntax keyword typescriptBSync contained ajax |
||||
syntax keyword typescriptBView contained extend constructor initialize setElement render remove delegateEvents undelegateEvents |
||||
syntax keyword typescriptBUtility contained noConflict |
||||
|
||||
syntax keyword typescriptBModelAttrs contained id idAttribute cid attributes changed defaults urlRoot |
||||
syntax keyword typescriptBCollectionAttrs contained model modelId models length comparator url |
||||
syntax keyword typescriptBRouterAttrs contained routes |
||||
syntax keyword typescriptBViewAttrs contained el attributes events |
||||
syntax keyword typescriptBViewAttrs match /$el/ |
||||
syntax keyword typescriptBViewAttrs match /$/ |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_backbone_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_backbone_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptBackbone Constant |
||||
HiLink typescriptBObjects Constant |
||||
|
||||
HiLink typescriptBEvents PreProc |
||||
HiLink typescriptBModel PreProc |
||||
HiLink typescriptBCollection PreProc |
||||
HiLink typescriptBRouter PreProc |
||||
HiLink typescriptBHistory PreProc |
||||
HiLink typescriptBSync PreProc |
||||
HiLink typescriptBView PreProc |
||||
HiLink typescriptBUtility PreProc |
||||
|
||||
HiLink typescriptBModelAttrs PreProc |
||||
HiLink typescriptBCollectionAttrs PreProc |
||||
HiLink typescriptBRouterAttrs PreProc |
||||
HiLink typescriptBSyncAttrs PreProc |
||||
HiLink typescriptBViewAttrs PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file |
||||
" Language: chai.js for coffee |
||||
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||
" Last Change: 2014/03/25 |
||||
" Version: 1.9.2 |
||||
" URL: http://chaijs.com/ |
||||
|
||||
" TDD (assert) |
||||
syntax keyword coffeechai assert |
||||
syntax keyword coffee_asserter fail ok notOk |
||||
syntax keyword coffee_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||
syntax keyword coffee_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||
syntax keyword coffee_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||
syntax keyword coffee_asserter include notInclude match notMatch |
||||
syntax keyword coffee_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||
syntax keyword coffee_asserter lengthOf |
||||
syntax keyword coffee_asserter throws throw Throw doesNotThrow |
||||
syntax keyword coffee_asserter operator closeTo |
||||
syntax keyword coffee_asserter sameMembers includeMembers |
||||
|
||||
" BDD (expect/should) |
||||
syntax keyword coffeechai expect should |
||||
syntax keyword coffee_chain to be been is that and has have with at of same |
||||
syntax keyword coffee_asserter not deep a an include contain |
||||
syntax keyword coffee_asserter ok true false null undefined exist empty |
||||
syntax keyword coffee_asserter arguments Arguments equal equals eq eql eqls |
||||
syntax keyword coffee_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||
syntax keyword coffee_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||
syntax keyword coffee_asserter length lengthOf match string keys key |
||||
syntax keyword coffee_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_chai_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_chai_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeechai Constant |
||||
|
||||
HiLink coffee_chain Comment |
||||
HiLink coffee_asserter PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file |
||||
" Language: chai.js for javascript |
||||
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||
" Last Change: 2014/03/25 |
||||
" Version: 1.9.2 |
||||
" URL: http://chaijs.com/ |
||||
|
||||
" TDD (assert) |
||||
syntax keyword javascriptchai assert |
||||
syntax keyword javascript_asserter fail ok notOk |
||||
syntax keyword javascript_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||
syntax keyword javascript_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||
syntax keyword javascript_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||
syntax keyword javascript_asserter include notInclude match notMatch |
||||
syntax keyword javascript_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||
syntax keyword javascript_asserter lengthOf |
||||
syntax keyword javascript_asserter throws throw Throw doesNotThrow |
||||
syntax keyword javascript_asserter operator closeTo |
||||
syntax keyword javascript_asserter sameMembers includeMembers |
||||
|
||||
" BDD (expect/should) |
||||
syntax keyword javascriptchai expect should |
||||
syntax keyword javascript_chain to be been is that and has have with at of same |
||||
syntax keyword javascript_asserter not deep a an include contain |
||||
syntax keyword javascript_asserter ok true false null undefined exist empty |
||||
syntax keyword javascript_asserter arguments Arguments equal equals eq eql eqls |
||||
syntax keyword javascript_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||
syntax keyword javascript_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||
syntax keyword javascript_asserter length lengthOf match string keys key |
||||
syntax keyword javascript_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_chai_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_chai_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptchai Constant |
||||
|
||||
HiLink javascript_chain Comment |
||||
HiLink javascript_asserter PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file |
||||
" Language: chai.js for ls |
||||
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||
" Last Change: 2014/03/25 |
||||
" Version: 1.9.2 |
||||
" URL: http://chaijs.com/ |
||||
|
||||
" TDD (assert) |
||||
syntax keyword lschai assert |
||||
syntax keyword ls_asserter fail ok notOk |
||||
syntax keyword ls_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||
syntax keyword ls_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||
syntax keyword ls_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||
syntax keyword ls_asserter include notInclude match notMatch |
||||
syntax keyword ls_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||
syntax keyword ls_asserter lengthOf |
||||
syntax keyword ls_asserter throws throw Throw doesNotThrow |
||||
syntax keyword ls_asserter operator closeTo |
||||
syntax keyword ls_asserter sameMembers includeMembers |
||||
|
||||
" BDD (expect/should) |
||||
syntax keyword lschai expect should |
||||
syntax keyword ls_chain to be been is that and has have with at of same |
||||
syntax keyword ls_asserter not deep a an include contain |
||||
syntax keyword ls_asserter ok true false null undefined exist empty |
||||
syntax keyword ls_asserter arguments Arguments equal equals eq eql eqls |
||||
syntax keyword ls_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||
syntax keyword ls_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||
syntax keyword ls_asserter length lengthOf match string keys key |
||||
syntax keyword ls_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_chai_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_chai_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lschai Constant |
||||
|
||||
HiLink ls_chain Comment |
||||
HiLink ls_asserter PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file |
||||
" Language: chai.js for typescript |
||||
" Maintainer: tkrugg <y.mammar@gmail.com> |
||||
" Last Change: 2014/03/25 |
||||
" Version: 1.9.2 |
||||
" URL: http://chaijs.com/ |
||||
|
||||
" TDD (assert) |
||||
syntax keyword typescriptchai assert |
||||
syntax keyword typescript_asserter fail ok notOk |
||||
syntax keyword typescript_asserter equal notEqual strictEqual notStrictEqual deepEqual notDeepEqual |
||||
syntax keyword typescript_asserter isTrue isFalse isNull isNotNull isUndefined isDefined isFunction isNotFunction isObject isNotObject isArray isNotArray isString isNotString isNumber isNotNumber isBoolean isNotBoolean |
||||
syntax keyword typescript_asserter typeOf notTypeOf instanceOf notInstanceOf |
||||
syntax keyword typescript_asserter include notInclude match notMatch |
||||
syntax keyword typescript_asserter property notProperty deepProperty notDeepProperty propertyVal propertyNotVal deepPropertyVal deepPropertyNotVal |
||||
syntax keyword typescript_asserter lengthOf |
||||
syntax keyword typescript_asserter throws throw Throw doesNotThrow |
||||
syntax keyword typescript_asserter operator closeTo |
||||
syntax keyword typescript_asserter sameMembers includeMembers |
||||
|
||||
" BDD (expect/should) |
||||
syntax keyword typescriptchai expect should |
||||
syntax keyword typescript_chain to be been is that and has have with at of same |
||||
syntax keyword typescript_asserter not deep a an include contain |
||||
syntax keyword typescript_asserter ok true false null undefined exist empty |
||||
syntax keyword typescript_asserter arguments Arguments equal equals eq eql eqls |
||||
syntax keyword typescript_asserter above gt greaterThan least gte below lt lessThan most lte within |
||||
syntax keyword typescript_asserter instanceof instanceOf property ownProperty haveOwnProperty |
||||
syntax keyword typescript_asserter length lengthOf match string keys key |
||||
syntax keyword typescript_asserter throw throws Throw respondTo itself satisfy closeTo members |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_chai_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_chai_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptchai Constant |
||||
|
||||
HiLink typescript_chain Comment |
||||
HiLink typescript_asserter PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file |
||||
" Language: Flux for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/30 |
||||
" Version: 2.0.2 |
||||
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||
|
||||
syntax keyword coffeeFlux Dispatcher containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||
|
||||
syntax keyword coffeeFDispatcher contained register unregister waitFor dispatch isDispatching |
||||
|
||||
syntax cluster coffeeFFunction contains=coffeeFDispatcher |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeFlux Constant |
||||
|
||||
HiLink coffeeFDispatcher PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file |
||||
" Language: Flux for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/30 |
||||
" Version: 2.0.2 |
||||
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||
|
||||
syntax keyword javascriptFlux Dispatcher containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||
|
||||
syntax keyword javascriptFDispatcher contained register unregister waitFor dispatch isDispatching |
||||
|
||||
syntax cluster javascriptFFunction contains=javascriptFDispatcher |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptFlux Constant |
||||
|
||||
HiLink javascriptFDispatcher PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file |
||||
" Language: Flux for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/30 |
||||
" Version: 2.0.2 |
||||
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||
|
||||
syntax keyword lsFlux Dispatcher containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||
|
||||
syntax keyword lsFDispatcher contained register unregister waitFor dispatch isDispatching |
||||
|
||||
syntax cluster lsFFunction contains=lsFDispatcher |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsFlux Constant |
||||
|
||||
HiLink lsFDispatcher PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file |
||||
" Language: Flux for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/30 |
||||
" Version: 2.0.2 |
||||
" URL: https://facebook.github.io/flux/docs/dispatcher.html |
||||
|
||||
syntax keyword typescriptFlux Dispatcher containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||
|
||||
syntax keyword typescriptFDispatcher contained register unregister waitFor dispatch isDispatching |
||||
|
||||
syntax cluster typescriptFFunction contains=typescriptFDispatcher |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptFlux Constant |
||||
|
||||
HiLink typescriptFDispatcher PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file |
||||
" Language: handlebars for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2015/02/02 |
||||
" Version: 2.0.0 |
||||
" URL: http://handlebarsjs.com/ |
||||
|
||||
syntax keyword coffeeHandlebars Handlebars containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||
" syntax match coffeeunderscoredot contained /\./ nextgroup=@coffee_Functions |
||||
" syntax match coffeeunderscoredot contained /([^)]*)\./ nextgroup=@coffee_Functions |
||||
|
||||
syntax cluster coffeeHFunctions contains=coffeeHmethods,coffeeHutilityMethod |
||||
|
||||
syntax keyword coffeeHmethods contained compile precompile template unregisterPartial registerPartial |
||||
syntax keyword coffeeHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||
syntax keyword coffeeHmethods contained createFrame create log |
||||
|
||||
syntax keyword coffeeHutility contained Utils |
||||
|
||||
syntax keyword coffeeHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_underscore_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_underscore_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeHandlebars Constant |
||||
|
||||
HiLink coffeeHmethods PreProc |
||||
HiLink coffeeHutility PreProc |
||||
HiLink coffeeHutilityMethod PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file |
||||
" Language: handlebars for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2015/02/02 |
||||
" Version: 2.0.0 |
||||
" URL: http://handlebarsjs.com/ |
||||
|
||||
syntax keyword javascriptHandlebars Handlebars containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||
" syntax match javascriptunderscoredot contained /\./ nextgroup=@javascript_Functions |
||||
" syntax match javascriptunderscoredot contained /([^)]*)\./ nextgroup=@javascript_Functions |
||||
|
||||
syntax cluster javascriptHFunctions contains=javascriptHmethods,javascriptHutilityMethod |
||||
|
||||
syntax keyword javascriptHmethods contained compile precompile template unregisterPartial registerPartial |
||||
syntax keyword javascriptHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||
syntax keyword javascriptHmethods contained createFrame create log |
||||
|
||||
syntax keyword javascriptHutility contained Utils |
||||
|
||||
syntax keyword javascriptHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_underscore_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_underscore_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptHandlebars Constant |
||||
|
||||
HiLink javascriptHmethods PreProc |
||||
HiLink javascriptHutility PreProc |
||||
HiLink javascriptHutilityMethod PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file |
||||
" Language: handlebars for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2015/02/02 |
||||
" Version: 2.0.0 |
||||
" URL: http://handlebarsjs.com/ |
||||
|
||||
syntax keyword lsHandlebars Handlebars containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||
" syntax match lsunderscoredot contained /\./ nextgroup=@ls_Functions |
||||
" syntax match lsunderscoredot contained /([^)]*)\./ nextgroup=@ls_Functions |
||||
|
||||
syntax cluster lsHFunctions contains=lsHmethods,lsHutilityMethod |
||||
|
||||
syntax keyword lsHmethods contained compile precompile template unregisterPartial registerPartial |
||||
syntax keyword lsHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||
syntax keyword lsHmethods contained createFrame create log |
||||
|
||||
syntax keyword lsHutility contained Utils |
||||
|
||||
syntax keyword lsHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_underscore_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_underscore_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsHandlebars Constant |
||||
|
||||
HiLink lsHmethods PreProc |
||||
HiLink lsHutility PreProc |
||||
HiLink lsHutilityMethod PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file |
||||
" Language: handlebars for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2015/02/02 |
||||
" Version: 2.0.0 |
||||
" URL: http://handlebarsjs.com/ |
||||
|
||||
syntax keyword typescriptHandlebars Handlebars containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||
" syntax match typescriptunderscoredot contained /\./ nextgroup=@typescript_Functions |
||||
" syntax match typescriptunderscoredot contained /([^)]*)\./ nextgroup=@typescript_Functions |
||||
|
||||
syntax cluster typescriptHFunctions contains=typescriptHmethods,typescriptHutilityMethod |
||||
|
||||
syntax keyword typescriptHmethods contained compile precompile template unregisterPartial registerPartial |
||||
syntax keyword typescriptHmethods contained registerHelper unregisterHelper SafeString escapeExpression |
||||
syntax keyword typescriptHmethods contained createFrame create log |
||||
|
||||
syntax keyword typescriptHutility contained Utils |
||||
|
||||
syntax keyword typescriptHutilityMethod contained isEmpty extend toString isArray isFunction appendContextPath |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_underscore_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_underscore_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptHandlebars Constant |
||||
|
||||
HiLink typescriptHmethods PreProc |
||||
HiLink typescriptHutility PreProc |
||||
HiLink typescriptHutilityMethod PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
" Vim syntax file |
||||
" Language: jasmine for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/01/31 |
||||
" Version: 2.0 |
||||
" URL: http://jasmine.github.io/ |
||||
|
||||
|
||||
syntax keyword coffeeJasmine jasmine containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeJdot |
||||
syntax match coffeeJdot contained /\./ nextgroup=coffeeJMethods |
||||
syntax keyword coffeeJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||
|
||||
syntax keyword coffeeJMethods contained tick useMock |
||||
syntax keyword coffeeJMethods contained addReporter specFilter |
||||
|
||||
syntax cluster coffeeJFunctions contains=coffeeJMethods,coffeeJEnvMethods,coffeeJEnvMethods,coffeeJExpectMethods,coffeeJSpyMethods,coffeeJSpyAndMethods,coffeeJSpyCallsMethods |
||||
syntax cluster coffeeJAttrs contains=coffeeJExpectNot,coffeeJSpyAnd,coffeeJSpyCalls |
||||
|
||||
syntax keyword coffeeJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||
|
||||
syntax keyword coffeeJGlobalMethod xdescribe xit containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||
|
||||
syntax keyword coffeeJGlobalMethod spyOn containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||
|
||||
syntax keyword coffeeJSpyAnd and contained |
||||
syntax keyword coffeeJSpyAndMethods returnValue callFake throwError stub contained |
||||
syntax keyword coffeeJSpyCalls calls contained |
||||
syntax keyword coffeeJSpyMethods andReturn andCallThrough callThrough contained |
||||
syntax keyword coffeeJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||
|
||||
syntax keyword coffeeJGlobalMethod expect containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString |
||||
syntax keyword coffeeJExpectNot not contained nextgroup=coffeeJExpectNotdot |
||||
|
||||
syntax keyword coffeeJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||
syntax keyword coffeeJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||
syntax keyword coffeeJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeJasmine Constant |
||||
HiLink coffeeJMethods PreProc |
||||
HiLink coffeeJEnvMethods PreProc |
||||
HiLink coffeeJClockMethods PreProc |
||||
HiLink coffeeJGlobalMethod PreProc |
||||
HiLink coffeeJSpyAnd PreProc |
||||
HiLink coffeeJSpyAndMethods PreProc |
||||
HiLink coffeeJSpyCalls PreProc |
||||
HiLink coffeeJSpyMethods PreProc |
||||
HiLink coffeeJCallsMethods PreProc |
||||
HiLink coffeeJExpectNot PreProc |
||||
HiLink coffeeJExpectMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
" Vim syntax file |
||||
" Language: jasmine for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/01/31 |
||||
" Version: 2.0 |
||||
" URL: http://jasmine.github.io/ |
||||
|
||||
|
||||
syntax keyword javascriptJasmine jasmine containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptJdot |
||||
syntax match javascriptJdot contained /\./ nextgroup=javascriptJMethods |
||||
syntax keyword javascriptJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||
|
||||
syntax keyword javascriptJMethods contained tick useMock |
||||
syntax keyword javascriptJMethods contained addReporter specFilter |
||||
|
||||
syntax cluster javascriptJFunctions contains=javascriptJMethods,javascriptJEnvMethods,javascriptJEnvMethods,javascriptJExpectMethods,javascriptJSpyMethods,javascriptJSpyAndMethods,javascriptJSpyCallsMethods |
||||
syntax cluster javascriptJAttrs contains=javascriptJExpectNot,javascriptJSpyAnd,javascriptJSpyCalls |
||||
|
||||
syntax keyword javascriptJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||
|
||||
syntax keyword javascriptJGlobalMethod xdescribe xit containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||
|
||||
syntax keyword javascriptJGlobalMethod spyOn containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||
|
||||
syntax keyword javascriptJSpyAnd and contained |
||||
syntax keyword javascriptJSpyAndMethods returnValue callFake throwError stub contained |
||||
syntax keyword javascriptJSpyCalls calls contained |
||||
syntax keyword javascriptJSpyMethods andReturn andCallThrough callThrough contained |
||||
syntax keyword javascriptJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||
|
||||
syntax keyword javascriptJGlobalMethod expect containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString |
||||
syntax keyword javascriptJExpectNot not contained nextgroup=javascriptJExpectNotdot |
||||
|
||||
syntax keyword javascriptJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||
syntax keyword javascriptJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||
syntax keyword javascriptJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptJasmine Constant |
||||
HiLink javascriptJMethods PreProc |
||||
HiLink javascriptJEnvMethods PreProc |
||||
HiLink javascriptJClockMethods PreProc |
||||
HiLink javascriptJGlobalMethod PreProc |
||||
HiLink javascriptJSpyAnd PreProc |
||||
HiLink javascriptJSpyAndMethods PreProc |
||||
HiLink javascriptJSpyCalls PreProc |
||||
HiLink javascriptJSpyMethods PreProc |
||||
HiLink javascriptJCallsMethods PreProc |
||||
HiLink javascriptJExpectNot PreProc |
||||
HiLink javascriptJExpectMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
" Vim syntax file |
||||
" Language: jasmine for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/01/31 |
||||
" Version: 2.0 |
||||
" URL: http://jasmine.github.io/ |
||||
|
||||
|
||||
syntax keyword lsJasmine jasmine containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsJdot |
||||
syntax match lsJdot contained /\./ nextgroup=lsJMethods |
||||
syntax keyword lsJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||
|
||||
syntax keyword lsJMethods contained tick useMock |
||||
syntax keyword lsJMethods contained addReporter specFilter |
||||
|
||||
syntax cluster lsJFunctions contains=lsJMethods,lsJEnvMethods,lsJEnvMethods,lsJExpectMethods,lsJSpyMethods,lsJSpyAndMethods,lsJSpyCallsMethods |
||||
syntax cluster lsJAttrs contains=lsJExpectNot,lsJSpyAnd,lsJSpyCalls |
||||
|
||||
syntax keyword lsJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||
|
||||
syntax keyword lsJGlobalMethod xdescribe xit containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||
|
||||
syntax keyword lsJGlobalMethod spyOn containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||
|
||||
syntax keyword lsJSpyAnd and contained |
||||
syntax keyword lsJSpyAndMethods returnValue callFake throwError stub contained |
||||
syntax keyword lsJSpyCalls calls contained |
||||
syntax keyword lsJSpyMethods andReturn andCallThrough callThrough contained |
||||
syntax keyword lsJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||
|
||||
syntax keyword lsJGlobalMethod expect containedin=ALLBUT,lsComment,lsLineComment,lsString |
||||
syntax keyword lsJExpectNot not contained nextgroup=lsJExpectNotdot |
||||
|
||||
syntax keyword lsJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||
syntax keyword lsJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||
syntax keyword lsJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsJasmine Constant |
||||
HiLink lsJMethods PreProc |
||||
HiLink lsJEnvMethods PreProc |
||||
HiLink lsJClockMethods PreProc |
||||
HiLink lsJGlobalMethod PreProc |
||||
HiLink lsJSpyAnd PreProc |
||||
HiLink lsJSpyAndMethods PreProc |
||||
HiLink lsJSpyCalls PreProc |
||||
HiLink lsJSpyMethods PreProc |
||||
HiLink lsJCallsMethods PreProc |
||||
HiLink lsJExpectNot PreProc |
||||
HiLink lsJExpectMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
" Vim syntax file |
||||
" Language: jasmine for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/01/31 |
||||
" Version: 2.0 |
||||
" URL: http://jasmine.github.io/ |
||||
|
||||
|
||||
syntax keyword typescriptJasmine jasmine containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptJdot |
||||
syntax match typescriptJdot contained /\./ nextgroup=typescriptJMethods |
||||
syntax keyword typescriptJMethods contained any createSpy createSpyObj HtmlReporter Clock getEnv |
||||
|
||||
syntax keyword typescriptJMethods contained tick useMock |
||||
syntax keyword typescriptJMethods contained addReporter specFilter |
||||
|
||||
syntax cluster typescriptJFunctions contains=typescriptJMethods,typescriptJEnvMethods,typescriptJEnvMethods,typescriptJExpectMethods,typescriptJSpyMethods,typescriptJSpyAndMethods,typescriptJSpyCallsMethods |
||||
syntax cluster typescriptJAttrs contains=typescriptJExpectNot,typescriptJSpyAnd,typescriptJSpyCalls |
||||
|
||||
syntax keyword typescriptJGlobalMethod describe done runs waitsFor it beforeEach afterEach containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||
|
||||
syntax keyword typescriptJGlobalMethod xdescribe xit containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||
|
||||
syntax keyword typescriptJGlobalMethod spyOn containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||
|
||||
syntax keyword typescriptJSpyAnd and contained |
||||
syntax keyword typescriptJSpyAndMethods returnValue callFake throwError stub contained |
||||
syntax keyword typescriptJSpyCalls calls contained |
||||
syntax keyword typescriptJSpyMethods andReturn andCallThrough callThrough contained |
||||
syntax keyword typescriptJCallsMethods any count argsFor allArgs all mostRecent first reset contained |
||||
|
||||
syntax keyword typescriptJGlobalMethod expect containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString |
||||
syntax keyword typescriptJExpectNot not contained nextgroup=typescriptJExpectNotdot |
||||
|
||||
syntax keyword typescriptJExpectMethods toHaveBeenCalled toHaveBeenCalledWith toEqual toBe toMatch contained |
||||
syntax keyword typescriptJExpectMethods toBeDefined toBeUndefined toBeNull toBeTruthy toBeFalsy contained |
||||
syntax keyword typescriptJExpectMethods toContain toBeCloseTo toBeLessThan toBeGreaterThan toThrow contained |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptJasmine Constant |
||||
HiLink typescriptJMethods PreProc |
||||
HiLink typescriptJEnvMethods PreProc |
||||
HiLink typescriptJClockMethods PreProc |
||||
HiLink typescriptJGlobalMethod PreProc |
||||
HiLink typescriptJSpyAnd PreProc |
||||
HiLink typescriptJSpyAndMethods PreProc |
||||
HiLink typescriptJSpyCalls PreProc |
||||
HiLink typescriptJSpyMethods PreProc |
||||
HiLink typescriptJCallsMethods PreProc |
||||
HiLink typescriptJExpectNot PreProc |
||||
HiLink typescriptJExpectMethods PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
" Vim syntax file |
||||
" Language: jQuery for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 1.9.0.2 |
||||
" URL: http://api.jquery.com/ |
||||
|
||||
setlocal iskeyword-=$ |
||||
if exists("b:current_syntax") && b:current_syntax == 'coffee' |
||||
setlocal iskeyword+=$ |
||||
endif |
||||
|
||||
syntax keyword coffeejQuery jQuery $ containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||
" syntax match coffeejQuerydot contained /\./ nextgroup=@coffeeQGlobals |
||||
" syntax match coffeejQuerydot contained /([^)]*)\./ nextgroup=@coffeeQFunctions |
||||
|
||||
" jQuery.* |
||||
syntax cluster coffeeQGlobals contains=coffeeQCore,coffeeQCoreObj,coffeeQCoreData,coffeeQUtilities,coffeeQProperties |
||||
syntax keyword coffeeQCore contained holdReady noConflict when |
||||
syntax keyword coffeeQCoreObj contained Callback Deferred |
||||
syntax keyword coffeeQCoreData contained data dequeue hasData queue removeData |
||||
syntax keyword coffeeQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||
syntax keyword coffeeQProperties contained context fx.interval fx.off length support cssHooks |
||||
syntax keyword coffeeQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||
syntax match coffeeQUtilities contained /contains/ |
||||
|
||||
" jqobj.* |
||||
syntax cluster coffeeQFunctions contains=@coffeeQGlobals,coffeeQAjax,coffeeQAttributes,coffeeQCallbacks,coffeeQCore,coffeeQCSS,coffeeQData,coffeeQDeferred,coffeeQDimensions,coffeeQEffects,coffeeQEvents,coffeeQManipulation,coffeeQMiscellaneous,coffeeQOffset,coffeeQTraversing,coffeeQUtilities |
||||
syntax keyword coffeeQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||
syntax keyword coffeeQAjax contained serialize serializeArray ajaxTransport load |
||||
syntax keyword coffeeQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||
syntax keyword coffeeQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||
syntax keyword coffeeQCSS contained css |
||||
syntax keyword coffeeQData contained clearQueue data dequeue queue removeData |
||||
syntax keyword coffeeQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||
syntax keyword coffeeQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||
syntax keyword coffeeQEffects contained hide show toggle |
||||
syntax keyword coffeeQEffects contained animate delay stop finish |
||||
syntax keyword coffeeQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||
syntax keyword coffeeQEffects contained slideDown slideToggle slideUp |
||||
syntax keyword coffeeQEvents contained error resize scroll |
||||
syntax keyword coffeeQEvents contained ready unload |
||||
syntax keyword coffeeQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||
syntax keyword coffeeQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||
syntax keyword coffeeQEvents contained blur change focus select submit |
||||
syntax keyword coffeeQEvents contained focusin focusout keydown keypress keyup |
||||
syntax keyword coffeeQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||
syntax keyword coffeeQManipulation contained clone |
||||
syntax keyword coffeeQManipulation contained unwrap wrap wrapAll wrapInner |
||||
syntax keyword coffeeQManipulation contained append appendTo html prepend prependTo text |
||||
syntax keyword coffeeQManipulation contained after before insertAfter insertBefore |
||||
syntax keyword coffeeQManipulation contained detach empty remove |
||||
syntax keyword coffeeQManipulation contained replaceAll replaceWith |
||||
syntax keyword coffeeQMiscellaneous contained index toArray |
||||
syntax keyword coffeeQOffset contained offset offsetParent position scrollTop scrollLeft |
||||
syntax keyword coffeeQTraversing contained eq filter first has is last map not slice |
||||
syntax keyword coffeeQTraversing contained add andBack contents end |
||||
syntax keyword coffeeQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||
|
||||
|
||||
" selector |
||||
" syntax match coffeeASCII contained /\\\d\d\d/ |
||||
" syntax region coffeeString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=coffeeASCII,@jSelectors |
||||
" syntax region coffeeString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=coffeeASCII,@jSelectors |
||||
|
||||
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||
syntax cluster coffeeNoReserved add=@cssSelectors |
||||
syntax match cssId contained containedin=coffeeString /#[0-9A-Za-z_\-]\+/ |
||||
syntax match cssClass contained containedin=coffeeString /\.[0-9A-Za-z_\-]\+/ |
||||
syntax match cssOperators contained containedin=coffeeString /*\|>\|+\|-\|\~/ |
||||
syntax match cssBasicFilters contained containedin=coffeeString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||
syntax match cssChildFilters contained containedin=coffeeString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||
syntax match cssChildFilters contained containedin=coffeeString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||
syntax match cssContentFilters contained containedin=coffeeString /:\(contains\|empty\|has\|parent\)/ |
||||
syntax match cssForms contained containedin=coffeeString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||
syntax match cssVisibility contained containedin=coffeeString /:\(hidden\|visible\)/ |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeejQuery Constant |
||||
|
||||
HiLink coffeeQCore PreProc |
||||
HiLink coffeeQCoreObj PreProc |
||||
HiLink coffeeQCoreData PreProc |
||||
|
||||
HiLink coffeeQAjax PreProc |
||||
HiLink coffeeQAttributes PreProc |
||||
HiLink coffeeQCallbacks PreProc |
||||
HiLink coffeeQCSS PreProc |
||||
HiLink coffeeQData PreProc |
||||
HiLink coffeeQDeferred PreProc |
||||
HiLink coffeeQDimensions PreProc |
||||
HiLink coffeeQEffects PreProc |
||||
HiLink coffeeQEvents PreProc |
||||
HiLink coffeeQManipulation PreProc |
||||
HiLink coffeeQMiscellaneous PreProc |
||||
HiLink coffeeQOffset PreProc |
||||
HiLink coffeeQProperties PreProc |
||||
HiLink coffeeQTraversing PreProc |
||||
HiLink coffeeQUtilities PreProc |
||||
|
||||
HiLink cssId Identifier |
||||
HiLink cssClass Constant |
||||
HiLink cssOperators Special |
||||
HiLink cssBasicFilters Statement |
||||
HiLink cssContentFilters Statement |
||||
HiLink cssVisibility Statement |
||||
HiLink cssChildFilters Statement |
||||
HiLink cssForms Statement |
||||
HiLink cssFormFilters Statement |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
" Vim syntax file |
||||
" Language: jQuery for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 1.9.0.2 |
||||
" URL: http://api.jquery.com/ |
||||
|
||||
setlocal iskeyword-=$ |
||||
if exists("b:current_syntax") && b:current_syntax == 'javascript' |
||||
setlocal iskeyword+=$ |
||||
endif |
||||
|
||||
syntax keyword javascriptjQuery jQuery $ containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||
" syntax match javascriptjQuerydot contained /\./ nextgroup=@javascriptQGlobals |
||||
" syntax match javascriptjQuerydot contained /([^)]*)\./ nextgroup=@javascriptQFunctions |
||||
|
||||
" jQuery.* |
||||
syntax cluster javascriptQGlobals contains=javascriptQCore,javascriptQCoreObj,javascriptQCoreData,javascriptQUtilities,javascriptQProperties |
||||
syntax keyword javascriptQCore contained holdReady noConflict when |
||||
syntax keyword javascriptQCoreObj contained Callback Deferred |
||||
syntax keyword javascriptQCoreData contained data dequeue hasData queue removeData |
||||
syntax keyword javascriptQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||
syntax keyword javascriptQProperties contained context fx.interval fx.off length support cssHooks |
||||
syntax keyword javascriptQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||
syntax match javascriptQUtilities contained /contains/ |
||||
|
||||
" jqobj.* |
||||
syntax cluster javascriptQFunctions contains=@javascriptQGlobals,javascriptQAjax,javascriptQAttributes,javascriptQCallbacks,javascriptQCore,javascriptQCSS,javascriptQData,javascriptQDeferred,javascriptQDimensions,javascriptQEffects,javascriptQEvents,javascriptQManipulation,javascriptQMiscellaneous,javascriptQOffset,javascriptQTraversing,javascriptQUtilities |
||||
syntax keyword javascriptQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||
syntax keyword javascriptQAjax contained serialize serializeArray ajaxTransport load |
||||
syntax keyword javascriptQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||
syntax keyword javascriptQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||
syntax keyword javascriptQCSS contained css |
||||
syntax keyword javascriptQData contained clearQueue data dequeue queue removeData |
||||
syntax keyword javascriptQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||
syntax keyword javascriptQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||
syntax keyword javascriptQEffects contained hide show toggle |
||||
syntax keyword javascriptQEffects contained animate delay stop finish |
||||
syntax keyword javascriptQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||
syntax keyword javascriptQEffects contained slideDown slideToggle slideUp |
||||
syntax keyword javascriptQEvents contained error resize scroll |
||||
syntax keyword javascriptQEvents contained ready unload |
||||
syntax keyword javascriptQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||
syntax keyword javascriptQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||
syntax keyword javascriptQEvents contained blur change focus select submit |
||||
syntax keyword javascriptQEvents contained focusin focusout keydown keypress keyup |
||||
syntax keyword javascriptQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||
syntax keyword javascriptQManipulation contained clone |
||||
syntax keyword javascriptQManipulation contained unwrap wrap wrapAll wrapInner |
||||
syntax keyword javascriptQManipulation contained append appendTo html prepend prependTo text |
||||
syntax keyword javascriptQManipulation contained after before insertAfter insertBefore |
||||
syntax keyword javascriptQManipulation contained detach empty remove |
||||
syntax keyword javascriptQManipulation contained replaceAll replaceWith |
||||
syntax keyword javascriptQMiscellaneous contained index toArray |
||||
syntax keyword javascriptQOffset contained offset offsetParent position scrollTop scrollLeft |
||||
syntax keyword javascriptQTraversing contained eq filter first has is last map not slice |
||||
syntax keyword javascriptQTraversing contained add andBack contents end |
||||
syntax keyword javascriptQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||
|
||||
|
||||
" selector |
||||
" syntax match javascriptASCII contained /\\\d\d\d/ |
||||
" syntax region javascriptString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=javascriptASCII,@jSelectors |
||||
" syntax region javascriptString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=javascriptASCII,@jSelectors |
||||
|
||||
" syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||
" syntax cluster javascriptNoReserved add=@cssSelectors |
||||
" syntax match cssId contained containedin=javascriptString /#[0-9A-Za-z_\-]\+/ |
||||
" syntax match cssClass contained containedin=javascriptString /\.[0-9A-Za-z_\-]\+/ |
||||
" syntax match cssOperators contained containedin=javascriptString /*\|>\|+\|-\|\~/ |
||||
" syntax match cssBasicFilters contained containedin=javascriptString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||
" syntax match cssChildFilters contained containedin=javascriptString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||
" syntax match cssChildFilters contained containedin=javascriptString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||
" syntax match cssContentFilters contained containedin=javascriptString /:\(contains\|empty\|has\|parent\)/ |
||||
" syntax match cssForms contained containedin=javascriptString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||
" syntax match cssVisibility contained containedin=javascriptString /:\(hidden\|visible\)/ |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptjQuery Constant |
||||
|
||||
HiLink javascriptQCore PreProc |
||||
HiLink javascriptQCoreObj PreProc |
||||
HiLink javascriptQCoreData PreProc |
||||
|
||||
HiLink javascriptQAjax PreProc |
||||
HiLink javascriptQAttributes PreProc |
||||
HiLink javascriptQCallbacks PreProc |
||||
HiLink javascriptQCSS PreProc |
||||
HiLink javascriptQData PreProc |
||||
HiLink javascriptQDeferred PreProc |
||||
HiLink javascriptQDimensions PreProc |
||||
HiLink javascriptQEffects PreProc |
||||
HiLink javascriptQEvents PreProc |
||||
HiLink javascriptQManipulation PreProc |
||||
HiLink javascriptQMiscellaneous PreProc |
||||
HiLink javascriptQOffset PreProc |
||||
HiLink javascriptQProperties PreProc |
||||
HiLink javascriptQTraversing PreProc |
||||
HiLink javascriptQUtilities PreProc |
||||
|
||||
" HiLink cssId Identifier |
||||
" HiLink cssClass Constant |
||||
" HiLink cssOperators Special |
||||
" HiLink cssBasicFilters Statement |
||||
" HiLink cssContentFilters Statement |
||||
" HiLink cssVisibility Statement |
||||
" HiLink cssChildFilters Statement |
||||
" HiLink cssForms Statement |
||||
" HiLink cssFormFilters Statement |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
" Vim syntax file |
||||
" Language: jQuery for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 1.9.0.2 |
||||
" URL: http://api.jquery.com/ |
||||
|
||||
setlocal iskeyword-=$ |
||||
if exists("b:current_syntax") && b:current_syntax == 'ls' |
||||
setlocal iskeyword+=$ |
||||
endif |
||||
|
||||
syntax keyword lsjQuery jQuery $ containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||
" syntax match lsjQuerydot contained /\./ nextgroup=@lsQGlobals |
||||
" syntax match lsjQuerydot contained /([^)]*)\./ nextgroup=@lsQFunctions |
||||
|
||||
" jQuery.* |
||||
syntax cluster lsQGlobals contains=lsQCore,lsQCoreObj,lsQCoreData,lsQUtilities,lsQProperties |
||||
syntax keyword lsQCore contained holdReady noConflict when |
||||
syntax keyword lsQCoreObj contained Callback Deferred |
||||
syntax keyword lsQCoreData contained data dequeue hasData queue removeData |
||||
syntax keyword lsQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||
syntax keyword lsQProperties contained context fx.interval fx.off length support cssHooks |
||||
syntax keyword lsQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||
syntax match lsQUtilities contained /contains/ |
||||
|
||||
" jqobj.* |
||||
syntax cluster lsQFunctions contains=@lsQGlobals,lsQAjax,lsQAttributes,lsQCallbacks,lsQCore,lsQCSS,lsQData,lsQDeferred,lsQDimensions,lsQEffects,lsQEvents,lsQManipulation,lsQMiscellaneous,lsQOffset,lsQTraversing,lsQUtilities |
||||
syntax keyword lsQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||
syntax keyword lsQAjax contained serialize serializeArray ajaxTransport load |
||||
syntax keyword lsQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||
syntax keyword lsQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||
syntax keyword lsQCSS contained css |
||||
syntax keyword lsQData contained clearQueue data dequeue queue removeData |
||||
syntax keyword lsQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||
syntax keyword lsQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||
syntax keyword lsQEffects contained hide show toggle |
||||
syntax keyword lsQEffects contained animate delay stop finish |
||||
syntax keyword lsQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||
syntax keyword lsQEffects contained slideDown slideToggle slideUp |
||||
syntax keyword lsQEvents contained error resize scroll |
||||
syntax keyword lsQEvents contained ready unload |
||||
syntax keyword lsQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||
syntax keyword lsQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||
syntax keyword lsQEvents contained blur change focus select submit |
||||
syntax keyword lsQEvents contained focusin focusout keydown keypress keyup |
||||
syntax keyword lsQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||
syntax keyword lsQManipulation contained clone |
||||
syntax keyword lsQManipulation contained unwrap wrap wrapAll wrapInner |
||||
syntax keyword lsQManipulation contained append appendTo html prepend prependTo text |
||||
syntax keyword lsQManipulation contained after before insertAfter insertBefore |
||||
syntax keyword lsQManipulation contained detach empty remove |
||||
syntax keyword lsQManipulation contained replaceAll replaceWith |
||||
syntax keyword lsQMiscellaneous contained index toArray |
||||
syntax keyword lsQOffset contained offset offsetParent position scrollTop scrollLeft |
||||
syntax keyword lsQTraversing contained eq filter first has is last map not slice |
||||
syntax keyword lsQTraversing contained add andBack contents end |
||||
syntax keyword lsQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||
|
||||
|
||||
" selector |
||||
" syntax match lsASCII contained /\\\d\d\d/ |
||||
" syntax region lsString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=lsASCII,@jSelectors |
||||
" syntax region lsString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=lsASCII,@jSelectors |
||||
|
||||
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||
syntax cluster lsNoReserved add=@cssSelectors |
||||
syntax match cssId contained containedin=lsString /#[0-9A-Za-z_\-]\+/ |
||||
syntax match cssClass contained containedin=lsString /\.[0-9A-Za-z_\-]\+/ |
||||
syntax match cssOperators contained containedin=lsString /*\|>\|+\|-\|\~/ |
||||
syntax match cssBasicFilters contained containedin=lsString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||
syntax match cssChildFilters contained containedin=lsString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||
syntax match cssChildFilters contained containedin=lsString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||
syntax match cssContentFilters contained containedin=lsString /:\(contains\|empty\|has\|parent\)/ |
||||
syntax match cssForms contained containedin=lsString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||
syntax match cssVisibility contained containedin=lsString /:\(hidden\|visible\)/ |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsjQuery Constant |
||||
|
||||
HiLink lsQCore PreProc |
||||
HiLink lsQCoreObj PreProc |
||||
HiLink lsQCoreData PreProc |
||||
|
||||
HiLink lsQAjax PreProc |
||||
HiLink lsQAttributes PreProc |
||||
HiLink lsQCallbacks PreProc |
||||
HiLink lsQCSS PreProc |
||||
HiLink lsQData PreProc |
||||
HiLink lsQDeferred PreProc |
||||
HiLink lsQDimensions PreProc |
||||
HiLink lsQEffects PreProc |
||||
HiLink lsQEvents PreProc |
||||
HiLink lsQManipulation PreProc |
||||
HiLink lsQMiscellaneous PreProc |
||||
HiLink lsQOffset PreProc |
||||
HiLink lsQProperties PreProc |
||||
HiLink lsQTraversing PreProc |
||||
HiLink lsQUtilities PreProc |
||||
|
||||
HiLink cssId Identifier |
||||
HiLink cssClass Constant |
||||
HiLink cssOperators Special |
||||
HiLink cssBasicFilters Statement |
||||
HiLink cssContentFilters Statement |
||||
HiLink cssVisibility Statement |
||||
HiLink cssChildFilters Statement |
||||
HiLink cssForms Statement |
||||
HiLink cssFormFilters Statement |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
" Vim syntax file |
||||
" Language: jQuery for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Maintainer: Bruno Michel <brmichel@free.fr> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 1.9.0.2 |
||||
" URL: http://api.jquery.com/ |
||||
|
||||
setlocal iskeyword-=$ |
||||
if exists("b:current_syntax") && b:current_syntax == 'typescript' |
||||
setlocal iskeyword+=$ |
||||
endif |
||||
|
||||
syntax keyword typescriptjQuery jQuery $ containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||
" syntax match typescriptjQuerydot contained /\./ nextgroup=@typescriptQGlobals |
||||
" syntax match typescriptjQuerydot contained /([^)]*)\./ nextgroup=@typescriptQFunctions |
||||
|
||||
" jQuery.* |
||||
syntax cluster typescriptQGlobals contains=typescriptQCore,typescriptQCoreObj,typescriptQCoreData,typescriptQUtilities,typescriptQProperties |
||||
syntax keyword typescriptQCore contained holdReady noConflict when |
||||
syntax keyword typescriptQCoreObj contained Callback Deferred |
||||
syntax keyword typescriptQCoreData contained data dequeue hasData queue removeData |
||||
syntax keyword typescriptQCoreAjax contained ajax ajaxPrefilter ajaxSetup ajaxTransport param get getJSON getScript post |
||||
syntax keyword typescriptQProperties contained context fx.interval fx.off length support cssHooks |
||||
syntax keyword typescriptQUtilities contained each extend globalEval grep inArray isArray isEmptyObject isFunction isPlainObject isWindow isXMLDoc makeArray map merge noop now parseHTML parseJSON parseXML proxy trim type unique |
||||
syntax match typescriptQUtilities contained /contains/ |
||||
|
||||
" jqobj.* |
||||
syntax cluster typescriptQFunctions contains=@typescriptQGlobals,typescriptQAjax,typescriptQAttributes,typescriptQCallbacks,typescriptQCore,typescriptQCSS,typescriptQData,typescriptQDeferred,typescriptQDimensions,typescriptQEffects,typescriptQEvents,typescriptQManipulation,typescriptQMiscellaneous,typescriptQOffset,typescriptQTraversing,typescriptQUtilities |
||||
syntax keyword typescriptQAjax contained ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess |
||||
syntax keyword typescriptQAjax contained serialize serializeArray ajaxTransport load |
||||
syntax keyword typescriptQAttributes contained addClass attr hasClass html prop removeAttr removeClass removeProp toggleClass val |
||||
syntax keyword typescriptQCallbacks contained add disable disabled empty fire fired fireWith has lock locked remove Callbacks |
||||
syntax keyword typescriptQCSS contained css |
||||
syntax keyword typescriptQData contained clearQueue data dequeue queue removeData |
||||
syntax keyword typescriptQDeferred contained Deferred always done fail notify progress promise reject rejectWith resolved resolveWith notifyWith state then |
||||
syntax keyword typescriptQDimensions contained height innerHeight innerWidth outerHeight outerWidth width |
||||
syntax keyword typescriptQEffects contained hide show toggle |
||||
syntax keyword typescriptQEffects contained animate delay stop finish |
||||
syntax keyword typescriptQEffects contained fadeIn fadeOut fadeTo fadeToggle |
||||
syntax keyword typescriptQEffects contained slideDown slideToggle slideUp |
||||
syntax keyword typescriptQEvents contained error resize scroll |
||||
syntax keyword typescriptQEvents contained ready unload |
||||
syntax keyword typescriptQEvents contained bind delegate on off one proxy trigger triggerHandler unbind undelegate |
||||
syntax keyword typescriptQEvents contained Event currentTarget isDefaultPrevented isImmediatePropagationStopped isPropagationStopped namespace pageX pageY preventDefault relatedTarget result stopImmediatePropagation stopPropagation target timeStamp which |
||||
syntax keyword typescriptQEvents contained blur change focus select submit |
||||
syntax keyword typescriptQEvents contained focusin focusout keydown keypress keyup |
||||
syntax keyword typescriptQEvents contained click dblclick hover mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup |
||||
syntax keyword typescriptQManipulation contained clone |
||||
syntax keyword typescriptQManipulation contained unwrap wrap wrapAll wrapInner |
||||
syntax keyword typescriptQManipulation contained append appendTo html prepend prependTo text |
||||
syntax keyword typescriptQManipulation contained after before insertAfter insertBefore |
||||
syntax keyword typescriptQManipulation contained detach empty remove |
||||
syntax keyword typescriptQManipulation contained replaceAll replaceWith |
||||
syntax keyword typescriptQMiscellaneous contained index toArray |
||||
syntax keyword typescriptQOffset contained offset offsetParent position scrollTop scrollLeft |
||||
syntax keyword typescriptQTraversing contained eq filter first has is last map not slice |
||||
syntax keyword typescriptQTraversing contained add andBack contents end |
||||
syntax keyword typescriptQTraversing contained children closest find next nextAll nextUntil parent parents parentsUntil prev prevAll prevUntil siblings |
||||
|
||||
|
||||
" selector |
||||
" syntax match typescriptASCII contained /\\\d\d\d/ |
||||
" syntax region typescriptString start=/"/ skip=/\\\\\|\\"\|\\\n/ end=/"\|$/ contains=typescriptASCII,@jSelectors |
||||
" syntax region typescriptString start=/'/ skip=/\\\\\|\\'\|\\\n/ end=/'\|$/ contains=typescriptASCII,@jSelectors |
||||
|
||||
syntax cluster cssSelectors contains=cssId,cssClass,cssOperators,cssBasicFilters,cssContentFilters,cssVisibility,cssChildFilters,cssForms,cssFormFilters |
||||
syntax cluster typescriptNoReserved add=@cssSelectors |
||||
syntax match cssId contained containedin=typescriptString /#[0-9A-Za-z_\-]\+/ |
||||
syntax match cssClass contained containedin=typescriptString /\.[0-9A-Za-z_\-]\+/ |
||||
syntax match cssOperators contained containedin=typescriptString /*\|>\|+\|-\|\~/ |
||||
syntax match cssBasicFilters contained containedin=typescriptString /:\(animated\|eq\|even\|first\|focus\|gt\|header\|last\|lang\|lt\|not\|odd\|root\|target\)/ |
||||
syntax match cssChildFilters contained containedin=typescriptString /:\(first\|last\|nth\|only\|nth-last\)-child/ |
||||
syntax match cssChildFilters contained containedin=typescriptString /:\(first\|last\|nth\|only\|nth-last\)-of-type/ |
||||
syntax match cssContentFilters contained containedin=typescriptString /:\(contains\|empty\|has\|parent\)/ |
||||
syntax match cssForms contained containedin=typescriptString /:\(button\|checkbox\|checked\|disabled\|enabled\|file\|image\|input\|password\|radio\|reset\|selected\|submit\|text\)/ |
||||
syntax match cssVisibility contained containedin=typescriptString /:\(hidden\|visible\)/ |
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptjQuery Constant |
||||
|
||||
HiLink typescriptQCore PreProc |
||||
HiLink typescriptQCoreObj PreProc |
||||
HiLink typescriptQCoreData PreProc |
||||
|
||||
HiLink typescriptQAjax PreProc |
||||
HiLink typescriptQAttributes PreProc |
||||
HiLink typescriptQCallbacks PreProc |
||||
HiLink typescriptQCSS PreProc |
||||
HiLink typescriptQData PreProc |
||||
HiLink typescriptQDeferred PreProc |
||||
HiLink typescriptQDimensions PreProc |
||||
HiLink typescriptQEffects PreProc |
||||
HiLink typescriptQEvents PreProc |
||||
HiLink typescriptQManipulation PreProc |
||||
HiLink typescriptQMiscellaneous PreProc |
||||
HiLink typescriptQOffset PreProc |
||||
HiLink typescriptQProperties PreProc |
||||
HiLink typescriptQTraversing PreProc |
||||
HiLink typescriptQUtilities PreProc |
||||
|
||||
HiLink cssId Identifier |
||||
HiLink cssClass Constant |
||||
HiLink cssOperators Special |
||||
HiLink cssBasicFilters Statement |
||||
HiLink cssContentFilters Statement |
||||
HiLink cssVisibility Statement |
||||
HiLink cssChildFilters Statement |
||||
HiLink cssForms Statement |
||||
HiLink cssFormFilters Statement |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
" Vim syntax file |
||||
" Language: JS Lib syntax post process for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/07/01 |
||||
" Version: 0.5 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
" |
||||
|
||||
" work with https://github.com/kchmck/vim-coffee-script |
||||
syntax cluster props add=@coffeeQFunctions,@coffee_Functions,@coffeeBFunctions |
||||
syntax cluster props add=@coffeepFunctions,@coffeeAFunctions,@coffeeSFunctions,@coffeeJFunctions |
||||
syntax cluster props add=@coffeeQAttrs,@coffee_Attrs,@coffeeBAttrs,@coffeepAttrs,@coffeeAAttrs,@coffeeJAttrs |
||||
syntax cluster props add=@coffeeRProp |
||||
" syntax match coffeeLDot /\./ containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString nextgroup=@coffeeLibraryFuncs,@coffeeLibraryAttrs |
||||
" |
||||
syntax region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@coffeeInterpString,@jSelectors |
||||
syntax region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@coffeeBasicString,@jSelectors |
||||
|
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
" Vim syntax file |
||||
" Language: JS Lib syntax post process for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/07/01 |
||||
" Version: 0.5 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
" |
||||
|
||||
syntax cluster props add=@javascriptQFunctions,@javascript_Functions,@javascriptBFunctions |
||||
syntax cluster props add=@javascriptpFunctions,@javascriptAFunctions,@javascriptSFunctions,@javascriptJFunctions |
||||
syntax cluster props add=@javascriptQAttrs,@javascript_Attrs,@javascriptBAttrs,@javascriptpAttrs,@javascriptAAttrs,@javascriptJAttrs |
||||
syntax cluster props add=@javascriptRProp |
||||
|
||||
if !exists("javascript_props") |
||||
syntax match javascriptLDot /\./ containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptLineComment,javascriptString nextgroup=@props |
||||
endif |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
" Vim syntax file |
||||
" Language: JS Lib syntax post process for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/02/25 |
||||
" Version: 0.4 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
" |
||||
|
||||
syntax cluster lsLibraryFuncs contains=@lsQFunctions,@ls_Functions,@lsBFunctions,@lspFunctions,@lsAFunctions |
||||
syntax cluster lsLibraryFuncs contains=@lsSFunctions,@lsJFunctions,@lsRProp |
||||
syntax cluster lsLibraryAttrs contains=@lsQAttrs,@ls_Attrs,@lsBAttrs,@lspAttrs,@lsAAttrs,@lsSAttrs,@lsJAttrs |
||||
" ).fun! |
||||
" ).fun() |
||||
" fun0!fun! |
||||
" fun0!fun() |
||||
" obj.fun! |
||||
" obj.fun() |
||||
" ).fun arg |
||||
" !fun arg |
||||
" obj.fun arg |
||||
syntax match lsLDot /\./ containedin=ALLBUT,lsComment,lsLineComment,lsString contains=@lsLibraryFuncs,@lsLibraryAttrs |
||||
syntax match lsLExp /!/ containedin=ALLBUT,lsComment,lsLineComment,lsString contains=@lsLibraryFuncs,@lsLibraryAttrs |
||||
|
||||
syntax match lsLPipe /|>/ containedin=ALLBUT,lsComment,lsLineComment,lsString skipwhite nextgroup=@lspFunctions |
||||
syntax match lsLCompose />>/ containedin=ALLBUT,lsComment,lsLineComment,lsString skipwhite nextgroup=@lspFunctions |
||||
|
||||
syntax region lsString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@lsInterpString,@jSelectors |
||||
syntax region lsString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@lsSimpleString,@jSelectors |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
" Vim syntax file |
||||
" Language: JS Lib syntax post process for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/02/25 |
||||
" Version: 0.4 |
||||
" URL: https://github.com/othree/javascript-libraries-syntax.vim |
||||
" |
||||
|
||||
syntax cluster typescriptLibraryFuncs contains=@typescriptQFunctions,@typescript_Functions,@typescriptBFunctions,@typescriptpFunctions,@typescriptAFunctions,typescriptSFunctions,typescriptJFunctions,@typescriptRProp |
||||
syntax cluster typescriptLibraryAttrs contains=@typescriptQAttrs,@typescript_Attrs,@typescriptBAttrs,@typescriptpAttrs,@typescriptAAttrs,@typescriptSAttrs,@typescriptJAttrs |
||||
syntax match typescriptLDot /\./ containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString nextgroup=@typescriptLibraryFuncs,@typescriptLibraryAttrs |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: prelude.ls for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 0.6.0 |
||||
" URL: http://gkz.github.com/prelude-ls/ |
||||
|
||||
syntax cluster coffeepFunctions contains=coffeepFunction |
||||
|
||||
syntax keyword coffeepFunction contained map filter reject partition find each head tail last initial |
||||
syntax keyword coffeepFunction contained empty values keys length cons append join reverse fold fold1 |
||||
syntax keyword coffeepFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||
syntax keyword coffeepFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||
syntax keyword coffeepFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||
syntax keyword coffeepFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||
syntax keyword coffeepFunction contained fix lines unlines words unwords max min negate abs signum |
||||
syntax keyword coffeepFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||
syntax keyword coffeepFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||
syntax keyword coffeepFunction contained ceiling floor isItNaN even odd gcd lcm |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_prelude_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_prelude_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeepFunction PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: prelude.ls for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 0.6.0 |
||||
" URL: http://gkz.github.com/prelude-ls/ |
||||
|
||||
syntax cluster javascriptpFunctions contains=javascriptpFunction |
||||
|
||||
syntax keyword javascriptpFunction contained map filter reject partition find each head tail last initial |
||||
syntax keyword javascriptpFunction contained empty values keys length cons append join reverse fold fold1 |
||||
syntax keyword javascriptpFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||
syntax keyword javascriptpFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||
syntax keyword javascriptpFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||
syntax keyword javascriptpFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||
syntax keyword javascriptpFunction contained fix lines unlines words unwords max min negate abs signum |
||||
syntax keyword javascriptpFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||
syntax keyword javascriptpFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||
syntax keyword javascriptpFunction contained ceiling floor isItNaN even odd gcd lcm |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_prelude_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_prelude_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptpFunction PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: prelude.ls for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 0.6.0 |
||||
" URL: http://gkz.github.com/prelude-ls/ |
||||
|
||||
syntax cluster lspFunctions contains=lspFunction |
||||
|
||||
syntax keyword lspFunction contained map filter reject partition find each head tail last initial |
||||
syntax keyword lspFunction contained empty values keys length cons append join reverse fold fold1 |
||||
syntax keyword lspFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||
syntax keyword lspFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||
syntax keyword lspFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||
syntax keyword lspFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||
syntax keyword lspFunction contained fix lines unlines words unwords max min negate abs signum |
||||
syntax keyword lspFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||
syntax keyword lspFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||
syntax keyword lspFunction contained ceiling floor isItNaN even odd gcd lcm |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_prelude_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_prelude_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lspFunction PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: prelude.ls for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 0.6.0 |
||||
" URL: http://gkz.github.com/prelude-ls/ |
||||
|
||||
syntax cluster typescriptpFunctions contains=typescriptpFunction |
||||
|
||||
syntax keyword typescriptpFunction contained map filter reject partition find each head tail last initial |
||||
syntax keyword typescriptpFunction contained empty values keys length cons append join reverse fold fold1 |
||||
syntax keyword typescriptpFunction contained foldr foldr1 unfold andList orList any all unique sort sortBy |
||||
syntax keyword typescriptpFunction contained compare sum product mean concat concatMap maximum minimum scan scan1 |
||||
syntax keyword typescriptpFunction contained scanr scanr1 replicate take drop splitAt takeWhile dropWhile span breakIt |
||||
syntax keyword typescriptpFunction contained listToObj objToFunc zip zipWith zipAll zipAllWith compose curry id flip |
||||
syntax keyword typescriptpFunction contained fix lines unlines words unwords max min negate abs signum |
||||
syntax keyword typescriptpFunction contained quot rem div mod recip pi tau exp sqrt ln |
||||
syntax keyword typescriptpFunction contained pow sin cos tan asin acos atan atan2 truncate round |
||||
syntax keyword typescriptpFunction contained ceiling floor isItNaN even odd gcd lcm |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_prelude_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_prelude_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptpFunction PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: React for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 0.12.0 |
||||
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||
" URL: https://facebook.github.io/react/docs/component-api.html |
||||
|
||||
syntax keyword coffeeReact React ReactDOM containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution |
||||
|
||||
syntax keyword coffeeRTop contained createClass render unmountComponentAtNode renderToString |
||||
syntax keyword coffeeRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||
syntax keyword coffeeRTop contained initializeTouchEvents Children map forEach count only |
||||
syntax keyword coffeeRComponent contained setState replaceState forceUpdate getDOMNode |
||||
syntax keyword coffeeRComponent contained isMounted setProps replaceProps |
||||
|
||||
syntax cluster coffeeRProp contains=coffeeRTop,coffeeRComponent |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeReact Constant |
||||
|
||||
HiLink coffeeRTop PreProc |
||||
HiLink coffeeRComponent PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: React for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 0.12.0 |
||||
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||
" URL: https://facebook.github.io/react/docs/component-api.html |
||||
|
||||
syntax keyword javascriptReact React ReactDOM containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution |
||||
|
||||
syntax keyword javascriptRTop contained createClass render unmountComponentAtNode renderToString |
||||
syntax keyword javascriptRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||
syntax keyword javascriptRTop contained initializeTouchEvents Children map forEach count only |
||||
syntax keyword javascriptRComponent contained setState replaceState forceUpdate getDOMNode |
||||
syntax keyword javascriptRComponent contained isMounted setProps replaceProps |
||||
|
||||
syntax cluster javascriptRProp contains=javascriptRTop,javascriptRComponent |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptReact Constant |
||||
|
||||
HiLink javascriptRTop PreProc |
||||
HiLink javascriptRComponent PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: React for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 0.12.0 |
||||
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||
" URL: https://facebook.github.io/react/docs/component-api.html |
||||
|
||||
syntax keyword lsReact React ReactDOM containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution |
||||
|
||||
syntax keyword lsRTop contained createClass render unmountComponentAtNode renderToString |
||||
syntax keyword lsRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||
syntax keyword lsRTop contained initializeTouchEvents Children map forEach count only |
||||
syntax keyword lsRComponent contained setState replaceState forceUpdate getDOMNode |
||||
syntax keyword lsRComponent contained isMounted setProps replaceProps |
||||
|
||||
syntax cluster lsRProp contains=lsRTop,lsRComponent |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsReact Constant |
||||
|
||||
HiLink lsRTop PreProc |
||||
HiLink lsRComponent PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
" Vim syntax file |
||||
" Language: React for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2014/10/29 |
||||
" Version: 0.12.0 |
||||
" URL: https://facebook.github.io/react/docs/top-level-api.html |
||||
" URL: https://facebook.github.io/react/docs/component-api.html |
||||
|
||||
syntax keyword typescriptReact React ReactDOM containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution |
||||
|
||||
syntax keyword typescriptRTop contained createClass render unmountComponentAtNode renderToString |
||||
syntax keyword typescriptRTop contained renderToStaticMarkup isValidElement DOM PropTypes |
||||
syntax keyword typescriptRTop contained initializeTouchEvents Children map forEach count only |
||||
syntax keyword typescriptRComponent contained setState replaceState forceUpdate getDOMNode |
||||
syntax keyword typescriptRComponent contained isMounted setProps replaceProps |
||||
|
||||
syntax cluster typescriptRProp contains=typescriptRTop,typescriptRComponent |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_jquery_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_jquery_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptReact Constant |
||||
|
||||
HiLink typescriptRTop PreProc |
||||
HiLink typescriptRComponent PreProc |
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
" Vim syntax file |
||||
" Language: require.js for coffee |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 2.1.4.1 |
||||
" URL: http://requirejs.org/ |
||||
|
||||
|
||||
syntax keyword coffeeRequire require requirejs containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString,coffeeTemplate,coffeeTemplateSubstitution nextgroup=coffeeRequiredot |
||||
syntax match coffeeRequiredot contained /\./ nextgroup=coffeeRequireMethods |
||||
syntax keyword coffeeRequireMethods contained config |
||||
|
||||
syntax keyword coffeeRdefine define containedin=ALLBUT,coffeeComment,coffeeLineComment,coffeeString nextgroup=coffeeRdefinedot |
||||
syntax match coffeeRdefinedot contained /\./ nextgroup=coffeeRdefineMethods |
||||
syntax keyword coffeeRdefineMethods contained amd |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_coffee_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_coffee_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink coffeeRequire PreProc |
||||
HiLink coffeeRequireMethods PreProc |
||||
HiLink coffeeRdefine PreProc |
||||
HiLink coffeeRdefineMethods PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
" Vim syntax file |
||||
" Language: require.js for javascript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 2.1.4.1 |
||||
" URL: http://requirejs.org/ |
||||
|
||||
|
||||
syntax keyword javascriptRequire require requirejs containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString,javascriptTemplate,javascriptTemplateSubstitution nextgroup=javascriptRequiredot |
||||
syntax match javascriptRequiredot contained /\./ nextgroup=javascriptRequireMethods |
||||
syntax keyword javascriptRequireMethods contained config |
||||
|
||||
syntax keyword javascriptRdefine define containedin=ALLBUT,javascriptComment,javascriptLineComment,javascriptString nextgroup=javascriptRdefinedot |
||||
syntax match javascriptRdefinedot contained /\./ nextgroup=javascriptRdefineMethods |
||||
syntax keyword javascriptRdefineMethods contained amd |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_javascript_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_javascript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink javascriptRequire PreProc |
||||
HiLink javascriptRequireMethods PreProc |
||||
HiLink javascriptRdefine PreProc |
||||
HiLink javascriptRdefineMethods PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
" Vim syntax file |
||||
" Language: require.js for ls |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 2.1.4.1 |
||||
" URL: http://requirejs.org/ |
||||
|
||||
|
||||
syntax keyword lsRequire require requirejs containedin=ALLBUT,lsComment,lsLineComment,lsString,lsTemplate,lsTemplateSubstitution nextgroup=lsRequiredot |
||||
syntax match lsRequiredot contained /\./ nextgroup=lsRequireMethods |
||||
syntax keyword lsRequireMethods contained config |
||||
|
||||
syntax keyword lsRdefine define containedin=ALLBUT,lsComment,lsLineComment,lsString nextgroup=lsRdefinedot |
||||
syntax match lsRdefinedot contained /\./ nextgroup=lsRdefineMethods |
||||
syntax keyword lsRdefineMethods contained amd |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_ls_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_ls_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink lsRequire PreProc |
||||
HiLink lsRequireMethods PreProc |
||||
HiLink lsRdefine PreProc |
||||
HiLink lsRdefineMethods PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
" Vim syntax file |
||||
" Language: require.js for typescript |
||||
" Maintainer: othree <othree@gmail.com> |
||||
" Last Change: 2013/07/26 |
||||
" Version: 2.1.4.1 |
||||
" URL: http://requirejs.org/ |
||||
|
||||
|
||||
syntax keyword typescriptRequire require requirejs containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString,typescriptTemplate,typescriptTemplateSubstitution nextgroup=typescriptRequiredot |
||||
syntax match typescriptRequiredot contained /\./ nextgroup=typescriptRequireMethods |
||||
syntax keyword typescriptRequireMethods contained config |
||||
|
||||
syntax keyword typescriptRdefine define containedin=ALLBUT,typescriptComment,typescriptLineComment,typescriptString nextgroup=typescriptRdefinedot |
||||
syntax match typescriptRdefinedot contained /\./ nextgroup=typescriptRdefineMethods |
||||
syntax keyword typescriptRdefineMethods contained amd |
||||
|
||||
|
||||
" Define the default highlighting. |
||||
" For version 5.7 and earlier: only when not done already |
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet |
||||
if version >= 508 || !exists("did_requirejs_typescript_syntax_inits") |
||||
if version < 508 |
||||
let did_requirejs_typescript_syntax_inits = 1 |
||||
command -nargs=+ HiLink hi link <args> |
||||
else |
||||
command -nargs=+ HiLink hi def link <args> |
||||
endif |
||||
|
||||
HiLink typescriptRequire PreProc |
||||
HiLink typescriptRequireMethods PreProc |
||||
HiLink typescriptRdefine PreProc |
||||
HiLink typescriptRdefineMethods PreProc |
||||
|
||||
|
||||
delcommand HiLink |
||||
endif |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue