diff --git a/maximum_awesome_vimrc b/maximum_awesome_vimrc new file mode 100644 index 00000000..f040e9bd --- /dev/null +++ b/maximum_awesome_vimrc @@ -0,0 +1,114 @@ +" set up pathogen, https://github.com/tpope/vim-pathogen +filetype on " without this vim emits a zero exit status, later, because of :ft off +filetype off +call pathogen#infect() +filetype plugin indent on + +" don't bother with vi compatibility +set nocompatible + +" enable syntax highlighting +syntax enable + +set autoindent +set autoread " reload files when changed on disk, i.e. via `git checkout` +set backspace=2 " Fix broken backspace in some setups +set backupcopy=yes " see :help crontab +set clipboard=unnamed " yank and paste with the system clipboard +set directory-=. " don't store swapfiles in the current directory +set encoding=utf-8 +set expandtab " expand tabs to spaces +set ignorecase " case-insensitive search +set incsearch " search as you type +set laststatus=2 " always show statusline +set list " show trailing whitespace +set listchars=tab:▸\ ,trail:▫ +set number " show line numbers +set ruler " show where you are +set scrolloff=3 " show context above/below cursorline +set shiftwidth=2 " normal mode indentation commands use 2 spaces +set showcmd +set smartcase " case-sensitive search if any caps +set softtabstop=2 " insert mode tab and backspace use 2 spaces +set tabstop=8 " actual tabs occupy 8 characters +set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc +set wildmenu " show a navigable menu for tab completion +set wildmode=longest,list,full + +" Enable basic mouse behavior such as resizing buffers. +set mouse=a +if exists('$TMUX') " Support resizing in tmux + set ttymouse=xterm2 +endif + +" keyboard shortcuts +let mapleader = ',' +map h +map j +map k +map l +map l :Align +nmap a :Ack +nmap b :CtrlPBuffer +nmap d :NERDTreeToggle +nmap f :NERDTreeFind +nmap t :CtrlP +nmap T :CtrlPClearCache:CtrlP +nmap ] :TagbarToggle +nmap :call whitespace#strip_trailing() +nmap g :GitGutterToggle +nmap c Kwbd +map V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" + +" plugin settings +let g:ctrlp_match_window = 'order:ttb,max:20' +let g:NERDSpaceDelims=1 +let g:gitgutter_enabled = 0 + +" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher +if executable('ag') + let g:ackprg = 'ag --nogroup --column' + + " Use Ag over Grep + set grepprg=ag\ --nogroup\ --nocolor + + " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore + let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' +endif + +" fdoc is yaml +autocmd BufRead,BufNewFile *.fdoc set filetype=yaml +" md is markdown +autocmd BufRead,BufNewFile *.md set filetype=markdown +" extra rails.vim help +autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb +autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb +autocmd User Rails silent! Rnavcommand feature features -glob=**/* -suffix=.feature +autocmd User Rails silent! Rnavcommand job app/jobs -glob=**/* -suffix=_job.rb +autocmd User Rails silent! Rnavcommand mediator app/mediators -glob=**/* -suffix=_mediator.rb +autocmd User Rails silent! Rnavcommand stepdefinition features/step_definitions -glob=**/* -suffix=_steps.rb +" automatically rebalance windows on vim resize +autocmd VimResized * :wincmd = + +" Fix Cursor in TMUX +if exists('$TMUX') + let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" + let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" +else + let &t_SI = "\]50;CursorShape=1\x7" + let &t_EI = "\]50;CursorShape=0\x7" +endif + +" Go crazy! +if filereadable(expand("~/.vimrc.local")) + " In your .vimrc.local, you might like: + " + " set autowrite + " set nocursorline + " set nowritebackup + " set whichwrap+=<,>,h,l,[,] " Wrap arrow keys between lines + " + " autocmd! bufwritepost .vimrc source ~/.vimrc + " noremap! jj + source ~/.vimrc.local +endif diff --git a/sources_forked/molokai b/sources_forked/molokai new file mode 160000 index 00000000..fd2e0b6a --- /dev/null +++ b/sources_forked/molokai @@ -0,0 +1 @@ +Subproject commit fd2e0b6a0ee4561c457bbd9db7f72e1ecc6a5a19 diff --git a/sources_non_forked/syntastic/.gitignore b/sources_non_forked/syntastic/.gitignore new file mode 100644 index 00000000..cc07c931 --- /dev/null +++ b/sources_non_forked/syntastic/.gitignore @@ -0,0 +1,4 @@ +*~ +*.swp +tags +.DS_Store diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md new file mode 100644 index 00000000..764ffffc --- /dev/null +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Bug reports / Github issues + +When reporting a bug make sure you search the existing github issues for the +same/similar issues. If you find one, feel free to add a `+1` comment with any +additional information that may help us solve the issue. + +When creating a new issue be sure to state the following: + +* Steps to reproduce the bug. +* The version of vim you are using. +* The version of syntastic you are using. + +For syntax checker bugs also state the version of the checker executable that you are using. + +# Submitting a patch + +* Fork the repo on github +* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking +* Submit a pull request based off your topic branch + +Small focused patches are preferred. + +Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say. + +# General style notes + +Following the coding conventions/styles used in the syntastic core: + +* Use 4 space indents. +* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!). +* Don't use `l:` prefixes for variables unless actually required (i.e. almost never). +* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability. + +# Syntax checker style notes + +The preferred style for error format strings is one "clause" per line. E.g. +(from the coffeelint checker): + +```viml +let errorformat = '%E%f:%l:%c: %trror: %m,' . + \ 'Syntax%trror: In %f\, %m on line %l,' . + \ '%EError: In %f\, Parse error on line %l: %m,' . + \ '%EError: In %f\, %m on line %l,' . + \ '%W%f(%l): lint warning: %m,' . + \ '%W%f(%l): warning: %m,' . + \ '%E%f(%l): SyntaxError: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' +``` diff --git a/sources_non_forked/syntastic/LICENCE b/sources_non_forked/syntastic/LICENCE new file mode 100644 index 00000000..8b1a9d81 --- /dev/null +++ b/sources_non_forked/syntastic/LICENCE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified +copies of this license document, and changing it is allowed as long +as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown new file mode 100644 index 00000000..d7492750 --- /dev/null +++ b/sources_non_forked/syntastic/README.markdown @@ -0,0 +1,175 @@ + , + / \,,_ .'| + ,{{| /}}}}/_.' _____________________________________________ + }}}}` '{{' '. / \ + {{{{{ _ ;, \ / Ladies and Gentlemen, \ + ,}}}}}} /o`\ ` ;) | | + {{{{{{ / ( | this is ... | + }}}}}} | \ | | + {{{{{{{{ \ \ | | + }}}}}}}}} '.__ _ | | _____ __ __ _ | + {{{{{{{{ /`._ (_\ / | / ___/__ ______ / /_____ ______/ /_(_)____ | + }}}}}}' | //___/ --=: \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ | + jgs `{{{{` | '--' | ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ | + }}}` | /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ | + | /____/ | + | / + \_____________________________________________/ + + + + +Syntastic is a syntax checking plugin that runs files through external syntax +checkers and displays any resulting errors to the user. This can be done on +demand, or automatically as files are saved. If syntax errors are detected, the +user is notified and is happy because they didn't have to compile their code or +execute their script to find them. + +At the time of this writing, syntax checking plugins exist for Ada, +AppleScript, Bourne shell, C, C++, C#, CoffeeScript, Coco, Coq, CSS, +Cucumber, CUDA, D, Dart, DocBook, Elixir, Erlang, eRuby, Fortran, +Gentoo metadata, Go, Haml, Haskell, Haxe, HSS, HTML, Java, JavaScript, +JSON, LESS, LISP, LLVM intermediate language, Lua, MATLAB, NASM, +Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, Puppet, Python, +reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, +Twig, TypeScript, Vala, VHDL, xHtml, XML, XSLT, YAML, z80, Zope page +templates, zsh. + +## Screenshot + +Below is a screenshot showing the methods that Syntastic uses to display syntax +errors. Note that, in practise, you will only have a subset of these methods +enabled. + +![Screenshot 1](https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png) + +1. Errors are loaded into the location list for the corresponding window. +2. When the cursor is on a line containing an error, the error message is echoed in the command window. +3. Signs are placed beside lines with errors - note that warnings are displayed in a different color. +4. There is a configurable statusline flag you can include in your statusline config. +5. Hover the mouse over a line containing an error and the error message is displayed as a balloon. +6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted. + +## Installation + +Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already +have pathogen working then skip Step 1 and go to Step 2. + +### Step 1: Install pathogen.vim + +First I'll show you how to install tpope's [pathogen.vim](https://github.com/tpope/vim-pathogen) so that +it's easy to install syntastic. Do this in your Terminal so that you get the pathogen.vim file +and the directories it needs: + + mkdir -p ~/.vim/autoload ~/.vim/bundle; \ + curl -so ~/.vim/autoload/pathogen.vim \ + https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim + +Next you *need to add this* to your ~/.vimrc: + + execute pathogen#infect() + +### Step 2: Install syntastic as a pathogen bundle + +You now have pathogen installed and can put syntastic into ~/.vim/bundle like this: + + + cd ~/.vim/bundle + git clone https://github.com/scrooloose/syntastic.git + +Quit vim and start it back up to reload it, then type: + + :Helptags + +If you get an error when you do this, then you probably didn't install pathogen right. Go back to +step 1 and make sure you did the following: + +1. Created both the ~/.vim/autoload and ~/.vim/bundle directories. +2. Added the "call pathogen#infect()" line to your ~/.vimrc file +3. Did the git clone of syntastic inside ~/.vim/bundle +4. Have permissions to access all of these directories. + + +## Google group + +To get information or make suggestions check out the [google group](https://groups.google.com/group/vim-syntastic). + + +## FAQ + +__Q. I installed syntastic but it isn't reporting any errors...__ + +A. The most likely reason is that none of the syntax checkers that it requires is installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executables are supported, just look in `syntax_checkers//*.vim`. Note that aliases do not work; the actual executable must be available in your `$PATH`. Symbolic links are okay. You can see syntastic's idea of available checkers by running `:SyntasticInfo`. + +Another reason it could fail is that either the command line options or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request. + +__Q. Recently some of my syntax checker options have stopped working...__ + +A. The options are still there, they have just been renamed. Recently, almost all syntax checkers were refactored to use the new `syntastic#makeprg#build()` function. This made a lot of the old explicit options redundant - as they are now implied. The new implied options usually have slightly different names to the old options. + +e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use `g:syntastic_php_phpcs_args`. + +See `:help syntastic-checker-options` for more information. + +__Q. I run a checker and the location list is not updated...__ + +A. By default, the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your vimrc: +```vim +let g:syntastic_always_populate_loc_list=1 +``` + +__Q. How can I pass additional arguments to a checker?__ + +A. Almost all syntax checkers use the `syntastic#makeprg#build()` function. Those checkers that do can be configured using global variables. The general form of the global args variables are: +```vim +syntastic___args +``` + +So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc: +```vim +let g:syntastic_ruby_mri_args="--my --args --here" +``` + +See `:help syntastic-checker-options` for more information. + +__Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ + +A. Stick a line like this in your vimrc: +```vim +let g:syntastic__checkers=[''] +``` + +To see the list of checkers for your filetype, look in `syntax_checkers//`. + +e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a native `python` checker. + +To tell syntastic to use `pylint`, you would use this setting: +```vim +let g:syntastic_python_checkers=['pylint'] +``` + +Some filetypes, like PHP, have style checkers as well as syntax checkers. These can be chained together like this: +```vim +let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd'] +``` + +This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`. + +__Q. How can I jump between the different errors without using the location list at the bottom of the window?__ + +A. Vim provides several built in commands for this. See `:help :lnext` and `:help :lprev`. + +If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired](https://github.com/tpope/vim-unimpaired), which provides such mappings (among other things). + +__Q. A syntax checker is giving me unwanted/strange style tips?__ + +A. Some filetypes (e.g. php) have style checkers as well as syntax checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the [wiki](https://github.com/scrooloose/syntastic/wiki/Syntaxcheckers) to see what options are available. + +__Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ + +A. There is no safe way to handle that situation automatically, but you can work around it: + +```vim +nnoremap :lclose:bdelete +cabbrev bd lclose\|bdelete +``` diff --git a/sources_non_forked/syntastic/_assets/screenshot_1.png b/sources_non_forked/syntastic/_assets/screenshot_1.png new file mode 100644 index 00000000..c1b69f4b Binary files /dev/null and b/sources_non_forked/syntastic/_assets/screenshot_1.png differ diff --git a/sources_non_forked/syntastic/autoload/syntastic/c.vim b/sources_non_forked/syntastic/autoload/syntastic/c.vim new file mode 100644 index 00000000..aac6fc38 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/c.vim @@ -0,0 +1,239 @@ +if exists("g:loaded_syntastic_c_autoload") + finish +endif +let g:loaded_syntastic_c_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" initialize c/cpp syntax checker handlers +function! s:Init() + let s:handlers = [] + let s:cflags = {} + + call s:RegHandler('gtk', 'syntastic#c#CheckPKG', + \ ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib']) + call s:RegHandler('glib', 'syntastic#c#CheckPKG', + \ ['glib', 'glib-2.0', 'glib']) + call s:RegHandler('glade', 'syntastic#c#CheckPKG', + \ ['glade', 'libglade-2.0', 'libglade']) + call s:RegHandler('libsoup', 'syntastic#c#CheckPKG', + \ ['libsoup', 'libsoup-2.4', 'libsoup-2.2']) + call s:RegHandler('webkit', 'syntastic#c#CheckPKG', + \ ['webkit', 'webkit-1.0']) + call s:RegHandler('cairo', 'syntastic#c#CheckPKG', + \ ['cairo', 'cairo']) + call s:RegHandler('pango', 'syntastic#c#CheckPKG', + \ ['pango', 'pango']) + call s:RegHandler('libxml', 'syntastic#c#CheckPKG', + \ ['libxml', 'libxml-2.0', 'libxml']) + call s:RegHandler('freetype', 'syntastic#c#CheckPKG', + \ ['freetype', 'freetype2', 'freetype']) + call s:RegHandler('SDL', 'syntastic#c#CheckPKG', + \ ['sdl', 'sdl']) + call s:RegHandler('opengl', 'syntastic#c#CheckPKG', + \ ['opengl', 'gl']) + call s:RegHandler('ruby', 'syntastic#c#CheckRuby', []) + call s:RegHandler('Python\.h', 'syntastic#c#CheckPython', []) + call s:RegHandler('php\.h', 'syntastic#c#CheckPhp', []) +endfunction + +" default include directories +let s:default_includes = [ '.', '..', 'include', 'includes', + \ '../include', '../includes' ] + +" convenience function to determine the 'null device' parameter +" based on the current operating system +function! syntastic#c#GetNullDevice() + if has('win32') + return '-o nul' + elseif has('unix') || has('mac') + return '-o /dev/null' + endif + return '' +endfunction + +" get the gcc include directory argument depending on the default +" includes and the optional user-defined 'g:syntastic_c_include_dirs' +function! syntastic#c#GetIncludeDirs(filetype) + let include_dirs = [] + + if !exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') || + \ !g:syntastic_{a:filetype}_no_default_include_dirs + let include_dirs = copy(s:default_includes) + endif + + if exists('g:syntastic_'.a:filetype.'_include_dirs') + call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs) + endif + + return join(map(syntastic#util#unique(include_dirs), '"-I" . v:val'), ' ') +endfunction + +" read additional compiler flags from the given configuration file +" the file format and its parsing mechanism is inspired by clang_complete +function! syntastic#c#ReadConfig(file) + " search in the current file's directory upwards + let config = findfile(a:file, '.;') + if config == '' || !filereadable(config) | return '' | endif + + " convert filename into absolute path + let filepath = substitute(fnamemodify(config, ':p:h'), '\', '/', 'g') + + " try to read config file + try + let lines = map(readfile(config), + \ 'substitute(v:val, ''\'', ''/'', ''g'')') + catch /E484/ + return '' + endtry + + let parameters = [] + for line in lines + let matches = matchlist(line, '\C^\s*-I\s*\(\S\+\)') + if matches != [] && matches[1] != '' + " this one looks like an absolute path + if match(matches[1], '^\%(/\|\a:\)') != -1 + call add(parameters, '-I' . matches[1]) + else + call add(parameters, '-I' . filepath . '/' . matches[1]) + endif + else + call add(parameters, line) + endif + endfor + + return join(parameters, ' ') +endfunction + +" search the first 100 lines for include statements that are +" given in the handlers dictionary +function! syntastic#c#SearchHeaders() + let includes = '' + let files = [] + let found = [] + let lines = filter(getline(1, 100), 'v:val =~# "#\s*include"') + + " search current buffer + for line in lines + let file = matchstr(line, '"\zs\S\+\ze"') + if file != '' + call add(files, file) + continue + endif + for handler in s:handlers + if line =~# handler["regex"] + let includes .= call(handler["func"], handler["args"]) + call add(found, handler["regex"]) + break + endif + endfor + endfor + + " search included headers + for hfile in files + if hfile != '' + let filename = expand('%:p:h') . (has('win32') ? + \ '\' : '/') . hfile + try + let lines = readfile(filename, '', 100) + catch /E484/ + continue + endtry + let lines = filter(lines, 'v:val =~# "#\s*include"') + for handler in s:handlers + if index(found, handler["regex"]) != -1 + continue + endif + for line in lines + if line =~# handler["regex"] + let includes .= call(handler["func"], handler["args"]) + call add(found, handler["regex"]) + break + endif + endfor + endfor + endif + endfor + + return includes +endfunction + +" try to find library with 'pkg-config' +" search possible libraries from first to last given +" argument until one is found +function! syntastic#c#CheckPKG(name, ...) + if executable('pkg-config') + if !has_key(s:cflags, a:name) + for i in range(a:0) + let l:cflags = system('pkg-config --cflags '.a:000[i]) + " since we cannot necessarily trust the pkg-config exit code + " we have to check for an error output as well + if v:shell_error == 0 && l:cflags !~? 'not found' + let l:cflags = ' '.substitute(l:cflags, "\n", '', '') + let s:cflags[a:name] = l:cflags + return l:cflags + endif + endfor + else + return s:cflags[a:name] + endif + endif + return '' +endfunction + +" try to find PHP includes with 'php-config' +function! syntastic#c#CheckPhp() + if executable('php-config') + if !exists('s:php_flags') + let s:php_flags = system('php-config --includes') + let s:php_flags = ' ' . substitute(s:php_flags, "\n", '', '') + endif + return s:php_flags + endif + return '' +endfunction + +" try to find the ruby headers with 'rbconfig' +function! syntastic#c#CheckRuby() + if executable('ruby') + if !exists('s:ruby_flags') + let s:ruby_flags = system('ruby -r rbconfig -e ' + \ . '''puts Config::CONFIG["archdir"]''') + let s:ruby_flags = substitute(s:ruby_flags, "\n", '', '') + let s:ruby_flags = ' -I' . s:ruby_flags + endif + return s:ruby_flags + endif + return '' +endfunction + +" try to find the python headers with distutils +function! syntastic#c#CheckPython() + if executable('python') + if !exists('s:python_flags') + let s:python_flags = system('python -c ''from distutils import ' + \ . 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''') + let s:python_flags = substitute(s:python_flags, "\n", '', '') + let s:python_flags = ' -I' . s:python_flags + endif + return s:python_flags + endif + return '' +endfunction + +" return a handler dictionary object +function! s:RegHandler(regex, function, args) + let handler = {} + let handler["regex"] = a:regex + let handler["func"] = function(a:function) + let handler["args"] = a:args + call add(s:handlers, handler) +endfunction + +call s:Init() + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/autoload/syntastic/makeprg.vim b/sources_non_forked/syntastic/autoload/syntastic/makeprg.vim new file mode 100644 index 00000000..4d7a0331 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/makeprg.vim @@ -0,0 +1,50 @@ +if exists("g:loaded_syntastic_makeprg_autoload") + finish +endif +let g:loaded_syntastic_makeprg_autoload = 1 + +"Returns a makeprg of the form +" +"[exe] [args] [filename] [post_args] [tail] +" +"A (made up) example: +" ruby -a -b -c test_file.rb --more --args > /tmp/output +" +"To generate this you would call: +" +" let makeprg = syntastic#makeprg#build({ +" \ 'exe': 'ruby', +" \ 'args': '-a -b -c', +" \ 'post_args': '--more --args', +" \ 'tail': '> /tmp/output', +" \ 'filetype': 'ruby', +" \ 'subchecker': 'mri' }) +" +"Note that the current filename is added by default - but can be overridden by +"passing in an 'fname' arg. +" +"Arguments 'filetype' and 'subchecker' are mandatory, handling of composite +"types and user-defined variables breaks if you omit them. +" +"All other options can be overriden by the user with global variables - even +"when not specified by the checker in syntastic#makeprg#build(). +" +"E.g. They could override the checker exe with +" +" let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb" +" +"The general form of the override option is: +" syntastic_[filetype]_[subchecker]_[option-name] +" +function! syntastic#makeprg#build(opts) + let builder = g:SyntasticMakeprgBuilder.New( + \ get(a:opts, 'exe', ''), + \ get(a:opts, 'args', ''), + \ get(a:opts, 'fname', ''), + \ get(a:opts, 'post_args', ''), + \ get(a:opts, 'tail', ''), + \ get(a:opts, 'filetype', ''), + \ get(a:opts, 'subchecker', '') ) + + return builder.makeprg() +endfunction diff --git a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim new file mode 100644 index 00000000..188a28a4 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim @@ -0,0 +1,58 @@ +if exists("g:loaded_syntastic_postprocess_autoload") + finish +endif +let g:loaded_syntastic_postprocess_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! s:compareErrorItems(a, b) + if a:a['bufnr'] != a:b['bufnr'] + " group by files + return a:a['bufnr'] - a:b['bufnr'] + elseif a:a['lnum'] != a:b['lnum'] + return a:a['lnum'] - a:b['lnum'] + elseif a:a['type'] !=? a:b['type'] + " errors take precedence over warnings + return a:a['type'] ==? 'e' ? -1 : 1 + else + return get(a:a, 'col') - get(a:b, 'col') + endif +endfunction + +" natural sort +function! syntastic#postprocess#sort(errors) + return sort(a:errors, 's:compareErrorItems') +endfunction + +function syntastic#postprocess#compressWhitespace(errors) + let llist = [] + + for e in a:errors + let e['text'] = substitute(e['text'], '\n', ' ', 'g') + let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g') + call add(llist, e) + endfor + + return llist +endfunction + +" remove spurious CR under Cygwin +function! syntastic#postprocess#cygwinRemoveCR(errors) + if has('win32unix') + let llist = [] + + for e in a:errors + let e['text'] = substitute(e['text'], '\r', '', 'g') + call add(llist, e) + endfor + else + let llist = a:errors + endif + + return llist +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim new file mode 100644 index 00000000..b569bc18 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -0,0 +1,201 @@ +if exists("g:loaded_syntastic_util_autoload") + finish +endif +let g:loaded_syntastic_util_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +if !exists("g:syntastic_debug") + let g:syntastic_debug = 0 +endif + +let s:deprecationNoticesIssued = [] + +function! syntastic#util#DevNull() + if has('win32') + return 'NUL' + endif + return '/dev/null' +endfunction + +"search the first 5 lines of the file for a magic number and return a map +"containing the args and the executable +" +"e.g. +" +"#!/usr/bin/perl -f -bar +" +"returns +" +"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} +function! syntastic#util#parseShebang() + for lnum in range(1,5) + let line = getline(lnum) + + if line =~ '^#!' + let exe = matchstr(line, '^#!\s*\zs[^ \t]*') + let args = split(matchstr(line, '^#!\s*[^ \t]*\zs.*')) + return {'exe': exe, 'args': args} + endif + endfor + + return {'exe': '', 'args': []} +endfunction + +" Run 'command' in a shell and parse output as a version string. +" Returns an array of version components. +function! syntastic#util#parseVersion(command) + return split(matchstr( system(a:command), '\v^\D*\zs\d+(\.\d+)+\ze' ), '\.') +endfunction + +" Verify that the 'installed' version is at least the 'required' version. +" +" 'installed' and 'required' must be arrays. If they have different lengths, +" the "missing" elements will be assumed to be 0 for the purposes of checking. +" +" See http://semver.org for info about version numbers. +function! syntastic#util#versionIsAtLeast(installed, required) + for index in range(max([len(a:installed), len(a:required)])) + if len(a:installed) <= index + let installed_element = 0 + else + let installed_element = a:installed[index] + endif + if len(a:required) <= index + let required_element = 0 + else + let required_element = a:required[index] + endif + if installed_element != required_element + return installed_element > required_element + endif + endfor + " Everything matched, so it is at least the required version. + return 1 +endfunction + +"print as much of a:msg as possible without "Press Enter" prompt appearing +function! syntastic#util#wideMsg(msg) + let old_ruler = &ruler + let old_showcmd = &showcmd + + "convert tabs to spaces so that the tabs count towards the window width + "as the proper amount of characters + let msg = substitute(a:msg, "\t", repeat(" ", &tabstop), "g") + let msg = strpart(msg, 0, winwidth(0)-1) + + "This is here because it is possible for some error messages to begin with + "\n which will cause a "press enter" prompt. I have noticed this in the + "javascript:jshint checker and have been unable to figure out why it + "happens + let msg = substitute(msg, "\n", "", "g") + + set noruler noshowcmd + redraw + + echo msg + + let &ruler=old_ruler + let &showcmd=old_showcmd +endfunction + +" Check whether a buffer is loaded, listed, and not hidden +function! syntastic#util#bufIsActive(buffer) + " convert to number, or hell breaks loose + let buf = str2nr(a:buffer) + + if !bufloaded(buf) || !buflisted(buf) + return 0 + endif + + " get rid of hidden buffers + for tab in range(1, tabpagenr('$')) + if index(tabpagebuflist(tab), buf) >= 0 + return 1 + endif + endfor + + return 0 +endfunction + +" start in directory a:where and walk up the parent folders until it +" finds a file matching a:what; return path to that file +function! syntastic#util#findInParent(what, where) + let here = fnamemodify(a:where, ':p') + + while !empty(here) + let p = split(globpath(here, a:what), '\n') + + if !empty(p) + return fnamemodify(p[0], ':p') + elseif here == '/' + break + endif + + " we use ':h:h' rather than ':h' since ':p' adds a trailing '/' + " if 'here' is a directory + let here = fnamemodify(here, ':p:h:h') + endwhile + + return '' +endfunction + +" Returns unique elements in a list +function! syntastic#util#unique(list) + let seen = {} + let uniques = [] + for e in a:list + if !has_key(seen, e) + let seen[e] = 1 + call add(uniques, e) + endif + endfor + return uniques +endfunction + +" A less noisy shellescape() +function! syntastic#util#shescape(string) + return a:string =~ '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string, 1) +endfunction + +" A less noisy shellescape(expand()) +function! syntastic#util#shexpand(string) + return syntastic#util#shescape(escape(expand(a:string), '|')) +endfunction + +function! syntastic#util#debug(msg) + if g:syntastic_debug + echomsg "syntastic: debug: " . a:msg + endif +endfunction + +function! syntastic#util#info(msg) + echomsg "syntastic: info: " . a:msg +endfunction + +function! syntastic#util#warn(msg) + echohl WarningMsg + echomsg "syntastic: warning: " . a:msg + echohl None +endfunction + +function! syntastic#util#error(msg) + execute "normal \" + echohl ErrorMsg + echomsg "syntastic: error: " . a:msg + echohl None +endfunction + +function! syntastic#util#deprecationWarn(msg) + if index(s:deprecationNoticesIssued, a:msg) >= 0 + return + endif + + call add(s:deprecationNoticesIssued, a:msg) + call syntastic#util#warn(a:msg) +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt new file mode 100644 index 00000000..0c95ab7c --- /dev/null +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -0,0 +1,455 @@ +*syntastic.txt* Syntax checking on the fly has never been so pimp. +*syntastic* + + + It's a bird! It's a plane! ZOMG It's ... ~ + + _____ __ __ _ ~ + / ___/__ ______ / /_____ ______/ /_(_)____ ~ + \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ ~ + ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ ~ + /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ ~ + /____/ ~ + + + + Reference Manual~ + + +============================================================================== +CONTENTS *syntastic-contents* + + 1.Intro...................................|syntastic-intro| + 2.Functionality provided..................|syntastic-functionality| + 2.1.The statusline flag...............|syntastic-statusline-flag| + 2.2.Error signs.......................|syntastic-error-signs| + 2.3.Error window......................|syntastic-error-window| + 3.Commands................................|syntastic-commands| + 4.Global Options..........................|syntastic-global-options| + 5.Checker Options.........................|syntastic-checker-options| + 6.About...................................|syntastic-about| + 7.License.................................|syntastic-license| + + +============================================================================== +1. Intro *syntastic-intro* + +Note: This doc only deals with using syntastic. To learn how to write syntax +checker integrations, see the guide on the github wiki: + + https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide + +Syntastic is a syntax checking plugin that runs files through external syntax +checkers. This can be done on demand, or automatically as files are saved and +opened. If syntax errors are detected, the user is notified and is happy +because they didn't have to compile their code or execute their script to find +them. + +Syntastic comes in two parts: the syntax checker plugins, and the core. The +syntax checker plugins are defined on a per-filetype basis where each one wraps +up an external syntax checking program. The core script delegates off to these +plugins and uses their output to provide the syntastic functionality. + +Take a look in the syntax_checkers directory for a list of supported filetypes +and checkers. + + +============================================================================== +2. Functionality provided *syntastic-functionality* + +Syntax checking can be done automatically or on demand (see +|'syntastic_mode_map'| for configuring this). + +When syntax checking is done, the features below can be used to notify the +user of errors. See |syntastic-options| for how to configure and +activate/deactivate these features. + + * A statusline flag + * Signs beside lines with errors + * The |location-list| can be populated with the errors for the associated + buffer. + * Erroneous parts of lines can be highlighted (this functionality is only + provided by some syntax checkers). + * Balloons (if compiled in) can be used to display error messages for + erroneous lines when hovering the mouse over them. + + +------------------------------------------------------------------------------ +2.1. The statusline flag *syntastic-statusline-flag* + +To use the statusline flag, this must appear in your |'statusline'| setting > + %{SyntasticStatuslineFlag()} +< +Something like this could be more useful: > + set statusline+=%#warningmsg# + set statusline+=%{SyntasticStatuslineFlag()} + set statusline+=%* +< +When syntax errors are detected a flag will be shown. The content of the flag +is derived from the |syntastic_stl_format| option +------------------------------------------------------------------------------ +2.2. Error signs *syntastic-error-signs* + +Syntastic uses the |:sign| commands to mark lines with errors and warnings in +the sign column. To enable this feature, use the |'syntastic_enable_signs'| +option. + +Signs are colored using the Error and Todo syntax highlight groups by default. +If you wish to customize the colors for the signs, you can use the following +groups: + SyntasticErrorSign - For syntax errors, links to 'error' by default + SyntasticWarningSign - For syntax warnings, links to 'todo' by default + SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign' + by default + SyntasticStyleWarningSign - For style warnings, links to + 'SyntasticWarningSign' by default + +Example: > + highlight SyntasticErrorSign guifg=white guibg=red +< +To set up highlighting for the line where a sign resides, you can use the +following highlight groups: + SyntasticErrorLine + SyntasticWarningLine + SyntasticStyleErrorLine - Links to 'SyntasticErrorLine' by default + SyntasticStyleWarningLine - Links to 'SyntasticWarningLine' by default + +Example: > + highlight SyntasticErrorLine guibg=#2f0000 +< + +------------------------------------------------------------------------------ +2.3. The error window *:Errors* *syntastic-error-window* + +You can use the :Errors command to display the errors for the current buffer +in the |location-list|. + +Note that when you use :Errors, the current location list is overwritten with +Syntastic's own location list. + + +============================================================================== +3. Commands *syntastic-commands* + +:Errors *:SyntasticErrors* + +When errors have been detected, use this command to pop up the |location-list| +and display the error messages. + + +:SyntasticToggleMode *:SyntasticToggleMode* + +Toggles syntastic between active and passive mode. See |'syntastic_mode_map'| +for more info. + + +:SyntasticCheck *:SyntasticCheck* + +Manually cause a syntax check to be done. Useful in passive mode, or if the +current filetype is set to passive. See |'syntastic_mode_map'| for more info. + +:SyntasticInfo *:SyntasticInfo* + +Output info about what checkers are available and in use for the current +filetype. + + +============================================================================== +4. Global Options *syntastic-global-options* + + + *'syntastic_check_on_open'* +Default: 0 +If enabled, syntastic will do syntax checks when buffers are first loaded as +well as on saving > + let g:syntastic_check_on_open=1 +< + + *'syntastic_check_on_wq'* +Default: 1 +Normally syntastic runs syntax checks whenever buffers are written to disk. +If you want to skip these checks when you issue |:wq|, |:x|, and |:ZZ|, set this +variable to 0. > + let g:syntastic_check_on_wq=0 +< + + *'syntastic_echo_current_error'* +Default: 1 +If enabled, syntastic will echo the error associated with the current line to +the command window. If multiple errors are found, the first will be used. > + let g:syntastic_echo_current_error=1 +< + + *'syntastic_enable_signs'* +Default: 1 +Use this option to tell syntastic whether to use the |:sign| interface to mark +syntax errors: > + let g:syntastic_enable_signs=1 +< + + *'syntastic_error_symbol'* *'syntastic_style_error_symbol'* + *'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'* +Use this option to control what the syntastic |:sign| text contains. Several +error symobls can be customized: + syntastic_error_symbol - For syntax errors, defaults to '>>' + syntastic_style_error_symbol - For style errors, defaults to 'S>' + syntastic_warning_symbol - For syntax warnings, defaults to '>>' + syntastic_style_warning_symbol - For style warnings, defaults to 'S>' + +Example: > + let g:syntastic_error_symbol='✗' + let g:syntastic_warning_symbol='⚠' +< + + *'syntastic_enable_balloons'* +Default: 1 +Use this option to tell syntastic whether to display error messages in balloons +when the mouse is hovered over erroneous lines: > + let g:syntastic_enable_balloons = 1 +< +Note that vim must be compiled with |+balloon_eval|. + + *'syntastic_enable_highlighting'* +Default: 1 +Use this option to tell syntastic whether to use syntax highlighting to mark +errors (where possible). Highlighting can be turned off with the following > + let g:syntastic_enable_highlighting = 0 +< + + *'syntastic_always_populate_loc_list'* +Default: 0 +Enable this option to tell syntastic to always stick any detected errors into +the loclist: > + let g:syntastic_always_populate_loc_list=1 +< + *'syntastic_auto_jump'* +Default: 0 +Enable this option if you want the cursor to jump to the first detected error +when saving or opening a file: > + let g:syntastic_auto_jump=1 +< + + *'syntastic_auto_loc_list'* +Default: 2 +Use this option to tell syntastic to automatically open and/or close the +|location-list| (see |syntastic-error-window|). + +When set to 0 the error window will not be opened or closed automatically. > + let g:syntastic_auto_loc_list=0 +< + +When set to 1 the error window will be automatically opened when errors are +detected, and closed when none are detected. > + let g:syntastic_auto_loc_list=1 +< +When set to 2 the error window will be automatically closed when no errors are +detected, but not opened automatically. > + let g:syntastic_auto_loc_list=2 +< + + *'syntastic_loc_list_height'* +Default: 10 +Use this option to specify the height of the location lists that syntastic +opens. > + let g:syntastic_loc_list_height=5 +< + + *'syntastic_ignore_files'* +Default: [] +Use this option to specify files that syntastic should neither check, nor +include in error lists. It has to be a list of |regular-expression| patterns. +The full paths of files (see |::p|) are matched against these patterns, and +the matches are case sensitive. Use |\c| if you need case insensitive +patterns. > + let g:syntastic_ignore_files=['^/usr/include/', '\c\.h$'] +< + + *'syntastic_filetype_map'* +Default: {} +Use this option to map non-standard filetypes to standard ones. Corresponding +checkers are mapped accordingly, which allows syntastic to check files with +non-standard filetypes: > + let g:syntastic_filetype_map = { 'latex': 'tex', + \ 'gentoo-metadata': 'xml' } +< + + *'syntastic_mode_map'* +Default: { "mode": "active", + "active_filetypes": [], + "passive_filetypes": [] } + +Use this option to fine tune when automatic syntax checking is done (or not +done). + +The option should be set to something like: > + + let g:syntastic_mode_map = { 'mode': 'active', + \ 'active_filetypes': ['ruby', 'php'], + \ 'passive_filetypes': ['puppet'] } +< + +"mode" can be mapped to one of two values - "active" or "passive". When set to +active, syntastic does automatic checking whenever a buffer is saved or +initially opened. When set to "passive" syntastic only checks when the user +calls :SyntasticCheck. + +The exceptions to these rules are defined with "active_filetypes" and +"passive_filetypes". In passive mode, automatic checks are still done +for all filetypes in the "active_filetypes" array. In active mode, +automatic checks are not done for any filetypes in the +"passive_filetypes" array. + +At runtime, the |:SyntasticToggleMode| command can be used to switch between +active and passive mode. + +If any of "mode", "active_filetypes", or "passive_filetypes" are not specified +then they will default to their default value as above. + + *'syntastic_quiet_warnings'* + +Use this option if you only care about syntax errors, not warnings. When set, +this option has the following effects: + * no |signs| appear unless there is at least one error, whereupon both + errors and warnings are displayed + * the |'syntastic_auto_loc_list'| option only pops up the error window if + there's at least one error, whereupon both errors and warnings are + displayed +> + let g:syntastic_quiet_warnings=1 +< + + *'syntastic_stl_format'* + +Default: [Syntax: line:%F (%t)] +Use this option to control what the syntastic statusline text contains. Several +magic flags are available to insert information: + %e - number of errors + %w - number of warnings + %t - total number of warnings and errors + %fe - line number of first error + %fw - line number of first warning + %F - line number of first warning or error + +Several additional flags are available to hide text under certain conditions: + %E{...} - hide the text in the brackets unless there are errors + %W{...} - hide the text in the brackets unless there are warnings + %B{...} - hide the text in the brackets unless there are both warnings AND + errors +These flags cant be nested. + +Example: > + let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]' +< +If this format is used and the current buffer has 5 errors and 1 warning +starting on lines 20 and 10 respectively then this would appear on the +statusline: > + [Err: 20 #5, Warn: 10 #1] +< +If the buffer had 2 warnings, starting on line 5 then this would appear: > + [Warn: 5 #2] +< + *'syntastic_full_redraws'* +Default: 0 in GUI Vim and MacVim, 1 otherwise +Controls whether syntastic calls |:redraw| or |:redraw!| for screen redraws. +Changing it can in principle make screen redraws smoother, but it can also +cause screen flicker, or ghost characters. Leaving it to the default should +be safe. + + *'syntastic_debug'* +Default: 0 +Set this to 1 to enable debugging: > + let g:syntastic_debug = 1 +< +Checkers will then add debugging messages to Vim's |message-history|. You can +examine these messages with |:mes|. + + +============================================================================== +5. Checker Options *syntastic-checker-options* + +------------------------------------------------------------------------------ +5.1 Telling syntastic which checker to use. + +Stick a line like this in your vimrc: > + let g:syntastic__checkers = [''] +< +e.g. > + let g:syntastic_python_checkers = ['flake8'] +< + +There's also a per-buffer version of this setting, b:syntastic_checkers. Use +this in an autocmd to configure specific checkers for particular paths: > + autocmd FileType python if stridx(expand('%:p'), '/some/path/') == 0 | + \ let b:syntastic_checkers = ['pylint'] | endif +< + +To see the list of available checkers for your filetype, look in +`syntax_checkers//`. The names of the files here correspond to +'' above. + +e.g. Python has the following checkers: flake8, pyflakes, pylint and a +native python checker. + +Some filetypes, like PHP, have style checkers as well as syntax checkers. These +can be chained together like this: > + let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']` +< +This is telling syntastic to run the 'php' checker first, and if no errors are +found, run 'phpcs', and then 'phpmd'. + +------------------------------------------------------------------------------ +5.2 Configuring specific checkers *syntastic-config-makeprg* + +Most checkers use the 'syntastic#makeprg#build()' function and provide many +options by default - in fact you can customise every part of the command +that gets called. + +Checkers that use 'syntastic#makeprg#build()' look like this: > + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'ruby', + \ 'args': '-a -b -c', + \ 'post_args': '--more --args', + \ 'tail': '> /tmp/output', + \ 'filetype': 'ruby', + \ 'subchecker': 'mri' }) +< + +The 'filetype' and 'subchecker' parameters are mandatory. All of the other +parameters above are optional (well, you probably need at least 'exe'), and +can be overriden by setting global variables - even parameters not specified +in the call to syntastic#makeprg#build(). + +E.g. To override the checker exe above, you could do this: > + let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb" +< +To override the args and the tail: > + let g:syntastic_ruby_mri_args="--my --args --here" + let g:syntastic_ruby_mri_tail="> /tmp/my-output-file-biatch" +< + +The general form of the override options is: > + syntastic_[filetype]_[subchecker]_[option-name] +< + +For checkers that do not use the 'syntastic#makeprg#build()' function you +will have to look at the source code of the checker in question. If there are +specific options that can be set, these are usually documented at the top of +the script. + +============================================================================== +6. About *syntastic-about* + +The core maintainers of syntastic are: + Martin Grenfell (github: scrooloose) + Gregor Uhlenheuer (github: kongo2002) + +Find the latest version of syntastic here: + http://github.com/scrooloose/syntastic + +============================================================================== +7. License *syntastic-license* + +Syntastic is released under the wtfpl. +See http://sam.zoy.org/wtfpl/COPYING. + + vim:tw=78:sw=4:ft=help:norl: diff --git a/sources_non_forked/syntastic/plugin/syntastic.vim b/sources_non_forked/syntastic/plugin/syntastic.vim new file mode 100644 index 00000000..b603149a --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic.vim @@ -0,0 +1,423 @@ +"============================================================================ +"File: syntastic.vim +"Description: Vim plugin for on the fly syntax checking. +"Version: 3.0.0 +"Released On: 13 April, 2013 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_plugin") + finish +endif +let g:loaded_syntastic_plugin = 1 + +runtime! plugin/syntastic/*.vim + +let s:running_windows = has("win16") || has("win32") + +if !exists("g:syntastic_always_populate_loc_list") + let g:syntastic_always_populate_loc_list = 0 +endif + +if !exists("g:syntastic_auto_jump") + let g:syntastic_auto_jump = 0 +endif + +if !exists("g:syntastic_quiet_warnings") + let g:syntastic_quiet_warnings = 0 +endif + +if !exists("g:syntastic_stl_format") + let g:syntastic_stl_format = '[Syntax: line:%F (%t)]' +endif + +if !exists("g:syntastic_check_on_open") + let g:syntastic_check_on_open = 0 +endif + +if !exists("g:syntastic_check_on_wq") + let g:syntastic_check_on_wq = 1 +endif + +if !exists("g:syntastic_loc_list_height") + let g:syntastic_loc_list_height = 10 +endif + +if !exists("g:syntastic_ignore_files") + let g:syntastic_ignore_files = [] +endif + +if !exists("g:syntastic_filetype_map") + let g:syntastic_filetype_map = {} +endif + +if !exists("g:syntastic_full_redraws") + let g:syntastic_full_redraws = !( has('gui_running') || has('gui_macvim')) +endif + +let s:registry = g:SyntasticRegistry.Instance() +let s:notifiers = g:SyntasticNotifiers.Instance() +let s:modemap = g:SyntasticModeMap.Instance() + +function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) + let checker_names = [] + for ft in s:CurrentFiletypes() + for checker in s:registry.availableCheckersFor(ft) + call add(checker_names, checker.getName()) + endfor + endfor + return join(checker_names, "\n") +endfunction + +command! SyntasticToggleMode call s:ToggleMode() +command! -nargs=? -complete=custom,s:CompleteCheckerName SyntasticCheck call s:UpdateErrors(0, ) call s:Redraw() +command! Errors call s:ShowLocList() +command! SyntasticInfo call s:registry.echoInfoFor(s:CurrentFiletypes()) + +highlight link SyntasticError SpellBad +highlight link SyntasticWarning SpellCap + +augroup syntastic + autocmd BufReadPost * if g:syntastic_check_on_open | call s:UpdateErrors(1) | endif + autocmd BufWritePost * call s:UpdateErrors(1) + + autocmd BufWinEnter * call s:BufWinEnterHook() + + " TODO: the next autocmd should be "autocmd BufWinLeave * if empty(&bt) | lclose | endif" + " but in recent versions of Vim lclose can no longer be called from BufWinLeave + autocmd BufEnter * call s:BufEnterHook() +augroup END + +if v:version > 703 || (v:version == 703 && has('patch544')) + " QuitPre was added in Vim 7.3.544 + augroup syntastic + autocmd QuitPre * call s:QuitPreHook() + augroup END +endif + + +function! s:BufWinEnterHook() + if empty(&bt) + let loclist = g:SyntasticLoclist.current() + call s:notifiers.refresh(loclist) + endif +endfunction + +function! s:BufEnterHook() + " TODO: at this point there is no b:syntastic_loclist + let loclist = filter(getloclist(0), 'v:val["valid"] == 1') + let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' )) + if &bt=='quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' )) + call g:SyntasticLoclistHide() + endif +endfunction + + +function! s:QuitPreHook() + let b:syntastic_skip_checks = !g:syntastic_check_on_wq + call g:SyntasticLoclistHide() +endfunction + +"refresh and redraw all the error info for this buf when saving or reading +function! s:UpdateErrors(auto_invoked, ...) + if s:SkipFile() + return + endif + + let run_checks = !a:auto_invoked || s:modemap.allowsAutoChecking(&filetype) + if run_checks + if a:0 >= 1 + call s:CacheErrors(a:1) + else + call s:CacheErrors() + endif + end + + let loclist = g:SyntasticLoclist.current() + + if g:syntastic_always_populate_loc_list || g:syntastic_auto_jump + call setloclist(0, loclist.filteredRaw()) + if run_checks && g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay() + silent! lrewind + endif + endif + + call s:notifiers.refresh(loclist) +endfunction + +"clear the loc list for the buffer +function! s:ClearCache() + call s:notifiers.reset(g:SyntasticLoclist.current()) + unlet! b:syntastic_loclist +endfunction + +function! s:CurrentFiletypes() + return split(&filetype, '\.') +endfunction + +"detect and cache all syntax errors in this buffer +function! s:CacheErrors(...) + call s:ClearCache() + let newLoclist = g:SyntasticLoclist.New([]) + + if !s:SkipFile() + let active_checkers = 0 + for ft in s:CurrentFiletypes() + if a:0 + let checker = s:registry.getChecker(ft, a:1) + let checkers = !empty(checker) ? [checker] : [] + else + let checkers = s:registry.getActiveCheckers(ft) + endif + + for checker in checkers + let active_checkers += 1 + call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.getName()) + + let loclist = checker.getLocList() + + if !loclist.isEmpty() + let newLoclist = newLoclist.extend(loclist) + call newLoclist.setName( checker.getName() . ' ('. checker.getFiletype() . ')' ) + + "only get errors from one checker at a time + break + endif + endfor + endfor + + if !active_checkers + if a:0 + call syntastic#util#warn('checker ' . a:1 . ' is not active for filetype ' . &filetype) + else + call syntastic#util#debug('no active checkers for filetype ' . &filetype) + endif + endif + endif + + let b:syntastic_loclist = newLoclist +endfunction + +function! s:ToggleMode() + call s:modemap.toggleMode() + call s:ClearCache() + call s:UpdateErrors(1) + call s:modemap.echoMode() +endfunction + +"display the cached errors for this buf in the location list +function! s:ShowLocList() + let loclist = g:SyntasticLoclist.current() + call loclist.show() +endfunction + +"the script changes &shellpipe and &shell to stop the screen flicking when +"shelling out to syntax checkers. Not all OSs support the hacks though +function! s:OSSupportsShellpipeHack() + return !s:running_windows && executable('/bin/bash') && (s:uname() !~ "FreeBSD") && (s:uname() !~ "OpenBSD") +endfunction + +function! s:IsRedrawRequiredAfterMake() + return !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD") +endfunction + +"Redraw in a way that doesnt make the screen flicker or leave anomalies behind. +" +"Some terminal versions of vim require `redraw!` - otherwise there can be +"random anomalies left behind. +" +"However, on some versions of gvim using `redraw!` causes the screen to +"flicker - so use redraw. +function! s:Redraw() + if g:syntastic_full_redraws + redraw! + else + redraw + endif +endfunction + +function! s:IgnoreFile(filename) + let fname = fnamemodify(a:filename, ':p') + for p in g:syntastic_ignore_files + if fname =~# p + return 1 + endif + endfor + return 0 +endfunction + +" Skip running in special buffers +function! s:SkipFile() + let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0 + let fname = expand('%') + return force_skip || !empty(&buftype) || !filereadable(fname) || getwinvar(0, '&diff') || s:IgnoreFile(fname) +endfunction + +function! s:uname() + if !exists('s:uname') + let s:uname = system('uname') + endif + return s:uname +endfunction + +"return a string representing the state of buffer according to +"g:syntastic_stl_format +" +"return '' if no errors are cached for the buffer +function! SyntasticStatuslineFlag() + let loclist = g:SyntasticLoclist.current() + let issues = loclist.filteredRaw() + let num_issues = loclist.getLength() + if loclist.hasErrorsOrWarningsToDisplay() + let errors = loclist.errors() + let warnings = loclist.warnings() + + let num_errors = len(errors) + let num_warnings = len(warnings) + + let output = g:syntastic_stl_format + + "hide stuff wrapped in %E(...) unless there are errors + let output = substitute(output, '\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g') + + "hide stuff wrapped in %W(...) unless there are warnings + let output = substitute(output, '\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g') + + "hide stuff wrapped in %B(...) unless there are both errors and warnings + let output = substitute(output, '\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g') + + + "sub in the total errors/warnings/both + let output = substitute(output, '\C%w', num_warnings, 'g') + let output = substitute(output, '\C%e', num_errors, 'g') + let output = substitute(output, '\C%t', num_issues, 'g') + + "first error/warning line num + let output = substitute(output, '\C%F', num_issues ? issues[0]['lnum'] : '', 'g') + + "first error line num + let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g') + + "first warning line num + let output = substitute(output, '\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g') + + return output + else + return '' + endif +endfunction + +"A wrapper for the :lmake command. Sets up the make environment according to +"the options given, runs make, resets the environment, returns the location +"list +" +"a:options can contain the following keys: +" 'makeprg' +" 'errorformat' +" +"The corresponding options are set for the duration of the function call. They +"are set with :let, so dont escape spaces. +" +"a:options may also contain: +" 'defaults' - a dict containing default values for the returned errors +" 'subtype' - all errors will be assigned the given subtype +" 'postprocess' - a list of functions to be applied to the error list +" 'cwd' - change directory to the given path before running the checker +" 'returns' - a list of valid exit codes for the checker +function! SyntasticMake(options) + call syntastic#util#debug('SyntasticMake: called with options: '. string(a:options)) + + let old_loclist = getloclist(0) + let old_makeprg = &l:makeprg + let old_shellpipe = &shellpipe + let old_shell = &shell + let old_errorformat = &l:errorformat + let old_cwd = getcwd() + let old_lc_all = $LC_ALL + + if s:OSSupportsShellpipeHack() + "this is a hack to stop the screen needing to be ':redraw'n when + "when :lmake is run. Otherwise the screen flickers annoyingly + let &shellpipe='&>' + let &shell = '/bin/bash' + endif + + if has_key(a:options, 'makeprg') + let &l:makeprg = a:options['makeprg'] + endif + + if has_key(a:options, 'errorformat') + let &l:errorformat = a:options['errorformat'] + endif + + if has_key(a:options, 'cwd') + exec 'lcd ' . fnameescape(a:options['cwd']) + endif + + let $LC_ALL = 'C' + silent lmake! + let $LC_ALL = old_lc_all + + let errors = getloclist(0) + + if has_key(a:options, 'cwd') + exec 'lcd ' . fnameescape(old_cwd) + endif + + call setloclist(0, old_loclist) + let &l:makeprg = old_makeprg + let &l:errorformat = old_errorformat + let &shellpipe=old_shellpipe + let &shell=old_shell + + if s:IsRedrawRequiredAfterMake() + call s:Redraw() + endif + + if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1 + throw 'Syntastic: checker error' + endif + + if has_key(a:options, 'defaults') + call SyntasticAddToErrors(errors, a:options['defaults']) + endif + + " Apply ignore patterns + let ignore = {} + for buf in syntastic#util#unique(map(copy(errors), 'v:val["bufnr"]')) + let ignore[buf] = s:IgnoreFile(bufname(str2nr(buf))) + endfor + call filter(errors, '!ignore[v:val["bufnr"]]') + + " Add subtype info if present. + if has_key(a:options, 'subtype') + call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']}) + endif + + if has_key(a:options, 'postprocess') && !empty(a:options['postprocess']) + for rule in a:options['postprocess'] + let errors = call('syntastic#postprocess#' . rule, [errors]) + endfor + endif + + return errors +endfunction + +"take a list of errors and add default values to them from a:options +function! SyntasticAddToErrors(errors, options) + for i in range(0, len(a:errors)-1) + for key in keys(a:options) + if !has_key(a:errors[i], key) || empty(a:errors[i][key]) + let a:errors[i][key] = a:options[key] + endif + endfor + endfor + return a:errors +endfunction + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim b/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim new file mode 100644 index 00000000..9a1a018f --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim @@ -0,0 +1,38 @@ +if exists("g:loaded_syntastic_notifier_autoloclist") + finish +endif +let g:loaded_syntastic_notifier_autoloclist = 1 + +if !exists("g:syntastic_auto_loc_list") + let g:syntastic_auto_loc_list = 2 +endif + +let g:SyntasticAutoloclistNotifier = {} + +" Public methods {{{1 +" +function! g:SyntasticAutoloclistNotifier.New() + let newObj = copy(self) + return newObj +endfunction + +function! g:SyntasticAutoloclistNotifier.refresh(loclist) + call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist) +endfunction + +function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) + if a:loclist.hasErrorsOrWarningsToDisplay() + if g:syntastic_auto_loc_list == 1 + call a:loclist.show() + endif + else + if g:syntastic_auto_loc_list > 0 + + "TODO: this will close the loc list window if one was opened by + "something other than syntastic + lclose + endif + endif +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/balloons.vim b/sources_non_forked/syntastic/plugin/syntastic/balloons.vim new file mode 100644 index 00000000..f6e60418 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/balloons.vim @@ -0,0 +1,64 @@ +if exists("g:loaded_syntastic_notifier_balloons") + finish +endif +let g:loaded_syntastic_notifier_balloons = 1 + +if !exists("g:syntastic_enable_balloons") + let g:syntastic_enable_balloons = 1 +endif + +if !has('balloon_eval') + let g:syntastic_enable_balloons = 0 +endif + +let g:SyntasticBalloonsNotifier = {} + +" Public methods {{{1 + +function! g:SyntasticBalloonsNotifier.New() + let newObj = copy(self) + return newObj +endfunction + +function! g:SyntasticBalloonsNotifier.enabled() + return + \ has('balloon_eval') && + \ (exists('b:syntastic_enable_balloons') ? b:syntastic_enable_balloons : g:syntastic_enable_balloons) +endfunction + +" Update the error balloons +function! g:SyntasticBalloonsNotifier.refresh(loclist) + let b:syntastic_balloons = {} + if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay() + let buf = bufnr('') + let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf') + if !empty(issues) + for i in issues + if has_key(b:syntastic_balloons, i['lnum']) + let b:syntastic_balloons[i['lnum']] .= "\n" . i['text'] + else + let b:syntastic_balloons[i['lnum']] = i['text'] + endif + endfor + set beval bexpr=SyntasticBalloonsExprNotifier() + endif + endif +endfunction + +" Reset the error balloons +function! g:SyntasticBalloonsNotifier.reset(loclist) + if has('balloon_eval') + set nobeval + endif +endfunction + +" Private functions {{{1 + +function! SyntasticBalloonsExprNotifier() + if !exists('b:syntastic_balloons') + return '' + endif + return get(b:syntastic_balloons, v:beval_lnum, '') +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/checker.vim b/sources_non_forked/syntastic/plugin/syntastic/checker.vim new file mode 100644 index 00000000..3ab1d212 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/checker.vim @@ -0,0 +1,79 @@ +if exists("g:loaded_syntastic_checker") + finish +endif +let g:loaded_syntastic_checker = 1 + +let g:SyntasticChecker = {} + +" Public methods {{{1 + +function! g:SyntasticChecker.New(args) + let newObj = copy(self) + + let newObj._filetype = a:args['filetype'] + let newObj._name = a:args['name'] + + + let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_' + let newObj._locListFunc = function(prefix . 'GetLocList') + let newObj._isAvailableFunc = function(prefix . 'IsAvailable') + + if exists('*' . prefix . 'GetHighlightRegex') + let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex') + else + let newObj._highlightRegexFunc = '' + endif + + return newObj +endfunction + +function! g:SyntasticChecker.getFiletype() + return self._filetype +endfunction + +function! g:SyntasticChecker.getName() + return self._name +endfunction + +function! g:SyntasticChecker.getLocList() + try + let list = self._locListFunc() + call syntastic#util#debug('getLocList: checker ' . self._filetype . '/' . self._name . ' returned ' . v:shell_error) + catch /\m\C^Syntastic: checker error$/ + let list = [] + call syntastic#util#error('checker ' . self._filetype . '/' . self._name . ' returned abnormal status ' . v:shell_error) + endtry + call self._populateHighlightRegexes(list) + return g:SyntasticLoclist.New(list) +endfunction + +function! g:SyntasticChecker.getHighlightRegexFor(error) + if empty(self._highlightRegexFunc) + return [] + endif + + return self._highlightRegexFunc(error) +endfunction + +function! g:SyntasticChecker.isAvailable() + return self._isAvailableFunc() +endfunction + +" Private methods {{{1 + +function! g:SyntasticChecker._populateHighlightRegexes(list) + let list = a:list + if !empty(self._highlightRegexFunc) + for i in range(0, len(list)-1) + if list[i]['valid'] + let term = self._highlightRegexFunc(list[i]) + if len(term) > 0 + let list[i]['hl'] = term + endif + endif + endfor + endif + return list +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/cursor.vim b/sources_non_forked/syntastic/plugin/syntastic/cursor.vim new file mode 100644 index 00000000..77f97dc5 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/cursor.vim @@ -0,0 +1,63 @@ +if exists("g:loaded_syntastic_notifier_cursor") + finish +endif +let g:loaded_syntastic_notifier_cursor = 1 + +if !exists('g:syntastic_echo_current_error') + let g:syntastic_echo_current_error = 1 +endif + +let g:SyntasticCursorNotifier = {} + +" Public methods {{{1 + +function! g:SyntasticCursorNotifier.New() + let newObj = copy(self) + return newObj +endfunction + +function! g:SyntasticCursorNotifier.enabled() + return exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error +endfunction + +function! g:SyntasticCursorNotifier.refresh(loclist) + if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay() + let b:syntastic_messages = copy(a:loclist.messages(bufnr(''))) + let b:oldLine = -1 + autocmd! syntastic CursorMoved + autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor() + endif +endfunction + +function! g:SyntasticCursorNotifier.reset(loclist) + autocmd! syntastic CursorMoved + unlet! b:syntastic_messages + let b:oldLine = -1 +endfunction + +" Private methods {{{1 + +" The following defensive nonsense is needed because of the nature of autocmd +function! g:SyntasticRefreshCursor() + if !exists('b:syntastic_messages') || empty(b:syntastic_messages) + " file not checked + return + endif + + if !exists('b:oldLine') + let b:oldLine = -1 + endif + let l = line('.') + if l == b:oldLine + return + endif + let b:oldLine = l + + if has_key(b:syntastic_messages, l) + call syntastic#util#wideMsg(b:syntastic_messages[l]) + else + echo + endif +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/highlighting.vim b/sources_non_forked/syntastic/plugin/syntastic/highlighting.vim new file mode 100644 index 00000000..e04e6cc5 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/highlighting.vim @@ -0,0 +1,66 @@ +if exists("g:loaded_syntastic_notifier_highlighting") + finish +endif +let g:loaded_syntastic_notifier_highlighting = 1 + +" Highlighting requires getmatches introduced in 7.1.040 +let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040')) + +if !exists("g:syntastic_enable_highlighting") + let g:syntastic_enable_highlighting = 1 +endif + +let g:SyntasticHighlightingNotifier = {} + +" Public methods {{{1 + +function! g:SyntasticHighlightingNotifier.New() + let newObj = copy(self) + return newObj +endfunction + +function! g:SyntasticHighlightingNotifier.enabled() + return + \ s:has_highlighting && + \ (exists('b:syntastic_enable_highlighting') ? b:syntastic_enable_highlighting : g:syntastic_enable_highlighting) +endfunction + +" Sets error highlights in the cuirrent window +function! g:SyntasticHighlightingNotifier.refresh(loclist) + if self.enabled() + call self.reset(a:loclist) + let buf = bufnr('') + let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf') + for item in issues + let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning' + + " The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is + " used to override default highlighting. + if has_key(item, 'hl') + call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl']) + elseif get(item, 'col') + let lastcol = col([item['lnum'], '$']) + let lcol = min([lastcol, item['col']]) + + " a bug in vim can sometimes cause there to be no 'vcol' key, + " so check for its existence + let coltype = has_key(item, 'vcol') && item['vcol'] ? 'v' : 'c' + + call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype) + endif + endfor + endif +endfunction + +" Remove all error highlights from the window +function! g:SyntasticHighlightingNotifier.reset(loclist) + if s:has_highlighting + for match in getmatches() + if stridx(match['group'], 'Syntastic') == 0 + call matchdelete(match['id']) + endif + endfor + endif +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/loclist.vim b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim new file mode 100644 index 00000000..d5cd6e39 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim @@ -0,0 +1,173 @@ +if exists("g:loaded_syntastic_loclist") + finish +endif +let g:loaded_syntastic_loclist = 1 + +let g:SyntasticLoclist = {} + +" Public methods {{{1 + +function! g:SyntasticLoclist.New(rawLoclist) + let newObj = copy(self) + let newObj._quietWarnings = g:syntastic_quiet_warnings + + let llist = copy(a:rawLoclist) + let llist = filter(llist, 'v:val["valid"] == 1') + + for e in llist + if empty(e['type']) + let e['type'] = 'E' + endif + endfor + + let newObj._rawLoclist = llist + let newObj._hasErrorsOrWarningsToDisplay = -1 + + let newObj._name = '' + + return newObj +endfunction + +function! g:SyntasticLoclist.current() + if !exists("b:syntastic_loclist") + let b:syntastic_loclist = g:SyntasticLoclist.New([]) + endif + return b:syntastic_loclist +endfunction + +function! g:SyntasticLoclist.extend(other) + let list = self.toRaw() + call extend(list, a:other.toRaw()) + return g:SyntasticLoclist.New(list) +endfunction + +function! g:SyntasticLoclist.toRaw() + return copy(self._rawLoclist) +endfunction + +function! g:SyntasticLoclist.filteredRaw() + return copy(self._quietWarnings ? self.errors() : self._rawLoclist) +endfunction + +function! g:SyntasticLoclist.quietWarnings() + return self._quietWarnings +endfunction + +function! g:SyntasticLoclist.isEmpty() + return empty(self._rawLoclist) +endfunction + +function! g:SyntasticLoclist.getLength() + return len(self._rawLoclist) +endfunction + +function! g:SyntasticLoclist.getName() + return len(self._name) +endfunction + +function! g:SyntasticLoclist.setName(name) + let self._name = a:name +endfunction + +function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay() + if self._hasErrorsOrWarningsToDisplay >= 0 + return self._hasErrorsOrWarningsToDisplay + endif + let self._hasErrorsOrWarningsToDisplay = empty(self._rawLoclist) ? 0 : (!self._quietWarnings || len(self.errors())) + return self._hasErrorsOrWarningsToDisplay +endfunction + +function! g:SyntasticLoclist.errors() + if !exists("self._cachedErrors") + let self._cachedErrors = self.filter({'type': "E"}) + endif + return self._cachedErrors +endfunction + +function! g:SyntasticLoclist.warnings() + if !exists("self._cachedWarnings") + let self._cachedWarnings = self.filter({'type': "W"}) + endif + return self._cachedWarnings +endfunction + +" cache used by EchoCurrentError() +function! g:SyntasticLoclist.messages(buf) + if !exists("self._cachedMessages") + let self._cachedMessages = {} + let errors = self.errors() + (self._quietWarnings ? [] : self.warnings()) + + for e in errors + let b = e['bufnr'] + let l = e['lnum'] + + if !has_key(self._cachedMessages, b) + let self._cachedMessages[b] = {} + endif + + if !has_key(self._cachedMessages[b], l) + let self._cachedMessages[b][l] = e['text'] + endif + endfor + endif + + return get(self._cachedMessages, a:buf, {}) +endfunction + +"Filter the list and return new native loclist +"e.g. +" .filter({'bufnr': 10, 'type': 'e'}) +" +"would return all errors for buffer 10. +" +"Note that all comparisons are done with ==? +function! g:SyntasticLoclist.filter(filters) + let rv = [] + + for error in self._rawLoclist + + let passes_filters = 1 + for key in keys(a:filters) + if error[key] !=? a:filters[key] + let passes_filters = 0 + break + endif + endfor + + if passes_filters + call add(rv, error) + endif + endfor + return rv +endfunction + +"display the cached errors for this buf in the location list +function! g:SyntasticLoclist.show() + call setloclist(0, self.filteredRaw()) + if self.hasErrorsOrWarningsToDisplay() + let num = winnr() + exec "lopen " . g:syntastic_loc_list_height + if num != winnr() + wincmd p + endif + + " try to find the loclist window and set w:quickfix_title + for buf in tabpagebuflist() + if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix' + let win = bufwinnr(buf) + let title = getwinvar(win, 'quickfix_title') + if title ==# ':setloclist()' || strpart(title, 0, 16) ==# ':SyntasticCheck ' + call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name) + endif + endif + endfor + endif +endfunction + +" Non-method functions {{{1 + +function! g:SyntasticLoclistHide() + silent! lclose +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/makeprg_builder.vim b/sources_non_forked/syntastic/plugin/syntastic/makeprg_builder.vim new file mode 100644 index 00000000..ef77efa9 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/makeprg_builder.vim @@ -0,0 +1,72 @@ +if exists("g:loaded_syntastic_makeprg_builder") + finish +endif +let g:loaded_syntastic_makeprg_builder = 1 + +let g:SyntasticMakeprgBuilder = {} + +" Public methods {{{1 + +function! g:SyntasticMakeprgBuilder.New(exe, args, fname, post_args, tail, filetype, subchecker) + let newObj = copy(self) + let newObj._exe = a:exe + let newObj._args = a:args + let newObj._fname = a:fname + let newObj._post_args = a:post_args + let newObj._tail = a:tail + let newObj._filetype = empty(a:filetype) ? &filetype : a:filetype + let newObj._subchecker = a:subchecker + return newObj +endfunction + +function! g:SyntasticMakeprgBuilder.makeprg() + return join([self.exe(), self.args(), self.fname(), self.post_args(), self.tail()]) +endfunction + +function! g:SyntasticMakeprgBuilder.exe() + return self._getOpt('exe') +endfunction + +function! g:SyntasticMakeprgBuilder.args() + return self._getOpt('args') +endfunction + +function! g:SyntasticMakeprgBuilder.fname() + if empty(self._fname) + return syntastic#util#shexpand('%') + else + return self._fname + endif +endfunction + +function! g:SyntasticMakeprgBuilder.post_args() + return self._getOpt('post_args') +endfunction + +function! g:SyntasticMakeprgBuilder.tail() + return self._getOpt('tail') +endfunction + +" Private methods {{{1 + +function g:SyntasticMakeprgBuilder._getOpt(name) + if self._optExists(a:name) + return {self._optName(a:name)} + endif + + return self['_' . a:name] +endfunction + +function! g:SyntasticMakeprgBuilder._optExists(name) + return exists(self._optName(a:name)) +endfunction + +function! g:SyntasticMakeprgBuilder._optName(name) + let setting = "g:syntastic_" . self._filetype + if !empty(self._subchecker) + let setting .= '_' . self._subchecker + endif + return setting . '_' . a:name +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/modemap.vim b/sources_non_forked/syntastic/plugin/syntastic/modemap.vim new file mode 100644 index 00000000..2a838883 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/modemap.vim @@ -0,0 +1,67 @@ +if exists("g:loaded_syntastic_modemap") + finish +endif +let g:loaded_syntastic_modemap = 1 + +let g:SyntasticModeMap = {} + +" Public methods {{{1 + +function! g:SyntasticModeMap.Instance() + if !exists('s:SyntasticModeMapInstance') + let s:SyntasticModeMapInstance = copy(self) + call s:SyntasticModeMapInstance._initModeMapFromGlobalOpts() + endif + + return s:SyntasticModeMapInstance +endfunction + +function! g:SyntasticModeMap.allowsAutoChecking(filetype) + let fts = split(a:filetype, '\.') + + if self.isPassive() + return self._isOneFiletypeActive(fts) + else + return self._noFiletypesArePassive(fts) + endif +endfunction + +function! g:SyntasticModeMap.isPassive() + return self._mode == "passive" +endfunction + +function! g:SyntasticModeMap.toggleMode() + if self._mode == "active" + let self._mode = "passive" + else + let self._mode = "active" + endif +endfunction + +function! g:SyntasticModeMap.echoMode() + echo "Syntastic: " . self._mode . " mode enabled" +endfunction + +" Private methods {{{1 + +function! g:SyntasticModeMap._initModeMapFromGlobalOpts() + let self._mode = "active" + let self._activeFiletypes = [] + let self._passiveFiletypes = [] + + if exists("g:syntastic_mode_map") + let self._mode = get(g:syntastic_mode_map, 'mode', self._mode) + let self._activeFiletypes = get(g:syntastic_mode_map, 'active_filetypes', self._activeFiletypes) + let self._passiveFiletypes = get(g:syntastic_mode_map, 'passive_filetypes', self._passiveFiletypes) + endif +endfunction + +function! g:SyntasticModeMap._isOneFiletypeActive(filetypes) + return !empty(filter(a:filetypes, 'index(self._activeFiletypes, v:val) != -1')) +endfunction + +function! g:SyntasticModeMap._noFiletypesArePassive(filetypes) + return empty(filter(a:filetypes, 'index(self._passiveFiletypes, v:val) != -1')) +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim b/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim new file mode 100644 index 00000000..12f41445 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/notifiers.vim @@ -0,0 +1,55 @@ +if exists("g:loaded_syntastic_notifiers") + finish +endif +let g:loaded_syntastic_notifiers = 1 + +let g:SyntasticNotifiers = {} + +let s:notifier_types = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist'] + +" Public methods {{{1 + +function! g:SyntasticNotifiers.Instance() + if !exists('s:SyntasticNotifiersInstance') + let s:SyntasticNotifiersInstance = copy(self) + call s:SyntasticNotifiersInstance._initNotifiers() + endif + + return s:SyntasticNotifiersInstance +endfunction + +function! g:SyntasticNotifiers.refresh(loclist) + for type in self._enabled_types + let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') + if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled() + call self._notifier[type].refresh(a:loclist) + endif + endfor +endfunction + +function! g:SyntasticNotifiers.reset(loclist) + for type in self._enabled_types + let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') + + " reset notifiers regardless if they are enabled or not, since + " the user might have disabled them since the last refresh(); + " notifiers MUST be prepared to deal with reset() when disabled + if has_key(g:{class}, 'reset') + call self._notifier[type].reset(a:loclist) + endif + endfor +endfunction + +" Private methods {{{1 + +function! g:SyntasticNotifiers._initNotifiers() + let self._notifier = {} + for type in s:notifier_types + let class = substitute(type, '.*', 'Syntastic\u&Notifier', '') + let self._notifier[type] = g:{class}.New() + endfor + + let self._enabled_types = copy(s:notifier_types) +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/registry.vim b/sources_non_forked/syntastic/plugin/syntastic/registry.vim new file mode 100644 index 00000000..6f61d65f --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/registry.vim @@ -0,0 +1,213 @@ +if exists("g:loaded_syntastic_registry") + finish +endif +let g:loaded_syntastic_registry = 1 + +let s:defaultCheckers = { + \ 'c': ['gcc'], + \ 'coffee': ['coffee', 'coffeelint'], + \ 'cpp': ['gcc'], + \ 'css': ['csslint', 'phpcs'], + \ 'go': ['go'], + \ 'html': ['tidy'], + \ 'java': ['javac'], + \ 'javascript': ['jshint', 'jslint'], + \ 'json': ['jsonlint', 'jsonval'], + \ 'objc': ['gcc'], + \ 'objcpp': ['gcc'], + \ 'perl': ['perl', 'perlcritic'], + \ 'php': ['php', 'phpcs', 'phpmd'], + \ 'puppet': ['puppet', 'puppetlint'], + \ 'python': ['python', 'flake8', 'pylint'], + \ 'ruby': ['mri'], + \ 'sh': ['sh'], + \ 'tex': ['lacheck'] + \ } + +let s:defaultFiletypeMap = { + \ 'gentoo-metadata': 'xml', + \ 'lhaskell': 'haskell' + \ } + +let g:SyntasticRegistry = {} + +" TODO: Handling of filetype aliases: all public methods take aliases as +" parameters, all private methods take normalized filetypes. Public methods +" are thus supposed to normalize filetypes before calling private methods. + +" Public methods {{{1 + +function! g:SyntasticRegistry.Instance() + if !exists('s:SyntasticRegistryInstance') + let s:SyntasticRegistryInstance = copy(self) + let s:SyntasticRegistryInstance._checkerMap = {} + endif + + return s:SyntasticRegistryInstance +endfunction + +function! g:SyntasticRegistry.CreateAndRegisterChecker(args) + let checker = g:SyntasticChecker.New(a:args) + let registry = g:SyntasticRegistry.Instance() + call registry.registerChecker(checker) +endfunction + +function! g:SyntasticRegistry.registerChecker(checker) abort + let ft = a:checker.getFiletype() + + if !has_key(self._checkerMap, ft) + let self._checkerMap[ft] = [] + endif + + call self._validateUniqueName(a:checker) + + call add(self._checkerMap[ft], a:checker) +endfunction + +function! g:SyntasticRegistry.checkable(ftalias) + return !empty(self.getActiveCheckers(a:ftalias)) +endfunction + +function! g:SyntasticRegistry.getActiveCheckers(ftalias) + let filetype = s:SyntasticRegistryNormaliseFiletype(a:ftalias) + let checkers = self.availableCheckersFor(a:ftalias) + + if self._userHasFiletypeSettings(filetype) + return self._filterCheckersByUserSettings(checkers, filetype) + endif + + if has_key(s:defaultCheckers, filetype) + return self._filterCheckersByDefaultSettings(checkers, filetype) + endif + + let checkers = self.availableCheckersFor(filetype) + + if !empty(checkers) + return [checkers[0]] + endif + + return [] +endfunction + +function! g:SyntasticRegistry.getChecker(ftalias, name) + for checker in self.availableCheckersFor(a:ftalias) + if checker.getName() == a:name + return checker + endif + endfor + + return {} +endfunction + +function! g:SyntasticRegistry.availableCheckersFor(ftalias) + let filetype = s:SyntasticRegistryNormaliseFiletype(a:ftalias) + let checkers = copy(self._allCheckersFor(filetype)) + return self._filterCheckersByAvailability(checkers) +endfunction + +function! g:SyntasticRegistry.echoInfoFor(ftalias_list) + echomsg "Syntastic info for filetype: " . join(a:ftalias_list, '.') + + let available = [] + let active = [] + for ftalias in a:ftalias_list + call extend(available, self.availableCheckersFor(ftalias)) + call extend(active, self.getActiveCheckers(ftalias)) + endfor + + echomsg "Available checkers: " . join(syntastic#util#unique(map(available, "v:val.getName()"))) + echomsg "Currently active checker(s): " . join(syntastic#util#unique(map(active, "v:val.getName()"))) +endfunction + +" Private methods {{{1 + +function! g:SyntasticRegistry._allCheckersFor(filetype) + call self._loadCheckers(a:filetype) + if empty(self._checkerMap[a:filetype]) + return [] + endif + + return self._checkerMap[a:filetype] +endfunction + +function! g:SyntasticRegistry._filterCheckersByDefaultSettings(checkers, filetype) + if has_key(s:defaultCheckers, a:filetype) + return self._filterCheckersByName(a:checkers, s:defaultCheckers[a:filetype]) + endif + + return a:checkers +endfunction + +function! g:SyntasticRegistry._filterCheckersByUserSettings(checkers, filetype) + if exists("b:syntastic_checkers") + let whitelist = b:syntastic_checkers + else + let whitelist = g:syntastic_{a:filetype}_checkers + endif + return self._filterCheckersByName(a:checkers, whitelist) +endfunction + +function! g:SyntasticRegistry._filterCheckersByName(checkers, list) + let checkers_by_name = {} + for c in a:checkers + let checkers_by_name[c.getName()] = c + endfor + + let filtered = [] + for name in a:list + if has_key(checkers_by_name, name) + call add(filtered, checkers_by_name[name]) + endif + endfor + + return filtered +endfunction + +function! g:SyntasticRegistry._filterCheckersByAvailability(checkers) + return filter(copy(a:checkers), "v:val.isAvailable()") +endfunction + +function! g:SyntasticRegistry._loadCheckers(filetype) + if self._haveLoadedCheckers(a:filetype) + return + endif + + exec "runtime! syntax_checkers/" . a:filetype . "/*.vim" + + if !has_key(self._checkerMap, a:filetype) + let self._checkerMap[a:filetype] = [] + endif +endfunction + +function! g:SyntasticRegistry._haveLoadedCheckers(filetype) + return has_key(self._checkerMap, a:filetype) +endfunction + +function! g:SyntasticRegistry._userHasFiletypeSettings(filetype) + if exists("g:syntastic_" . a:filetype . "_checker") && !exists("g:syntastic_" . a:filetype . "_checkers") + let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker] + call syntastic#util#deprecationWarn("variable g:syntastic_" . a:filetype . "_checker is deprecated") + endif + return exists("b:syntastic_checkers") || exists("g:syntastic_" . a:filetype . "_checkers") +endfunction + +function! g:SyntasticRegistry._validateUniqueName(checker) abort + for checker in self._allCheckersFor(a:checker.getFiletype()) + if checker.getName() == a:checker.getName() + throw "Syntastic: Duplicate syntax checker name for: " . a:checker.getName() + endif + endfor +endfunction + +" Private functions {{{1 + +"resolve filetype aliases, and replace - with _ otherwise we cant name +"syntax checker functions legally for filetypes like "gentoo-metadata" +function! s:SyntasticRegistryNormaliseFiletype(ftalias) + let ft = get(s:defaultFiletypeMap, a:ftalias, a:ftalias) + let ft = get(g:syntastic_filetype_map, ft, ft) + let ft = substitute(ft, '-', '_', 'g') + return ft +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/plugin/syntastic/signs.vim b/sources_non_forked/syntastic/plugin/syntastic/signs.vim new file mode 100644 index 00000000..067658b1 --- /dev/null +++ b/sources_non_forked/syntastic/plugin/syntastic/signs.vim @@ -0,0 +1,149 @@ +if exists("g:loaded_syntastic_notifier_signs") + finish +endif +let g:loaded_syntastic_notifier_signs = 1 + +if !exists("g:syntastic_enable_signs") + let g:syntastic_enable_signs = 1 +endif + +if !exists("g:syntastic_error_symbol") + let g:syntastic_error_symbol = '>>' +endif + +if !exists("g:syntastic_warning_symbol") + let g:syntastic_warning_symbol = '>>' +endif + +if !exists("g:syntastic_style_error_symbol") + let g:syntastic_style_error_symbol = 'S>' +endif + +if !exists("g:syntastic_style_warning_symbol") + let g:syntastic_style_warning_symbol = 'S>' +endif + + +" start counting sign ids at 5000, start here to hopefully avoid conflicting +" with any other code that places signs (not sure if this precaution is +" actually needed) +let s:first_sign_id = 5000 +let s:next_sign_id = s:first_sign_id + +let g:SyntasticSignsNotifier = {} + +let s:setup_done = 0 + +" Public methods {{{1 + +function! g:SyntasticSignsNotifier.New() + let newObj = copy(self) + + if !s:setup_done + call self._setup() + let s:setup_done = 1 + endif + + return newObj +endfunction + +function! g:SyntasticSignsNotifier.enabled() + return + \ has('signs') && + \ exists('b:syntastic_enable_signs') ? b:syntastic_enable_signs : g:syntastic_enable_signs +endfunction + +function! g:SyntasticSignsNotifier.refresh(loclist) + let old_signs = copy(self._bufSignIds()) + if self.enabled() + call self._signErrors(a:loclist) + endif + call self._removeSigns(old_signs) + let s:first_sign_id = s:next_sign_id +endfunction + +" Private methods {{{1 + +" One time setup: define our own sign types and highlighting +function! g:SyntasticSignsNotifier._setup() + if has('signs') + if !hlexists('SyntasticErrorSign') + highlight link SyntasticErrorSign error + endif + if !hlexists('SyntasticWarningSign') + highlight link SyntasticWarningSign todo + endif + if !hlexists('SyntasticStyleErrorSign') + highlight link SyntasticStyleErrorSign SyntasticErrorSign + endif + if !hlexists('SyntasticStyleWarningSign') + highlight link SyntasticStyleWarningSign SyntasticWarningSign + endif + if !hlexists('SyntasticStyleErrorLine') + highlight link SyntasticStyleErrorLine SyntasticErrorLine + endif + if !hlexists('SyntasticStyleWarningLine') + highlight link SyntasticStyleWarningLine SyntasticWarningLine + endif + + " define the signs used to display syntax and style errors/warns + exe 'sign define SyntasticError text=' . g:syntastic_error_symbol . + \ ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine' + exe 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol . + \ ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine' + exe 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol . + \ ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine' + exe 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol . + \ ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine' + endif +endfunction + +" Place signs by all syntax errors in the buffer +function! g:SyntasticSignsNotifier._signErrors(loclist) + let loclist = a:loclist + if loclist.hasErrorsOrWarningsToDisplay() + + " errors some first, so that they are not masked by warnings + let buf = bufnr('') + let issues = copy(loclist.errors()) + if !loclist.quietWarnings() + call extend(issues, loclist.warnings()) + endif + call filter(issues, 'v:val["bufnr"] == buf') + let seen = {} + + for i in issues + if !has_key(seen, i['lnum']) + let seen[i['lnum']] = 1 + + let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error' + let sign_subtype = get(i, 'subtype', '') + let sign_type = 'Syntastic' . sign_subtype . sign_severity + + exec "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr'] + call add(self._bufSignIds(), s:next_sign_id) + let s:next_sign_id += 1 + endif + endfor + endif +endfunction + +" Remove the signs with the given ids from this buffer +function! g:SyntasticSignsNotifier._removeSigns(ids) + if has('signs') + for i in a:ids + exec "sign unplace " . i + call remove(self._bufSignIds(), index(self._bufSignIds(), i)) + endfor + endif +endfunction + +" Get all the ids of the SyntaxError signs in the buffer +function! g:SyntasticSignsNotifier._bufSignIds() + if !exists("b:syntastic_sign_ids") + let b:syntastic_sign_ids = [] + endif + return b:syntastic_sign_ids +endfunction + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim b/sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim new file mode 100644 index 00000000..7050c3d5 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim @@ -0,0 +1,168 @@ +"============================================================================ +"File: ada.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alfredo Di Napoli +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" +" let g:syntastic_ada_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_ada_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_ada_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_ada_includes. Then the header files are being re-checked +" on the next file write. +" +" let g:syntastic_ada_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_ada_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_ada_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_ada_include_dirs. This list can be used like this: +" +" let g:syntastic_ada_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_ada_compiler_options': +" +" let g:syntastic_ada_compiler_options = ' -std=c++0x' +" +" Additionally the setting 'g:syntastic_ada_config_file' allows you to define +" a file that contains additional compiler arguments like include directories +" or CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_ada_config': +" +" let g:syntastic_ada_config_file = '.config' +" +" Using the global variable 'g:syntastic_ada_remove_include_errors' you can +" specify whether errors of files included via the +" g:syntastic_ada_include_dirs' setting are removed from the result set: +" +" let g:syntastic_ada_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_ada_errorformat' to override the default error +" format: +" +" let g:syntastic_ada_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to gcc) +" +" let g:syntastic_ada_compiler = 'gcc' + +if exists('g:loaded_syntastic_ada_gcc_checker') + finish +endif +let g:loaded_syntastic_ada_gcc_checker = 1 + +if !exists('g:syntastic_ada_compiler') + let g:syntastic_ada_compiler = 'gcc' +endif + +function! SyntaxCheckers_ada_gcc_IsAvailable() + return executable(g:syntastic_ada_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_ada_compiler_options') + let g:syntastic_ada_compiler_options = '' +endif + +if !exists('g:syntastic_ada_config_file') + let g:syntastic_ada_config_file = '.syntastic_ada_config' +endif + +function! SyntaxCheckers_ada_gcc_GetLocList() + let makeprg = g:syntastic_ada_compiler . ' -c -x ada -fsyntax-only ' + let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' + + if exists('g:syntastic_c_errorformat') + let errorformat = g:syntastic_c_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_ada_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('ada') + + " determine whether to parse header files as well + if expand('%') =~? '\.ads$' + if exists('g:syntastic_ada_check_header') + let makeprg = g:syntastic_ada_compiler . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' ' . g:syntastic_ada_compiler_options . + \ ' ' . syntastic#c#GetIncludeDirs('ada') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_ada_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_ada_no_include_search') || + \ g:syntastic_ada_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_ada_auto_refresh_includes') && + \ g:syntastic_ada_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_ada_includes') + let b:syntastic_ada_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_ada_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_ada_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_ada_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_ada_remove_include_errors') && + \ g:syntastic_ada_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ada', + \ 'name': 'gcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/applescript/osacompile.vim b/sources_non_forked/syntastic/syntax_checkers/applescript/osacompile.vim new file mode 100644 index 00000000..7567eb08 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/applescript/osacompile.vim @@ -0,0 +1,50 @@ +"============================================================================== +" FileName: applescript.vim +" Desc: Syntax checking plugin for syntastic.vim +" Author: Zhao Cai +" Email: caizhaoff@gmail.com +" Version: 0.2.1 +" Date Created: Thu 09 Sep 2011 10:30:09 AM EST +" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST +" +" History: 0.1.0 - working, but it will run the script everytime to check +" syntax. Should use osacompile but strangely it does not give +" errors. +" +" 0.2.0 - switch to osacompile, it gives less errors compared +" with osascript. +" +" 0.2.1 - remove g:syntastic_applescript_tempfile. use +" tempname() instead. +" +" License: This program is free software. It comes without any +" warranty, to the extent permitted by applicable law. You can +" redistribute it and/or modify it under the terms of the Do What The +" Fuck You Want To Public License, Version 2, as published by Sam +" Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_applescript_osacompile_checker") + finish +endif +let g:loaded_syntastic_applescript_osacompile_checker=1 + +function! SyntaxCheckers_applescript_osacompile_IsAvailable() + return executable('osacompile') +endfunction + +function! SyntaxCheckers_applescript_osacompile_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'osacompile', + \ 'args': '-o ' . tempname() . '.scpt ', + \ 'filetype': 'applescript', + \ 'subchecker': 'osacompile' }) + let errorformat = '%f:%l:%m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'applescript', + \ 'name': 'osacompile'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/c/checkpatch.vim b/sources_non_forked/syntastic/syntax_checkers/c/checkpatch.vim new file mode 100644 index 00000000..0d579bfd --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/checkpatch.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: checkpatch.vim +"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl +"Maintainer: Daniel Walker +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if exists("g:loaded_syntastic_c_checkpatch_checker") + finish +endif +let g:loaded_syntastic_c_checkpatch_checker = 1 + +" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed. +if executable("checkpatch.pl") + let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl' +elseif executable("./scripts/checkpatch.pl") + let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl' +endif + +function SyntaxCheckers_c_checkpatch_IsAvailable() + return exists("g:syntastic_c_checker_checkpatch_location") +endfunction + + +function! SyntaxCheckers_c_checkpatch_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': g:syntastic_c_checker_checkpatch_location, + \ 'args': '--no-summary --no-tree --terse --file', + \ 'filetype': 'c', + \ 'subchecker': 'checkpatch' }) + + let errorformat = + \ '%f:%l: %tARNING: %m,' . + \ '%f:%l: %tRROR: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0], + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'checkpatch'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/c/gcc.vim b/sources_non_forked/syntastic/syntax_checkers/c/gcc.vim new file mode 100644 index 00000000..d5c05f99 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/gcc.vim @@ -0,0 +1,183 @@ +"============================================================================ +"File: c.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" +" let g:syntastic_c_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_c_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_c_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_c_includes. Then the header files are being re-checked on +" the next file write. +" +" let g:syntastic_c_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_c_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_c_include_dirs. This list can be used like this: +" +" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_c_compiler_options': +" +" let g:syntastic_c_compiler_options = ' -ansi' +" +" Additionally the setting 'g:syntastic_c_config_file' allows you to define a +" file that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_c_config': +" +" let g:syntastic_c_config_file = '.config' +" +" Using the global variable 'g:syntastic_c_remove_include_errors' you can +" specify whether errors of files included via the g:syntastic_c_include_dirs' +" setting are removed from the result set: +" +" let g:syntastic_c_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_c_errorformat' to override the default error +" format: +" +" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to gcc) +" +" let g:syntastic_c_compiler = 'clang' + +if exists('g:loaded_syntastic_c_gcc_checker') + finish +endif +let g:loaded_syntastic_c_gcc_checker = 1 + +if !exists('g:syntastic_c_compiler') + let g:syntastic_c_compiler = 'gcc' +endif + +function! SyntaxCheckers_c_gcc_IsAvailable() + return executable(g:syntastic_c_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_c_compiler_options') + let g:syntastic_c_compiler_options = '-std=gnu99' +endif + +if !exists('g:syntastic_c_config_file') + let g:syntastic_c_config_file = '.syntastic_c_config' +endif + +function! SyntaxCheckers_c_gcc_GetLocList() + let makeprg = g:syntastic_c_compiler . ' -x c -fsyntax-only ' + let errorformat = + \ '%-G%f:%s:,' . + \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . + \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . + \ '%-GIn file included%.%#,' . + \ '%-G %#from %f:%l\,,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,'. + \ '%f:%l: %m' + + if exists('g:syntastic_c_errorformat') + let errorformat = g:syntastic_c_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_c_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('c') + + " determine whether to parse header files as well + if expand('%') =~? '\.h$' + if exists('g:syntastic_c_check_header') + let makeprg = g:syntastic_c_compiler . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' ' . g:syntastic_c_compiler_options . + \ ' ' . syntastic#c#GetNullDevice() . + \ ' ' . syntastic#c#GetIncludeDirs('c') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_c_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_c_no_include_search') || + \ g:syntastic_c_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_c_auto_refresh_includes') && + \ g:syntastic_c_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_c_includes') + let b:syntastic_c_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_c_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_c_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_c_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_c_remove_include_errors') && + \ g:syntastic_c_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'gcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/c/make.vim b/sources_non_forked/syntastic/syntax_checkers/c/make.vim new file mode 100644 index 00000000..a0ccbf61 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/make.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: make.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('g:loaded_syntastic_c_make_checker') + finish +endif +let g:loaded_syntastic_c_make_checker = 1 + +function SyntaxCheckers_c_make_IsAvailable() + return executable('make') +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_c_make_GetLocList() + + let makeprg = 'make -sk' + + let errorformat = + \ '%-G%f:%s:,' . + \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . + \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . + \ '%-GIn file included%.%#,' . + \ '%-G %#from %f:%l\,,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,'. + \ '%f:%l: %m' + + if exists('g:syntastic_c_errorformat') + let errorformat = g:syntastic_c_errorformat + endif + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_c_remove_include_errors') && + \ g:syntastic_c_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'make'}) + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/sources_non_forked/syntastic/syntax_checkers/c/oclint.vim b/sources_non_forked/syntastic/syntax_checkers/c/oclint.vim new file mode 100644 index 00000000..e366a7ab --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/oclint.vim @@ -0,0 +1,58 @@ +"============================================================================ +"File: oclint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: "UnCO" Lin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_oclint_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_oclint_config': +" +" let g:syntastic_oclint_config_file = '.config' + +if exists("g:loaded_syntastic_c_oclint_checker") + finish +endif +let g:loaded_syntastic_c_oclint_checker = 1 + +function! SyntaxCheckers_c_oclint_IsAvailable() + return executable("oclint") +endfunction + +if !exists('g:syntastic_oclint_config_file') + let g:syntastic_oclint_config_file = '.syntastic_oclint_config' +endif + +function! SyntaxCheckers_c_oclint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'oclint', + \ 'args': '-text', + \ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file), + \ 'filetype': 'c', + \ 'subchecker': 'oclint' }) + + let errorformat = + \ '%E%f:%l:%c: %m P1 ,' . + \ '%E%f:%l:%c: %m P2 ,' . + \ '%W%f:%l:%c: %m P3 ,' . + \ '%E%f:%l:%c: fatal error: %m,' . + \ '%E%f:%l:%c: error: %m,' . + \ '%W%f:%l:%c: warning: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'postprocess': ['compressWhitespace', 'sort'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'oclint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/c/sparse.vim b/sources_non_forked/syntastic/syntax_checkers/c/sparse.vim new file mode 100644 index 00000000..0307e324 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/sparse.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: sparse.vim +"Description: Syntax checking plugin for syntastic.vim using sparse.pl +"Maintainer: Daniel Walker +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_sparse_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_sparse_config': +" +" let g:syntastic_sparse_config_file = '.config' + +if exists("g:loaded_syntastic_c_sparse_checker") + finish +endif +let g:loaded_syntastic_c_sparse_checker = 1 + +function! SyntaxCheckers_c_sparse_IsAvailable() + return executable("sparse") +endfunction + +if !exists('g:syntastic_sparse_config_file') + let g:syntastic_sparse_config_file = '.syntastic_sparse_config' +endif + +function! SyntaxCheckers_c_sparse_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'sparse', + \ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file), + \ 'filetype': 'c', + \ 'subchecker': 'sparse' }) + + let errorformat = '%f:%l:%v: %trror: %m,%f:%l:%v: %tarning: %m,' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")}, + \ 'returns': [0] }) + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'sparse'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/c/splint.vim b/sources_non_forked/syntastic/syntax_checkers/c/splint.vim new file mode 100644 index 00000000..6b2a1c1b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/splint.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: splint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_splint_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_splint_config': +" +" let g:syntastic_splint_config_file = '.config' + +if exists("g:loaded_syntastic_c_splint_checker") + finish +endif +let g:loaded_syntastic_c_splint_checker = 1 + +function! SyntaxCheckers_c_splint_IsAvailable() + return executable("splint") +endfunction + +if !exists('g:syntastic_splint_config_file') + let g:syntastic_splint_config_file = '.syntastic_splint_config' +endif + +function! SyntaxCheckers_c_splint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'splint', + \ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file), + \ 'filetype': 'c', + \ 'subchecker': 'splint' }) + + let errorformat = + \ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' . + \ '%W%f:%l:%v: %m,' . + \ '%W%f:%l: %m,' . + \ '%-C %\+In file included from %.%#,' . + \ '%-C %\+from %.%#,' . + \ '%+C %.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'postprocess': ['compressWhitespace'], + \ 'defaults': {'type': 'W'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'splint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/c/ycm.vim b/sources_non_forked/syntastic/syntax_checkers/c/ycm.vim new file mode 100644 index 00000000..5cce6fc5 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/c/ycm.vim @@ -0,0 +1,32 @@ +"============================================================================ +"File: ycm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Val Markovic +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_c_ycm_checker") + finish +endif +let g:loaded_syntastic_c_ycm_checker = 1 + +function! SyntaxCheckers_c_ycm_IsAvailable() + return exists('g:loaded_youcompleteme') +endfunction + +if !exists('g:loaded_youcompleteme') + finish +endif + +function! SyntaxCheckers_c_ycm_GetLocList() + return youcompleteme#CurrentFileDiagnostics() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'ycm'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/co/coco.vim b/sources_non_forked/syntastic/syntax_checkers/co/coco.vim new file mode 100644 index 00000000..a3186108 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/co/coco.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: co.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Andrew Kelley +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_co_coco_checker") + finish +endif +let g:loaded_syntastic_co_coco_checker=1 + +"bail if the user doesnt have coco installed +if !executable("coco") + finish +endif + +function! SyntaxCheckers_co_coco_GetLocList() + return executable('coco') +endfunction + +function! SyntaxCheckers_co_coco_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'coco', + \ 'args': '-c -o /tmp', + \ 'filetype': 'co', + \ 'subchecker': 'coco' }) + + let errorformat = + \ '%EFailed at: %f,' . + \ '%ZSyntax%trror: %m on line %l,'. + \ '%EFailed at: %f,'. + \ '%Z%trror: Parse error on line %l: %m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'co', + \ 'name': 'coco'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/coffee/coffee.vim b/sources_non_forked/syntastic/syntax_checkers/coffee/coffee.vim new file mode 100644 index 00000000..846180b9 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/coffee/coffee.vim @@ -0,0 +1,48 @@ +"============================================================================ +"File: coffee.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lincoln Stoll +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" Note: this script requires CoffeeScript version 1.6.2 or newer. +" +if exists("g:loaded_syntastic_coffee_coffee_checker") + finish +endif +let g:loaded_syntastic_coffee_coffee_checker=1 + +function! SyntaxCheckers_coffee_coffee_IsAvailable() + return executable("coffee") && + \ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2]) +endfunction + +function! SyntaxCheckers_coffee_coffee_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'coffee', + \ 'args': '-cp', + \ 'filetype': 'coffee', + \ 'subchecker': 'coffee' }) + + let errorformat = + \ '%E%f:%l:%c: %trror: %m,' . + \ 'Syntax%trror: In %f\, %m on line %l,' . + \ '%EError: In %f\, Parse error on line %l: %m,' . + \ '%EError: In %f\, %m on line %l,' . + \ '%W%f(%l): lint warning: %m,' . + \ '%W%f(%l): warning: %m,' . + \ '%E%f(%l): SyntaxError: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coffee', + \ 'name': 'coffee'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/coffee/coffeelint.vim b/sources_non_forked/syntastic/syntax_checkers/coffee/coffeelint.vim new file mode 100644 index 00000000..cae5c40c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/coffee/coffeelint.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: coffeelint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lincoln Stoll +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_coffee_coffeelint_checker") + finish +endif +let g:loaded_syntastic_coffee_coffeelint_checker=1 + +function! SyntaxCheckers_coffee_coffeelint_IsAvailable() + return executable('coffeelint') +endfunction + +function! SyntaxCheckers_coffee_coffeelint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'coffeelint', + \ 'args': '--csv', + \ 'filetype': 'coffee', + \ 'subchecker': 'coffeelint' }) + + let errorformat = '%f\,%l\,%trror\,%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coffee', + \ 'name': 'coffeelint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim b/sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim new file mode 100644 index 00000000..f1efa4d8 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: coqtop.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Matvey Aksenov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_coq_coqtop_checker") + finish +endif +let g:loaded_syntastic_coq_coqtop_checker=1 + +function! SyntaxCheckers_coq_coqtop_IsAvailable() + return executable('coqtop') +endfunction + +function! SyntaxCheckers_coq_coqtop_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'coqtop', + \ 'args': '-noglob -batch -load-vernac-source', + \ 'filetype': 'coq', + \ 'subchecker': 'coqtop' }) + + let errorformat = + \ '%AFile \"%f\"\, line %l\, characters %c\-%.%#\:,'. + \ '%C%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'coq', + \ 'name': 'coqtop'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim b/sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim new file mode 100644 index 00000000..35e77ccc --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: cpplint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For details about cpplint see: +" https://code.google.com/p/google-styleguide/ +" +" Checker options: +" +" - g:syntastic_cpp_cpplint_thres (integer; default: 5) +" error threshold: policy violations with a severity above this +" value are highlighted as errors, the others are warnings +" +" - g:syntastic_cpp_cpplint_args (string; default: '--verbose=3') +" command line options to pass to cpplint + +if exists("g:loaded_syntastic_cpp_cpplint_checker") + finish +endif +let g:loaded_syntastic_cpp_cpplint_checker = 1 + +if !exists('g:syntastic_cpp_cpplint_thres') + let g:syntastic_cpp_cpplint_thres = 5 +endif + +if ! exists('g:syntastic_cpp_cpplint_args') + let g:syntastic_cpp_cpplint_args = '--verbose=3' +endif + +function! SyntaxCheckers_cpp_cpplint_IsAvailable() + return executable('cpplint.py') +endfunction + +function! SyntaxCheckers_cpp_cpplint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'cpplint.py', + \ 'filetype': 'cpp', + \ 'subchecker': 'cpplint' }) + + let errorformat = '%A%f:%l: %m [%t],%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) + + " change error types according to the prescribed threshold + for n in range(len(loclist)) + let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'cpplint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim b/sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim new file mode 100644 index 00000000..40b2a105 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim @@ -0,0 +1,179 @@ +"============================================================================ +"File: cpp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" +" let g:syntastic_cpp_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_cpp_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_cpp_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_cpp_includes. Then the header files are being re-checked +" on the next file write. +" +" let g:syntastic_cpp_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_cpp_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_cpp_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_cpp_include_dirs. This list can be used like this: +" +" let g:syntastic_cpp_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_cpp_compiler_options': +" +" let g:syntastic_cpp_compiler_options = ' -std=c++0x' +" +" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define +" a file that contains additional compiler arguments like include directories +" or CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_cpp_config': +" +" let g:syntastic_cpp_config_file = '.config' +" +" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can +" specify whether errors of files included via the +" g:syntastic_cpp_include_dirs' setting are removed from the result set: +" +" let g:syntastic_cpp_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_cpp_errorformat' to override the default error +" format: +" +" let g:syntastic_cpp_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to g++) +" +" let g:syntastic_cpp_compiler = 'clang++' + +if exists('g:loaded_syntastic_cpp_gcc_checker') + finish +endif +let g:loaded_syntastic_cpp_gcc_checker = 1 + +if !exists('g:syntastic_cpp_compiler') + let g:syntastic_cpp_compiler = 'g++' +endif + +function! SyntaxCheckers_cpp_gcc_IsAvailable() + return executable(g:syntastic_cpp_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_cpp_compiler_options') + let g:syntastic_cpp_compiler_options = '' +endif + +if !exists('g:syntastic_cpp_config_file') + let g:syntastic_cpp_config_file = '.syntastic_cpp_config' +endif + +function! SyntaxCheckers_cpp_gcc_GetLocList() + let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' + let errorformat = + \ '%-G%f:%s:,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,'. + \ '%f:%l: %trror: %m,'. + \ '%f:%l: %tarning: %m,'. + \ '%f:%l: %m' + + if exists('g:syntastic_cpp_errorformat') + let errorformat = g:syntastic_cpp_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_cpp_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('cpp') + + " determine whether to parse header files as well + if expand('%') =~? '\.\(h\|hpp\|hh\)$' + if exists('g:syntastic_cpp_check_header') + let makeprg = g:syntastic_cpp_compiler . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' ' . g:syntastic_cpp_compiler_options . + \ ' ' . syntastic#c#GetNullDevice() . + \ ' ' . syntastic#c#GetIncludeDirs('cpp') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_cpp_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_cpp_no_include_search') || + \ g:syntastic_cpp_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_cpp_auto_refresh_includes') && + \ g:syntastic_cpp_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_cpp_includes') + let b:syntastic_cpp_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_cpp_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_cpp_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_cpp_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_cpp_remove_include_errors') && + \ g:syntastic_cpp_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'gcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim b/sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim new file mode 100644 index 00000000..867f15de --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: oclint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: "UnCO" Lin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_oclint_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_oclint_config': +" +" let g:syntastic_oclint_config_file = '.config' + +if exists("g:loaded_syntastic_cpp_oclint_checker") + finish +endif +let g:loaded_syntastic_cpp_oclint_checker = 1 + +function! SyntaxCheckers_cpp_oclint_IsAvailable() + return SyntaxCheckers_c_oclint_IsAvailable() +endfunction + +function! SyntaxCheckers_cpp_oclint_GetLocList() + return SyntaxCheckers_c_oclint_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'oclint'}) + +runtime! syntax_checkers/c/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim b/sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim new file mode 100644 index 00000000..b0dbab58 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: ycm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Val Markovic +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_cpp_ycm_checker") + finish +endif +let g:loaded_syntastic_cpp_ycm_checker = 1 + +function! SyntaxCheckers_cpp_ycm_IsAvailable() + return SyntaxCheckers_c_ycm_IsAvailable() +endfunction + +if !exists('g:loaded_youcompleteme') + finish +endif + +function! SyntaxCheckers_cpp_ycm_GetLocList() + return SyntaxCheckers_c_ycm_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'ycm'}) + +runtime! syntax_checkers/c/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim b/sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim new file mode 100644 index 00000000..b3c96a95 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim @@ -0,0 +1,39 @@ +"============================================================================ +"File: cs.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Daniel Walker +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_cs_mcs_checker") + finish +endif +let g:loaded_syntastic_cs_mcs_checker=1 + +function! SyntaxCheckers_cs_mcs_IsAvailable() + return executable('mcs') +endfunction + +function! SyntaxCheckers_cs_mcs_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'mcs', + \ 'args': '--parse', + \ 'filetype': 'cs', + \ 'subchecker': 'mcs' }) + + let errorformat = '%f(%l\,%c): %trror %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cs', + \ 'name': 'mcs'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/css/csslint.vim b/sources_non_forked/syntastic/syntax_checkers/css/csslint.vim new file mode 100644 index 00000000..6a2659d7 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/css/csslint.vim @@ -0,0 +1,54 @@ +"============================================================================ +"File: css.vim +"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net). +"Maintainer: Ory Band +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" Specify additional options to csslint with this option. e.g. to disable +" warnings: +" +" let g:syntastic_csslint_options = "--warnings=none" + +if exists("g:loaded_syntastic_css_csslint_checker") + finish +endif +let g:loaded_syntastic_css_csslint_checker=1 + +if !exists('g:syntastic_csslint_options') + let g:syntastic_csslint_options = "" +endif + +function! SyntaxCheckers_css_csslint_IsAvailable() + return executable('csslint') +endfunction + +function! SyntaxCheckers_css_csslint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'csslint', + \ 'args': '--format=compact ' . g:syntastic_csslint_options, + \ 'filetype': 'css', + \ 'subchecker': 'csslint' }) + + " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. + let errorformat = + \ '%-G,' . + \ '%-G%f: lint free!,' . + \ '%f: line %l\, col %c\, %trror - %m,' . + \ '%f: line %l\, col %c\, %tarning - %m,'. + \ '%f: line %l\, col %c\, %m,' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'csslint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim b/sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim new file mode 100644 index 00000000..ffcb7fee --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim @@ -0,0 +1,33 @@ +"============================================================================ +"File: phpcs.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" See here for details of phpcs +" - phpcs (see http://pear.php.net/package/PHP_CodeSniffer) +" +if exists("g:loaded_syntastic_css_phpcs_checker") + finish +endif +let g:loaded_syntastic_css_phpcs_checker=1 + +function! SyntaxCheckers_css_phpcs_IsAvailable() + return SyntaxCheckers_php_phpcs_IsAvailable() +endfunction + +function! SyntaxCheckers_css_phpcs_GetLocList() + return SyntaxCheckers_php_phpcs_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'phpcs'}) + +runtime! syntax_checkers/php/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim b/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim new file mode 100644 index 00000000..c3cd9de1 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim @@ -0,0 +1,62 @@ +"============================================================================ +"File: prettycss.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For details about PrettyCSS see: +" +" - http://fidian.github.io/PrettyCSS/ +" - https://github.com/fidian/PrettyCSS + +if exists("g:loaded_syntastic_css_prettycss_checker") + finish +endif +let g:loaded_syntastic_css_prettycss_checker=1 + +function! SyntaxCheckers_css_prettycss_IsAvailable() + return executable('prettycss') +endfunction + +function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item) + let term = matchstr(a:item["text"], ' (\zs[^)]\+\ze)$') + if term != '' + let term = '\V' . term + endif + return term +endfunction + +function! SyntaxCheckers_css_prettycss_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'prettycss', + \ 'filetype': 'css', + \ 'subchecker': 'prettycss' }) + + " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. + let errorformat = + \ '%EError: %m\, line %l\, char %c),' . + \ '%WWarning: %m\, line %l\, char %c),' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")}, + \ 'postprocess': ['sort'] }) + + for n in range(len(loclist)) + let loclist[n]["text"] .= ')' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'css', + \ 'name': 'prettycss'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/cucumber/cucumber.vim b/sources_non_forked/syntastic/syntax_checkers/cucumber/cucumber.vim new file mode 100644 index 00000000..4458c78f --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cucumber/cucumber.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: cucumber.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_cucumber_cucumber_checker") + finish +endif +let g:loaded_syntastic_cucumber_cucumber_checker=1 + +function! SyntaxCheckers_cucumber_cucumber_IsAvailable() + return executable('cucumber') +endfunction + +function! SyntaxCheckers_cucumber_cucumber_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'cucumber', + \ 'args': '--dry-run --quiet --strict --format pretty', + \ 'filetype': 'cucumber', + \ 'subchecker': 'cucumber' }) + + let errorformat = + \ '%f:%l:%c:%m,' . + \ '%W %.%# (%m),' . + \ '%-Z%f:%l:%.%#,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cucumber', + \ 'name': 'cucumber'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim b/sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim new file mode 100644 index 00000000..7bc6c4bb --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim @@ -0,0 +1,72 @@ +"============================================================================ +"File: cuda.vim +"Description: Syntax checking plugin for syntastic.vim +" +"Author: Hannes Schulz +" +"============================================================================ + +" in order to also check header files add this to your .vimrc: +" (this creates an empty .syntastic_dummy.cu file in your source directory) +" +" let g:syntastic_cuda_check_header = 1 + +" By default, nvcc and thus syntastic, defaults to the most basic architecture. +" This can produce false errors if the developer intends to compile for newer +" hardware and use newer features, eg. double precision numbers. To pass a +" specific target arch to nvcc, e.g. add the following to your .vimrc: +" +" let g:syntastic_cuda_arch = "sm_20" + + +if exists("g:loaded_syntastic_cuda_nvcc_checker") + finish +endif +let g:loaded_syntastic_cuda_nvcc_checker=1 + +function! SyntaxCheckers_cuda_nvcc_IsAvailable() + return executable('nvcc') +endfunction + +function! SyntaxCheckers_cuda_nvcc_GetLocList() + if exists('g:syntastic_cuda_arch') + let arch_flag = '-arch=' . g:syntastic_cuda_arch + else + let arch_flag = '' + endif + let makeprg = + \ 'nvcc ' . arch_flag . ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' . + \ syntastic#util#shexpand('%') . ' ' . syntastic#c#GetNullDevice() + let errorformat = + \ '%*[^"]"%f"%*\D%l: %m,'. + \ '"%f"%*\D%l: %m,'. + \ '%-G%f:%l: (Each undeclared identifier is reported only once,'. + \ '%-G%f:%l: for each function it appears in.),'. + \ '%f:%l:%c:%m,'. + \ '%f(%l):%m,'. + \ '%f:%l:%m,'. + \ '"%f"\, line %l%*\D%c%*[^ ] %m,'. + \ '%D%*\a[%*\d]: Entering directory `%f'','. + \ '%X%*\a[%*\d]: Leaving directory `%f'','. + \ '%D%*\a: Entering directory `%f'','. + \ '%X%*\a: Leaving directory `%f'','. + \ '%DMaking %*\a in %f,'. + \ '%f|%l| %m' + + if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$' + if exists('g:syntastic_cuda_check_header') + let makeprg = + \ 'echo > .syntastic_dummy.cu ; ' . + \ 'nvcc ' . arch_flag . ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' . + \ syntastic#util#shexpand('%') . ' ' . syntastic#c#GetNullDevice() + else + return [] + endif + endif + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cuda', + \ 'name': 'nvcc'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/d/dmd.vim b/sources_non_forked/syntastic/syntax_checkers/d/dmd.vim new file mode 100644 index 00000000..17228e41 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/d/dmd.vim @@ -0,0 +1,177 @@ +"============================================================================ +"File: d.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alfredo Di Napoli +"License: Based on the original work of Gregor Uhlenheuer and his +" cpp.vim checker so credits are dued. +" 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. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" +" let g:syntastic_d_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_d_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_d_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_d_includes. Then the header files are being re-checked +" on the next file write. +" +" let g:syntastic_d_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_d_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_d_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" dmd command line you can add those to the global variable +" g:syntastic_d_include_dirs. This list can be used like this: +" +" let g:syntastic_d_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_d_compiler_options': +" +" let g:syntastic_d_compiler_options = ' -std=c++0x' +" +" Additionally the setting 'g:syntastic_d_config_file' allows you to define +" a file that contains additional compiler arguments like include directories +" or CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_d_config': +" +" let g:syntastic_d_config_file = '.config' +" +" Using the global variable 'g:syntastic_d_remove_include_errors' you can +" specify whether errors of files included via the +" g:syntastic_d_include_dirs' setting are removed from the result set: +" +" let g:syntastic_d_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_d_errorformat' to override the default error +" format: +" +" let g:syntastic_d_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to dmd) +" +" let g:syntastic_d_compiler = 'clang++' + +if exists('g:loaded_syntastic_d_dmd_checker') + finish +endif +let g:loaded_syntastic_d_dmd_checker = 1 + +if !exists('g:syntastic_d_compiler') + let g:syntastic_d_compiler = 'dmd' +endif + +function! SyntaxCheckers_d_dmd_IsAvailable() + return executable(g:syntastic_d_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_d_compiler_options') + let g:syntastic_d_compiler_options = '' +endif + +if !exists('g:syntastic_d_config_file') + let g:syntastic_d_config_file = '.syntastic_d_config' +endif + +function! SyntaxCheckers_d_dmd_GetLocList() + let makeprg = g:syntastic_d_compiler . ' -c -of' . syntastic#util#DevNull() . ' ' + let errorformat = '%-G%f:%s:,%f(%l): %m,%f:%l: %m' + + if exists('g:syntastic_d_errorformat') + let errorformat = g:syntastic_d_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_d_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('d') + + " determine whether to parse header files as well + if expand('%') =~? '\.di$' + if exists('g:syntastic_d_check_header') + let makeprg = g:syntastic_d_compiler . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' -of' . syntastic#util#DevNull() . + \ ' ' . g:syntastic_d_compiler_options . + \ ' ' . syntastic#c#GetIncludeDirs('d') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_d_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_d_no_include_search') || + \ g:syntastic_d_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_d_auto_refresh_includes') && + \ g:syntastic_d_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_d_includes') + let b:syntastic_d_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_d_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_d_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_d_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_d_remove_include_errors') && + \ g:syntastic_d_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'd', + \ 'name': 'dmd'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/dart/dart_analyzer.vim b/sources_non_forked/syntastic/syntax_checkers/dart/dart_analyzer.vim new file mode 100644 index 00000000..a0835c41 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/dart/dart_analyzer.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: dart_analyzer.vim +"Description: Dart syntax checker - using dart_analyzer +"Maintainer: Maksim Ryzhikov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if exists("g:loaded_syntastic_dart_dart_analyzer_checker") + finish +endif +let g:loaded_syntastic_dart_dart_analyzer_checker=1 + +if !exists("g:syntastic_dart_analyzer_conf") + let g:syntastic_dart_analyzer_conf = '' +endif + +function! SyntaxCheckers_dart_dart_analyzer_IsAvailable() + return executable("dart_analyzer") +endfunction + +function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error) + let lcol = a:error['col'] - 1 + let rcol = a:error['nr'] + lcol + 1 + + return '\%>'.lcol.'c\%<'.rcol.'c' +endfunction + +function! SyntaxCheckers_dart_dart_analyzer_GetLocList() + let args = !empty(g:syntastic_dart_analyzer_conf) ? ' ' . g:syntastic_dart_analyzer_conf : '' + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'dart_analyzer', + \ 'args': '--error_format machine', + \ 'post_args': args, + \ 'filetype': 'dart', + \ 'subchecker': 'dart_analyzer' }) + + " Machine readable format looks like: + " SEVERITY|TYPE|ERROR_CODE|file:FILENAME|LINE_NUMBER|COLUMN|LENGTH|MESSAGE + " SEVERITY: (WARNING|ERROR) + " TYPE: (RESOLVER|STATIC_TYPE|...) + " ERROR_CODE: (NO_SUCH_TYPE|...) + " FILENAME: String + " LINE_NUMBER: int + " COLUMN: int + " LENGHT: int + " MESSAGE: String + + " We use %n to grab the error length to be able to access it in the matcher. + let commonformat = '|%.%#|%.%#|file:%f|%l|%c|%n|%m' + + " TODO(amouravski): simply take everything after ERROR|WARNING as a message + " and then parse it by hand later. + let errorformat = '%EERROR'.l:commonformat.','. + \'%WWARNING'.l:commonformat + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'dart', + \ 'name': 'dart_analyzer'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/docbk/xmllint.vim b/sources_non_forked/syntastic/syntax_checkers/docbk/xmllint.vim new file mode 100644 index 00000000..cc0e3e35 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/docbk/xmllint.vim @@ -0,0 +1,30 @@ +"============================================================================ +"File: docbk.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_docbk_xmllint_checker") + finish +endif +let g:loaded_syntastic_docbk_xmllint_checker=1 + +function! SyntaxCheckers_docbk_xmllint_IsAvailable() + return SyntaxCheckers_xml_xmllint_IsAvailable() +endfunction + +function! SyntaxCheckers_docbk_xmllint_GetLocList() + return SyntaxCheckers_xml_xmllint_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'docbk', + \ 'name': 'xmllint'}) + +runtime! syntax_checkers/xml/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/elixir/elixir.vim b/sources_non_forked/syntastic/syntax_checkers/elixir/elixir.vim new file mode 100644 index 00000000..521e9456 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/elixir/elixir.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: elixir.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Richard Ramsden +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_elixir_elixir_checker") + finish +endif +let g:loaded_syntastic_elixir_elixir_checker=1 + +" TODO: we should probably split this into separate checkers +function! SyntaxCheckers_elixir_elixir_IsAvailable() + return executable('elixir') && executable('mix') +endfunction + +function! SyntaxCheckers_elixir_elixir_GetLocList() + + let make_options = {} + let compile_command = 'elixir' + let mix_file = syntastic#util#findInParent('mix.exs', expand('%:p:h')) + + if filereadable(mix_file) + let compile_command = 'mix compile' + let make_options['cwd'] = fnamemodify(mix_file, ':p:h') + endif + + let make_options['makeprg'] = syntastic#makeprg#build({ + \ 'exe': compile_command, + \ 'filetype': 'elixir', + \ 'subchecker': 'elixir' }) + + let make_options['errorformat'] = '** %*[^\ ] %f:%l: %m' + + return SyntasticMake(make_options) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'elixir', + \ 'name': 'elixir'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang.vim b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang.vim new file mode 100644 index 00000000..967b759d --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: erlang.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Pawel Salata +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_erlang_erlang_checker") + finish +endif +let g:loaded_syntastic_erlang_erlang_checker=1 + +let s:check_file = expand(':p:h') . '/erlang_check_file.erl' +if !exists("g:syntastic_erlc_include_path") + let g:syntastic_erlc_include_path="" +endif + +function! SyntaxCheckers_erlang_escript_IsAvailable() + return executable('escript') +endfunction + +function! SyntaxCheckers_erlang_escript_GetLocList() + let extension = expand('%:e') + if match(extension, 'hrl') >= 0 + return [] + endif + let shebang = getbufline(bufnr('%'), 1)[0] + if len(shebang) > 0 + if match(shebang, 'escript') >= 0 + let makeprg = 'escript -s ' . syntastic#util#shexpand('%:p') + else + let makeprg = 'escript ' . s:check_file . ' ' . syntastic#util#shexpand('%:p') . ' ' . g:syntastic_erlc_include_path + endif + else + let makeprg = 'escript ' . s:check_file . ' ' . syntastic#util#shexpand('%:p') . ' '. g:syntastic_erlc_include_path + endif + let errorformat = + \ '%f:%l:\ %tarning:\ %m,'. + \ '%E%f:%l:\ %m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'erlang', + \ 'name': 'escript'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl new file mode 100755 index 00000000..54cc9366 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl @@ -0,0 +1,34 @@ +#!/usr/bin/env escript +-export([main/1]). + +main([FileName]) -> + LibDirs = filelib:wildcard("{lib,deps}/*/ebin"), + compile(FileName, LibDirs); +main([FileName | LibDirs]) -> + compile(FileName, LibDirs). + +compile(FileName, LibDirs) -> + Root = get_root(filename:dirname(FileName)), + ok = code:add_pathsa(LibDirs), + compile:file(FileName, [warn_obsolete_guard, + warn_unused_import, + warn_shadow_vars, + warn_export_vars, + strong_validation, + report, + {i, filename:join(Root, "include")}, + {i, filename:join(Root, "deps")}, + {i, filename:join(Root, "apps")}, + {i, filename:join(Root, "lib")} + ]). + +get_root(Dir) -> + Path = filename:split(filename:absname(Dir)), + filename:join(get_root(lists:reverse(Path), Path)). + +get_root([], Path) -> + Path; +get_root(["src" | Tail], _Path) -> + lists:reverse(Tail); +get_root([_ | Tail], Path) -> + get_root(Tail, Path). diff --git a/sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim b/sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim new file mode 100644 index 00000000..3a772351 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: ruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_eruby_ruby_checker") + finish +endif +let g:loaded_syntastic_eruby_ruby_checker=1 + +if !exists("g:syntastic_ruby_exec") + let g:syntastic_ruby_exec = "ruby" +endif + +function! SyntaxCheckers_eruby_ruby_IsAvailable() + return executable(expand(g:syntastic_ruby_exec)) +endfunction + +function! SyntaxCheckers_eruby_ruby_GetLocList() + let exe = expand(g:syntastic_ruby_exec) + if !has('win32') + let exe = 'RUBYOPT= ' . exe + endif + + let fname = "'" . escape(expand('%'), "\\'") . "'" + + " TODO: encodings became useful in ruby 1.9 :) + if syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('ruby --version'), [1, 9]) + let enc = &fileencoding != '' ? &fileencoding : &encoding + let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"' + else + let encoding_spec = '' + endif + + "gsub fixes issue #7, rails has it's own eruby syntax + let makeprg = + \ exe . ' -rerb -e ' . + \ syntastic#util#shescape('puts ERB.new(File.read(' . + \ fname . encoding_spec . + \ ').gsub(''<\%='',''<\%''), nil, ''-'').src') . + \ ' \| ' . exe . ' -c' + + let errorformat = + \ '%-GSyntax OK,'. + \ '%E-:%l: syntax error\, %m,%Z%p^,'. + \ '%W-:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%-C%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'bufnr': bufnr(""), 'vcol': 1 } }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'eruby', + \ 'name': 'ruby'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/fortran/gfortran.vim b/sources_non_forked/syntastic/syntax_checkers/fortran/gfortran.vim new file mode 100644 index 00000000..0df45d3a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/fortran/gfortran.vim @@ -0,0 +1,63 @@ +"============================================================================ +"File: fortran.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Karl Yngve Lervåg +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"Note: This syntax checker uses gfortran with the option -fsyntax-only +" to check for errors and warnings. Additional flags may be +" supplied through both local and global variables, +" b:syntastic_fortran_flags, +" g:syntastic_fortran_flags. +" This is particularly useful when the source requires module files +" in order to compile (that is when it needs modules defined in +" separate files). +" +"============================================================================ + +if exists("g:loaded_syntastic_fortran_gfortran_checker") + finish +endif +let g:loaded_syntastic_fortran_gfortran_checker=1 + +if !exists('g:syntastic_fortran_flags') + let g:syntastic_fortran_flags = '' +endif + +function! SyntaxCheckers_fortran_gfortran_IsAvailable() + return executable('gfortran') +endfunction + +function! SyntaxCheckers_fortran_gfortran_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'gfortran', + \ 'args': s:args(), + \ 'filetype': 'fortran', + \ 'subchecker': 'gfortran' }) + + let errorformat = + \ '%-C %#,'. + \ '%-C %#%.%#,'. + \ '%A%f:%l.%c:,'. + \ '%Z%m,'. + \ '%G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +function s:args() + let rv = '-fsyntax-only ' . g:syntastic_fortran_flags + if exists('b:syntastic_fortran_flags') + let rv .= " " . b:syntastic_fortran_flags + endif + return rv +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'fortran', + \ 'name': 'gfortran'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/go/go.vim b/sources_non_forked/syntastic/syntax_checkers/go/go.vim new file mode 100644 index 00000000..e389012a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/go/go.vim @@ -0,0 +1,75 @@ +"============================================================================ +"File: go.vim +"Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]' +"Maintainer: Kamil Kisiel +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" This syntax checker does not reformat your source code. +" Use a BufWritePre autocommand to that end: +" autocmd FileType go autocmd BufWritePre Fmt +"============================================================================ +if exists("g:loaded_syntastic_go_go_checker") + finish +endif +let g:loaded_syntastic_go_go_checker=1 + +function! SyntaxCheckers_go_go_IsAvailable() + return executable('go') +endfunction + +function! SyntaxCheckers_go_go_GetLocList() + " Check with gofmt first, since `go build` and `go test` might not report + " syntax errors in the current file if another file with syntax error is + " compiled first. + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'gofmt', + \ 'args': '-l', + \ 'tail': '1>' . syntastic#util#DevNull(), + \ 'filetype': 'go', + \ 'subchecker': 'go' }) + + let errorformat = + \ '%f:%l:%c: %m,' . + \ '%-G%.%#' + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'e'} }) + if !empty(errors) + return errors + endif + + " Test files, i.e. files with a name ending in `_test.go`, are not + " compiled by `go build`, therefore `go test` must be called for those. + if match(expand('%'), '_test.go$') == -1 + let makeprg = 'go build ' . syntastic#c#GetNullDevice() + else + let makeprg = 'go test -c ' . syntastic#c#GetNullDevice() + endif + + let errorformat = + \ '%f:%l:%c:%m,' . + \ '%f:%l%m,' . + \ '%-G#%.%#' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h'), + \ 'defaults': {'type': 'e'} }) + + return errors +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'go'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim b/sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim new file mode 100644 index 00000000..b150916f --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: gofmt.vim +"Description: Check go syntax using 'gofmt -l' +"Maintainer: Brandon Thomson +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" This syntax checker does not reformat your source code. +" Use a BufWritePre autocommand to that end: +" autocmd FileType go autocmd BufWritePre Fmt +"============================================================================ +if exists("g:loaded_syntastic_go_gofmt_checker") + finish +endif +let g:loaded_syntastic_go_gofmt_checker=1 + +function! SyntaxCheckers_go_gofmt_IsAvailable() + return executable('gofmt') +endfunction + +function! SyntaxCheckers_go_gofmt_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'gofmt', + \ 'args': '-l', + \ 'tail': '1>' . syntastic#util#DevNull(), + \ 'filetype': 'go', + \ 'subchecker': 'gofmt' }) + + let errorformat = '%f:%l:%c: %m,%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'type': 'e'} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'gofmt'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/go/golint.vim b/sources_non_forked/syntastic/syntax_checkers/go/golint.vim new file mode 100644 index 00000000..954a7c2a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/go/golint.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: golint.vim +"Description: Check go syntax using 'golint' +"Maintainer: Hiroshi Ioka +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_go_golint_checker") + finish +endif +let g:loaded_syntastic_go_golint_checker=1 + +function! SyntaxCheckers_go_golint_IsAvailable() + return executable('golint') +endfunction + +function! SyntaxCheckers_go_golint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'golint', + \ 'filetype': 'go', + \ 'subchecker': 'golint' }) + + let errorformat = '%f:%l:%c: %m,%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'golint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/go/govet.vim b/sources_non_forked/syntastic/syntax_checkers/go/govet.vim new file mode 100644 index 00000000..4b1d7efb --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/go/govet.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: govet.vim +"Description: Perform static analysis of Go code with the vet tool +"Maintainer: Kamil Kisiel +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_go_govet_checker") + finish +endif +let g:loaded_syntastic_go_govet_checker=1 + +function! SyntaxCheckers_go_govet_IsAvailable() + return executable('go') +endfunction + +function! SyntaxCheckers_go_govet_GetLocList() + let makeprg = 'go vet' + let errorformat = '%Evet: %.%\+: %f:%l:%c: %m,%W%f:%l: %m,%-G%.%#' + + " The go compiler needs to either be run with an import path as an + " argument or directly from the package directory. Since figuring out + " the proper import path is fickle, just cwd to the package. + + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': expand('%:p:h'), + \ 'defaults': {'type': 'w'} }) + + return errors +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'go', + \ 'name': 'govet'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/haml/haml.vim b/sources_non_forked/syntastic/syntax_checkers/haml/haml.vim new file mode 100644 index 00000000..77d0a8dc --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/haml/haml.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: haml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_haml_haml_checker") + finish +endif +let g:loaded_syntastic_haml_haml_checker=1 + +if !exists("g:syntastic_haml_interpreter") + let g:syntastic_haml_interpreter = "haml" +endif + +function! SyntaxCheckers_haml_haml_IsAvailable() + return executable(g:syntastic_haml_interpreter) +endfunction + +function! SyntaxCheckers_haml_haml_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': g:syntastic_haml_interpreter, + \ 'args': '-c', + \ 'filetype': 'haml', + \ 'subchecker': 'haml' }) + + let errorformat = + \ 'Haml error on line %l: %m,' . + \ 'Syntax error on line %l: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haml', + \ 'name': 'haml'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/haskell/ghc-mod.vim b/sources_non_forked/syntastic/syntax_checkers/haskell/ghc-mod.vim new file mode 100644 index 00000000..f3677dc1 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/haskell/ghc-mod.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: ghc-mod.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_haskell_ghc_mod_checker") + finish +endif +let g:loaded_syntastic_haskell_ghc_mod_checker=1 + +function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() + return executable('ghc-mod') +endfunction + +function! SyntaxCheckers_haskell_ghc_mod_GetLocList() + let errorformat = + \ '%-G%\s%#,' . + \ '%f:%l:%c:%trror: %m,' . + \ '%f:%l:%c:%tarning: %m,'. + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c:%m,' . + \ '%E%f:%l:%c:,' . + \ '%Z%m' + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'ghc-mod check', + \ 'filetype': 'haskell', + \ 'subchecker': 'ghc_mod' }) + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'ghc_mod'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim b/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim new file mode 100644 index 00000000..3f4b0b73 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: hdevtools.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_haskell_hdevtools_checker") + finish +endif +let g:loaded_syntastic_haskell_hdevtools_checker=1 + +function! SyntaxCheckers_haskell_hdevtools_IsAvailable() + return executable('hdevtools') +endfunction + +function! SyntaxCheckers_haskell_hdevtools_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'hdevtools check', + \ 'args': get(g:, 'hdevtools_options', ''), + \ 'filetype': 'haskell', + \ 'subchecker': 'hdevtools' }) + + let errorformat= '\%-Z\ %#,'. + \ '%W%f:%l:%c:\ Warning:\ %m,'. + \ '%E%f:%l:%c:\ %m,'. + \ '%E%>%f:%l:%c:,'. + \ '%+C\ \ %#%m,'. + \ '%W%>%f:%l:%c:,'. + \ '%+C\ \ %#%tarning:\ %m,' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'hdevtools'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/haskell/hlint.vim b/sources_non_forked/syntastic/syntax_checkers/haskell/hlint.vim new file mode 100644 index 00000000..c748b77c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/haskell/hlint.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: hlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Nicolas Wu +"License: BSD +"============================================================================ + +if exists("g:loaded_syntastic_haskell_hlint_checker") + finish +endif +let g:loaded_syntastic_haskell_hlint_checker=1 + +function! SyntaxCheckers_haskell_hlint_IsAvailable() + return executable('hlint') +endfunction + +function! SyntaxCheckers_haskell_hlint_GetLocList() + let errorformat = + \ '%E%f:%l:%c: Error: %m,' . + \ '%W%f:%l:%c: Warning: %m,' . + \ '%C%m' + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'hlint', + \ 'filetype': 'haskell', + \ 'subchecker': 'hlint' }) + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'hlint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim b/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim new file mode 100644 index 00000000..969a9369 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: haxe.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: David Bernard +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_haxe_haxe_checker") + finish +endif +let g:loaded_syntastic_haxe_haxe_checker=1 + +function! SyntaxCheckers_haxe_haxe_IsAvailable() + return executable('haxe') +endfunction + +function! SyntaxCheckers_haxe_haxe_GetLocList() + if exists('b:vaxe_hxml') + let hxml = b:vaxe_hxml + elseif exists('g:vaxe_hxml') + let hxml = g:vaxe_hxml + else + let hxml = syntastic#util#findInParent('*.hxml', expand('%:p:h')) + endif + let hxml = fnamemodify(hxml, ':p') + + if !empty(hxml) + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'haxe', + \ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))), + \ 'filetype': 'haxe', + \ 'subchecker': 'haxe' }) + + let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'cwd': fnamemodify(hxml, ':h') }) + endif + + return [] +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haxe', + \ 'name': 'haxe'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/hss/hss.vim b/sources_non_forked/syntastic/syntax_checkers/hss/hss.vim new file mode 100644 index 00000000..5d2cf005 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/hss/hss.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: hss.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Justin Donaldson (jdonaldson@gmail.com) +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_hss_hss_checker") + finish +endif +let g:loaded_syntastic_hss_hss_checker=1 + +function! SyntaxCheckers_hss_hss_IsAvailable() + return executable('hss') +endfunction + +function! SyntaxCheckers_hss_hss_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'hss', + \ 'args' : '-output ' . syntastic#util#DevNull(), + \ 'filetype': 'hss', + \ 'subchecker': 'hss' }) + + let errorformat = '%E%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'hss', + \ 'name': 'hss'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/html/tidy.vim b/sources_non_forked/syntastic/syntax_checkers/html/tidy.vim new file mode 100644 index 00000000..27a97613 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/html/tidy.vim @@ -0,0 +1,174 @@ +"============================================================================ +"File: tidy.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" Checker option: +" +" - g:syntastic_html_tidy_ignore_errors (list; default: []) +" list of errors to ignore +" - g:syntastic_html_tidy_blocklevel_tags (list; default: []) +" list of additional blocklevel tags, to be added to "--new-blocklevel-tags" +" - g:syntastic_html_tidy_inline_tags (list; default: []) +" list of additional inline tags, to be added to "--new-inline-tags" +" - g:syntastic_html_tidy_empty_tags (list; default: []) +" list of additional empty tags, to be added to "--new-empty-tags" + +if exists("g:loaded_syntastic_html_tidy_checker") + finish +endif +let g:loaded_syntastic_html_tidy_checker = 1 + +if !exists('g:syntastic_html_tidy_ignore_errors') + let g:syntastic_html_tidy_ignore_errors = [] +endif + +if !exists('g:syntastic_html_tidy_blocklevel_tags') + let g:syntastic_html_tidy_blocklevel_tags = [] +endif + +if !exists('g:syntastic_html_tidy_inline_tags') + let g:syntastic_html_tidy_inline_tags = [] +endif + +if !exists('g:syntastic_html_tidy_empty_tags') + let g:syntastic_html_tidy_empty_tags = [] +endif + +function! SyntaxCheckers_html_tidy_IsAvailable() + return executable('tidy') +endfunction + +" TODO: join this with xhtml.vim for DRY's sake? +function! s:TidyEncOptByFenc() + let tidy_opts = { + \'utf-8' : '-utf8', + \'ascii' : '-ascii', + \'latin1' : '-latin1', + \'iso-2022-jp' : '-iso-2022', + \'cp1252' : '-win1252', + \'macroman' : '-mac', + \'utf-16le' : '-utf16le', + \'utf-16' : '-utf16', + \'big5' : '-big5', + \'cp932' : '-shiftjis', + \'sjis' : '-shiftjis', + \'cp850' : '-ibm858', + \} + return get(tidy_opts, &fileencoding, '-utf8') +endfunction + +let s:ignore_errors = [ + \ " lacks \"summary\" attribute", + \ "not approved by W3C", + \ "attribute \"placeholder\"", + \ " proprietary attribute \"charset\"", + \ " lacks \"content\" attribute", + \ "inserting \"type\" attribute", + \ "proprietary attribute \"data-", + \ "missing declaration", + \ "inserting implicit ", + \ "inserting missing 'title' element", + \ "attribute \"[+", + \ "unescaped & or unknown entity", + \ " attribute \"type\" has invalid value \"search\"" + \ ] + +let s:blocklevel_tags = [ + \ "main", + \ "section", + \ "article", + \ "aside", + \ "hgroup", + \ "header", + \ "footer", + \ "nav", + \ "figure", + \ "figcaption" + \ ] + +let s:inline_tags = [ + \ "video", + \ "audio", + \ "source", + \ "embed", + \ "mark", + \ "progress", + \ "meter", + \ "time", + \ "ruby", + \ "rt", + \ "rp", + \ "canvas", + \ "command", + \ "details", + \ "datalist" + \ ] + +let s:empty_tags = [ + \ "wbr", + \ "keygen" + \ ] + +function! s:IgnoreError(text) + for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors + if stridx(a:text, i) != -1 + return 1 + endif + endfor + return 0 +endfunction + +function! s:NewTags(name) + return syntastic#util#shescape(join( s:{a:name} + g:syntastic_html_tidy_{a:name}, ',' )) +endfunction + +function s:Args() + let args = s:TidyEncOptByFenc() . + \ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') . + \ ' --new-inline-tags ' . s:NewTags('inline_tags') . + \ ' --new-empty-tags ' . s:NewTags('empty_tags') . + \ ' -e' + return args +endfunction + +function! SyntaxCheckers_html_tidy_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'tidy', + \ 'args': s:Args(), + \ 'tail': '2>&1', + \ 'filetype': 'html', + \ 'subchecker': 'tidy' }) + + let errorformat = + \ '%Wline %l column %v - Warning: %m,' . + \ '%Eline %l column %v - Error: %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")}, + \ 'returns': [0, 1, 2] }) + + " filter out valid HTML5 from the errors + for n in range(len(loclist)) + if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1 + let loclist[n]['valid'] = 0 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'tidy'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/html/validator.vim b/sources_non_forked/syntastic/syntax_checkers/html/validator.vim new file mode 100644 index 00000000..7e24a17b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/html/validator.vim @@ -0,0 +1,78 @@ +"============================================================================ +"File: validator.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For detail;s about validator see: http://about.validator.nu/ +" +" Checker options: +" +" - g:syntastic_html_validator_api (string; default: 'http://validator.nu/') +" URL of the service to use for checking; leave it to the default to run the +" checks against http://validator.nu/, or set it to 'http://localhost:8888/' +" if you're running a local service as per http://about.validator.nu/#src +" +" - g:syntastic_html_validator_parser (string; default: empty) +" parser to use; legal values are: xml, xmldtd, html, html5, html4, html4tr; +" set it to 'html5' to check HTML5 files; see the wiki for reference: +" http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser +" +" - g:syntastic_html_validator_nsfilter (string; default: empty) +" sets the nsfilter for the parser; see the wiki for details: +" http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#nsfilter + +if exists("g:loaded_syntastic_html_validator_checker") + finish +endif +let g:loaded_syntastic_html_validator_checker=1 + +if !exists('g:syntastic_html_validator_api') + let g:syntastic_html_validator_api = 'http://validator.nu/' +endif + +if !exists('g:syntastic_html_validator_parser') + let g:syntastic_html_validator_parser = '' +endif + +if !exists('g:syntastic_html_validator_nsfilter') + let g:syntastic_html_validator_nsfilter = '' +endif + +let s:decoder = 'awk -f ' . syntastic#util#shescape(expand(':p:h') . '/validator_decode.awk') + +function! SyntaxCheckers_html_validator_IsAvailable() + return executable('curl') && executable('awk') +endfunction + +function! SyntaxCheckers_html_validator_GetLocList() + let makeprg = 'curl -s --compressed -F out=gnu -F asciiquotes=yes' . + \ (!empty(g:syntastic_html_validator_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') . + \ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') . + \ ' -F doc=@' . syntastic#util#shexpand('%') . '\;type=text/html\;filename=' . syntastic#util#shexpand('%') . ' ' . + \ g:syntastic_html_validator_api . ' \| ' . s:decoder + let errorformat = + \ '%E"%f":%l: %trror: %m,' . + \ '%E"%f":%l-%\d%\+: %trror: %m,' . + \ '%E"%f":%l%\%.%c: %trror: %m,' . + \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror: %m,' . + \ '%E"%f":%l: %trror fatal: %m,' . + \ '%E"%f":%l-%\d%\+: %trror fatal: %m,' . + \ '%E"%f":%l%\%.%c: %trror fatal: %m,' . + \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror fatal: %m,' . + \ '%W"%f":%l: info %tarning: %m,' . + \ '%W"%f":%l-%\d%\+: info %tarning: %m,' . + \ '%W"%f":%l%\%.%c: info %tarning: %m,' . + \ '%W"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: info %tarning: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'validator'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/html/validator_decode.awk b/sources_non_forked/syntastic/syntax_checkers/html/validator_decode.awk new file mode 100644 index 00000000..71db8067 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/html/validator_decode.awk @@ -0,0 +1,61 @@ +#!/usr/bin/awk -f +#============================================================================ +#File: validator_decode.awk +#Description: Helper script for validator.vim +#Maintainer: LCD 47 +#License: This program is free software. It comes without any warranty, +# to the extent permitted by applicable law. You can redistribute +# it and/or modify it under the terms of the Do What The Fuck You +# Want To Public License, Version 2, as published by Sam Hocevar. +# See http://sam.zoy.org/wtfpl/COPYING for more details. +# +#============================================================================ + +BEGIN { + FS = OFS = "\"" + hextab ["0"] = 0; hextab ["8"] = 8; + hextab ["1"] = 1; hextab ["9"] = 9; + hextab ["2"] = 2; hextab ["A"] = hextab ["a"] = 10 + hextab ["3"] = 3; hextab ["B"] = hextab ["b"] = 11; + hextab ["4"] = 4; hextab ["C"] = hextab ["c"] = 12; + hextab ["5"] = 5; hextab ["D"] = hextab ["d"] = 13; + hextab ["6"] = 6; hextab ["E"] = hextab ["e"] = 14; + hextab ["7"] = 7; hextab ["F"] = hextab ["f"] = 15; +} + +function urldecode (url) { + decoded = "" + i = 1 + len = length (url) + while ( i <= len ) { + c = substr (url, i, 1) + if ( c == "%" ) { + if ( i + 2 <= len ) { + c1 = substr (url, i + 1, 1) + c2 = substr (url, i + 2, 1) + if ( hextab [c1] != "" && hextab [c2] != "" ) { + code = 0 + hextab [c1] * 16 + hextab [c2] + 0 + c = sprintf ("%c", code) + } + else + c = c c1 c2 + i += 2 + } + else if ( i + 1 <= len ) { + c = substr (url, i, 2) + i++ + } + } + else if ( c == "+" ) + c = " " + decoded = decoded c + i++ + } + return decoded +} + +{ + $2 = urldecode($2) + gsub ("\\\\\"", "\"", $2) + print +} diff --git a/sources_non_forked/syntastic/syntax_checkers/html/w3.vim b/sources_non_forked/syntastic/syntax_checkers/html/w3.vim new file mode 100644 index 00000000..01c413cc --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/html/w3.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: w3.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" Checker option: +" +" - g:syntastic_html_w3_api (string; default: 'http://validator.w3.org/check') +" URL of the service to use for checking; leave it to the default to run the +" checks against http://validator.w3.org/, or set it to +" 'http://localhost/w3c-validator/check' if you're running a local service + +if exists("g:loaded_syntastic_html_w3_checker") + finish +endif +let g:loaded_syntastic_html_w3_checker = 1 + +if !exists('g:syntastic_html_w3_api') + let g:syntastic_html_w3_api = 'http://validator.w3.org/check' +endif + +function! SyntaxCheckers_html_w3_IsAvailable() + return executable('curl') +endfunction + +function! SyntaxCheckers_html_w3_GetLocList() + let makeprg = 'curl -s -F output=json ' . + \ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' . + \ g:syntastic_html_w3_api + + let errorformat = + \ '%A %\+{,' . + \ '%C %\+"lastLine": %l\,%\?,' . + \ '%C %\+"lastColumn": %c\,%\?,' . + \ '%C %\+"message": "%m"\,%\?,' . + \ '%C %\+"type": "%trror"\,%\?,' . + \ '%-G %\+"type": "%tnfo"\,%\?,' . + \ '%C %\+"subtype": "%tarning"\,%\?,' . + \ '%Z %\+}\,,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")}, + \ 'returns': [0] }) + + for n in range(len(loclist)) + let loclist[n]['text'] = substitute(loclist[n]['text'], '\\\([\"]\)', '\1', 'g') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'html', + \ 'name': 'w3'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/java/checkstyle.vim b/sources_non_forked/syntastic/syntax_checkers/java/checkstyle.vim new file mode 100644 index 00000000..da32c65c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/java/checkstyle.vim @@ -0,0 +1,60 @@ +"============================================================================ +"File: checkstyle.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Dmitry Geurkov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" Tested with checkstyle 5.5 +"============================================================================ +if exists("g:loaded_syntastic_java_checkstyle_checker") + finish +endif +let g:loaded_syntastic_java_checkstyle_checker=1 + +if !exists("g:syntastic_java_checkstyle_classpath") + let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar' +endif + +if !exists("g:syntastic_java_checkstyle_conf_file") + let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml' +endif + +function! SyntaxCheckers_java_checkstyle_IsAvailable() + return executable('java') +endfunction + +function! SyntaxCheckers_java_checkstyle_GetLocList() + + let fname = fnameescape( expand('%:p:h') . '/' . expand('%:t') ) + + if has('win32unix') + let fname = substitute(system('cygpath -m ' . fname), '\%x00', '', 'g') + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'java', + \ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . + \ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file, + \ 'fname': fname, + \ 'filetype': 'java', + \ 'subchecker': 'checkstyle' }) + + let errorformat = + \ '%f:%l:%c:\ %m,' . + \ '%f:%l:\ %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'postprocess': ['cygwinRemoveCR'] }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'java', + \ 'name': 'checkstyle'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/java/javac.vim b/sources_non_forked/syntastic/syntax_checkers/java/javac.vim new file mode 100644 index 00000000..122a6368 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/java/javac.vim @@ -0,0 +1,366 @@ +"============================================================================ +"File: javac.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jochen Keil +" Dmitry Geurkov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_java_javac_checker") + finish +endif +let g:loaded_syntastic_java_javac_checker=1 +let g:syntastic_java_javac_maven_pom_tags = ["build", "properties"] +let g:syntastic_java_javac_maven_pom_properties = {} + +" Global Options +if !exists("g:syntastic_java_javac_executable") + let g:syntastic_java_javac_executable = 'javac' +endif + +if !exists("g:syntastic_java_maven_executable") + let g:syntastic_java_maven_executable = 'mvn' +endif + +if !exists("g:syntastic_java_javac_options") + let g:syntastic_java_javac_options = '-Xlint' +endif + +if !exists("g:syntastic_java_javac_classpath") + let g:syntastic_java_javac_classpath = '' +endif + +if !exists("g:syntastic_java_javac_delete_output") + let g:syntastic_java_javac_delete_output = 1 +endif + +function! s:CygwinPath(path) + return substitute(system("cygpath -m ".a:path), '\%x00', '', 'g') +endfunction + +if !exists("g:syntastic_java_javac_temp_dir") + if has('win32') || has('win64') + let g:syntastic_java_javac_temp_dir = $TEMP."\\vim-syntastic-javac" + elseif has('win32unix') + let g:syntastic_java_javac_temp_dir = s:CygwinPath('/tmp/vim-syntastic-javac') + else + let g:syntastic_java_javac_temp_dir = '/tmp/vim-syntastic-javac' + endif +endif + +if !exists("g:syntastic_java_javac_autoload_maven_classpath") + let g:syntastic_java_javac_autoload_maven_classpath = 1 +endif + +if !exists('g:syntastic_java_javac_config_file_enabled') + let g:syntastic_java_javac_config_file_enabled = 0 +endif + +if !exists('g:syntastic_java_javac_config_file') + let g:syntastic_java_javac_config_file = '.syntastic_javac_config' +endif + +if !exists("g:syntastic_java_javac_maven_pom_ftime") + let g:syntastic_java_javac_maven_pom_ftime = {} +endif + +if !exists("g:syntastic_java_javac_maven_pom_classpath") + let g:syntastic_java_javac_maven_pom_classpath = {} +endif + +function! s:RemoveCarriageReturn(line) + return substitute(a:line, '\r', '', 'g') +endfunction + +" recursively remove directory and all it's sub-directories +function! s:RemoveDir(dir) + if isdirectory(a:dir) + for f in split(globpath(a:dir, '*'), "\n") + call s:RemoveDir(f) + endfor + silent! call system('rmdir ' . a:dir) + else + silent! call delete(a:dir) + endif +endfunction + +function! s:AddToClasspath(classpath,path) + if a:path == '' + return a:classpath + endif + if a:classpath != '' && a:path != '' + if has('win32') || has('win32unix') || has('win64') + return a:classpath . ";" . a:path + else + return a:classpath . ":" . a:path + endif + else + return a:path + endif +endfunction + +function! s:LoadClasspathFromConfigFile() + if filereadable(g:syntastic_java_javac_config_file) + let path = '' + let lines = readfile(g:syntastic_java_javac_config_file) + for l in lines + if l != '' + let path .= l . "\n" + endif + endfor + return path + else + return '' + endif +endfunction + +function! s:SaveClasspath() + let path = '' + let lines = getline(1, line('$')) + " save classpath to config file + if g:syntastic_java_javac_config_file_enabled + call writefile(lines,g:syntastic_java_javac_config_file) + endif + for l in lines + if l != '' + let path .= l . "\n" + endif + endfor + let g:syntastic_java_javac_classpath = path + let &modified = 0 +endfunction + +function! s:EditClasspath() + let command = 'syntastic javac classpath' + let winnr = bufwinnr('^' . command . '$') + if winnr < 0 + let pathlist = split(g:syntastic_java_javac_classpath,"\n") + execute (len(pathlist) + 5) . 'sp ' . fnameescape(command) + + augroup syntastic + autocmd BufWriteCmd call s:SaveClasspath() | bwipeout + augroup END + + setlocal buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number + for p in pathlist + call append(line('$') - 1, p) + endfor + else + execute winnr . 'wincmd w' + endif +endfunction + +function! s:GetMavenProperties() + let mvn_properties = {} + let pom = findfile("pom.xml", ".;") + if filereadable(pom) + if !has_key(g:syntastic_java_javac_maven_pom_properties, pom) + let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom + let mvn_is_managed_tag = 1 + let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n") + let current_path = 'project' + for line in mvn_settings_output + let matches = matchlist(line, '^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$') + if mvn_is_managed_tag && !empty(matches) + let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) >= 0 + let current_path .= '.' . matches[1] + else + let matches = matchlist(line, '^\s*\s*$') + if !empty(matches) + let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) < 0 + let current_path = substitute(current_path, '\.' . matches[1] . "$", '', '') + else + let matches = matchlist(line, '^\s*<\([a-zA-Z0-9\-\.]\+\)>\(.\+\)\s*$') + if mvn_is_managed_tag && !empty(matches) + let mvn_properties[current_path . '.' . matches[1]] = matches[2] + endif + endif + endif + endfor + let g:syntastic_java_javac_maven_pom_properties[pom] = mvn_properties + endif + return g:syntastic_java_javac_maven_pom_properties[pom] + endif + return mvn_properties +endfunction + +command! SyntasticJavacEditClasspath call s:EditClasspath() + +function! s:GetMavenClasspath() + let pom = findfile("pom.xml", ".;") + if filereadable(pom) + if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom) + let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom + let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n") + let class_path_next = 0 + + for line in mvn_classpath_output + if class_path_next == 1 + let mvn_classpath = s:RemoveCarriageReturn(line) + break + endif + if match(line,'Dependencies classpath:') >= 0 + let class_path_next = 1 + endif + endfor + + let mvn_properties = s:GetMavenProperties() + + let output_dir = 'target/classes' + if has_key(mvn_properties, 'project.build.outputDirectory') + let output_dir = mvn_properties['project.build.outputDirectory'] + endif + let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir) + + let test_output_dir = 'target/test-classes' + if has_key(mvn_properties, 'project.build.testOutputDirectory') + let test_output_dir = mvn_properties['project.build.testOutputDirectory'] + endif + let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir) + + let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom) + let g:syntastic_java_javac_maven_pom_classpath[pom] = mvn_classpath + endif + return g:syntastic_java_javac_maven_pom_classpath[pom] + endif + return '' +endfunction + +function! SyntaxCheckers_java_javac_IsAvailable() + return executable(g:syntastic_java_javac_executable) +endfunction + +function! s:MavenOutputDirectory() + let pom = findfile("pom.xml", ".;") + if filereadable(pom) + let mvn_properties = s:GetMavenProperties() + let output_dir = getcwd() + if has_key(mvn_properties, 'project.properties.build.dir') + let output_dir = mvn_properties['project.properties.build.dir'] + endif + if match(expand( '%:p:h' ), "src.main.java") >= 0 + let output_dir .= '/target/classes' + if has_key(mvn_properties, 'project.build.outputDirectory') + let output_dir = mvn_properties['project.build.outputDirectory'] + endif + endif + if match(expand( '%:p:h' ), "src.test.java") >= 0 + let output_dir .= '/target/test-classes' + if has_key(mvn_properties, 'project.build.testOutputDirectory') + let output_dir = mvn_properties['project.build.testOutputDirectory'] + endif + endif + + if has('win32unix') + let output_dir=s:CygwinPath(output_dir) + endif + return output_dir + endif +endfunction + +function! SyntaxCheckers_java_javac_GetLocList() + + let javac_opts = g:syntastic_java_javac_options + + if g:syntastic_java_javac_delete_output + let output_dir = g:syntastic_java_javac_temp_dir + let javac_opts .= ' -d ' . output_dir + endif + + " load classpath from config file + if g:syntastic_java_javac_config_file_enabled + let loaded_classpath = s:LoadClasspathFromConfigFile() + if loaded_classpath != '' + let g:syntastic_java_javac_classpath = loaded_classpath + endif + endif + + let javac_classpath = '' + + " add classpathes to javac_classpath + for path in split(g:syntastic_java_javac_classpath,"\n") + if path != '' + try + let ps = glob(path,0,1) + catch + let ps = split(glob(path,0),"\n") + endtry + if type(ps) == type([]) + for p in ps + if p != '' + let javac_classpath = s:AddToClasspath(javac_classpath,p) + endif + endfor + else + let javac_classpath = s:AddToClasspath(javac_classpath,ps) + endif + endif + endfor + + if g:syntastic_java_javac_autoload_maven_classpath + if !g:syntastic_java_javac_delete_output + let maven_output_dir = s:MavenOutputDirectory() + let javac_opts .= ' -d ' . maven_output_dir + endif + let maven_classpath = s:GetMavenClasspath() + let javac_classpath = s:AddToClasspath(javac_classpath,maven_classpath) + endif + + if javac_classpath != '' + let javac_opts .= ' -cp "' . fnameescape(javac_classpath) . '"' + endif + + " path seperator + if has('win32') || has('win32unix') || has('win64') + let sep = "\\" + else + let sep = '/' + endif + + let fname = fnameescape(expand ( '%:p:h' ) . sep . expand ( '%:t' )) + + if has('win32unix') + let fname = s:CygwinPath(fname) + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': g:syntastic_java_javac_executable, + \ 'args': javac_opts, + \ 'fname': fname, + \ 'tail': '2>&1', + \ 'filetype': 'java', + \ 'subchecker': 'javac' }) + + " unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types + let errorformat = + \ '%E%f:%l:\ error:\ %m,'. + \ '%W%f:%l:\ warning:\ %m,'. + \ '%A%f:%l:\ %m,'. + \ '%+Z%p^,'. + \ '%+C%.%#,'. + \ '%-G%.%#' + + if g:syntastic_java_javac_delete_output + silent! call mkdir(output_dir,'p') + endif + let errors = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['cygwinRemoveCR'] }) + + if g:syntastic_java_javac_delete_output + call s:RemoveDir(output_dir) + endif + return errors + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'java', + \ 'name': 'javac'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/closurecompiler.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/closurecompiler.vim new file mode 100644 index 00000000..6c55f4f2 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/closurecompiler.vim @@ -0,0 +1,66 @@ +"============================================================================ +"File: closurecompiler.vim +"Description: Javascript syntax checker - using Google Closure Compiler +"Maintainer: Motohiro Takayama +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" To enable this plugin, edit the .vimrc like this: +" +" let g:syntastic_javascript_checker = "closurecompiler" +" +" and set the path to the Google Closure Compiler: +" +" let g:syntastic_javascript_closure_compiler_path = '/path/to/google-closure-compiler.jar' +" +" It takes additional options for Google Closure Compiler with the variable +" g:syntastic_javascript_closure_compiler_options. +" + +if exists("g:loaded_syntastic_javascript_closurecompiler_checker") + finish +endif +let g:loaded_syntastic_javascript_closurecompiler_checker=1 + +if !exists("g:syntastic_javascript_closure_compiler_options") + let g:syntastic_javascript_closure_compiler_options = "" +endif + +function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() + return exists("g:syntastic_javascript_closure_compiler_path") +endfunction + +function! SyntaxCheckers_javascript_closurecompiler_GetLocList() + if exists("g:syntastic_javascript_closure_compiler_file_list") + let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ') + else + let file_list = syntastic#util#shexpand('%') + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'java -jar ' . g:syntastic_javascript_closure_compiler_path, + \ 'args': g:syntastic_javascript_closure_compiler_options . ' --js' , + \ 'fname': file_list, + \ 'filetype': 'javascript', + \ 'subchecker': 'closurecompiler' }) + + let errorformat = + \ '%-GOK,'. + \ '%E%f:%l: ERROR - %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: WARNING - %m,'. + \ '%Z%p^' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'closurecompiler'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/gjslint.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/gjslint.vim new file mode 100644 index 00000000..039d0eed --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/gjslint.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: gjslint.vim +"Description: Javascript syntax checker - using gjslint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if exists("g:loaded_syntastic_javascript_gjslint_checker") + finish +endif +let g:loaded_syntastic_javascript_gjslint_checker=1 + +if !exists("g:syntastic_javascript_gjslint_conf") + let g:syntastic_javascript_gjslint_conf = "" +endif + +function! SyntaxCheckers_javascript_gjslint_IsAvailable() + return executable('gjslint') +endfunction + +function! SyntaxCheckers_javascript_gjslint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'gjslint', + \ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep", + \ 'filetype': 'javascript', + \ 'subchecker': 'gjslint' }) + + let errorformat = + \ "%f:%l:(New Error -%\\?\%n) %m," . + \ "%f:%l:(-%\\?%n) %m," . + \ "%-G1 files checked," . + \ " no errors found.," . + \ "%-G%.%#" + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'gjslint'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/jshint.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/jshint.vim new file mode 100644 index 00000000..e98e5628 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/jshint.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: jshint.vim +"Description: Javascript syntax checker - using jshint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ + +if exists("g:loaded_syntastic_javascript_jshint_checker") + finish +endif +let g:loaded_syntastic_javascript_jshint_checker=1 + +if !exists("g:syntastic_javascript_jshint_conf") + let g:syntastic_javascript_jshint_conf = "" +endif + +function! SyntaxCheckers_javascript_jshint_IsAvailable() + return executable('jshint') +endfunction + +function! SyntaxCheckers_javascript_jshint_GetLocList() + let jshint_new = s:JshintNew() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'jshint', + \ 'post_args': (jshint_new ? ' --verbose ' : '') . s:Args(), + \ 'filetype': 'javascript', + \ 'subchecker': 'jshint' }) + + let errorformat = jshint_new ? + \ '%f: line %l\, col %c\, %m \(%t%*\d\)' : + \ '%E%f: line %l\, col %c\, %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +function s:JshintNew() + return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1]) +endfunction + +function s:Args() + " node-jshint uses .jshintrc as config unless --config arg is present + return !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : '' +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jshint'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/jsl.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/jsl.vim new file mode 100644 index 00000000..bef1b89a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/jsl.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: jsl.vim +"Description: Javascript syntax checker - using jsl +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if exists("g:loaded_syntastic_javascript_jsl_checker") + finish +endif +let g:loaded_syntastic_javascript_jsl_checker=1 + +if !exists("g:syntastic_javascript_jsl_conf") + let g:syntastic_javascript_jsl_conf = "" +endif + +function s:ConfFlag() + if !empty(g:syntastic_javascript_jsl_conf) + return "-conf " . g:syntastic_javascript_jsl_conf + endif + + return "" +endfunction + +function! SyntaxCheckers_javascript_jsl_IsAvailable() + return executable('jsl') +endfunction + +function! SyntaxCheckers_javascript_jsl_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'jsl', + \ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process", + \ 'filetype': 'javascript', + \ 'subchecker': 'jsl' }) + + let errorformat = + \ '%W%f(%l): lint warning: %m,'. + \ '%-Z%p^,'. + \ '%W%f(%l): warning: %m,'. + \ '%-Z%p^,'. + \ '%E%f(%l): SyntaxError: %m,'. + \ '%-Z%p^,'. + \ '%-G' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jsl'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim new file mode 100644 index 00000000..ab6469d4 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: jslint.vim +"Description: Javascript syntax checker - using jslint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"Tested with jslint 0.1.4. +"============================================================================ +if exists("g:loaded_syntastic_javascript_jslint_checker") + finish +endif +let g:loaded_syntastic_javascript_jslint_checker=1 + +if !exists("g:syntastic_javascript_jslint_conf") + let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars" +endif + +function! SyntaxCheckers_javascript_jslint_IsAvailable() + return executable('jslint') +endfunction + +function! SyntaxCheckers_javascript_jslint_HighlightTerm(error) + let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'') + if len(unexpected) < 1 | return '' | end + return '\V'.split(unexpected, "'")[1] +endfunction + +function! SyntaxCheckers_javascript_jslint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'jslint', + \ 'args': g:syntastic_javascript_jslint_conf, + \ 'filetype': 'javascript', + \ 'subchecker': 'jslint' }) + + let errorformat = + \ '%E %##%n %m,'. + \ '%-Z%.%#Line %l\, Pos %c,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'javascript', + \ 'name': 'jslint'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/json/jsonlint.vim b/sources_non_forked/syntastic/syntax_checkers/json/jsonlint.vim new file mode 100644 index 00000000..7c6b34d5 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/json/jsonlint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: jsonlint.vim +"Description: JSON syntax checker - using jsonlint +"Maintainer: Miller Medeiros +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ + +if exists("g:loaded_syntastic_json_jsonlint_checker") + finish +endif +let g:loaded_syntastic_json_jsonlint_checker=1 + +function! SyntaxCheckers_json_jsonlint_IsAvailable() + return executable('jsonlint') +endfunction + +function! SyntaxCheckers_json_jsonlint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'jsonlint', + \ 'post_args': '--compact', + \ 'filetype': 'json', + \ 'subchecker': 'jsonlint' }) + + let errorformat = + \ '%ELine %l:%c,'. + \ '%Z\\s%#Reason: %m,'. + \ '%C%.%#,'. + \ '%f: line %l\, col %c\, %m,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'json', + \ 'name': 'jsonlint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/json/jsonval.vim b/sources_non_forked/syntastic/syntax_checkers/json/jsonval.vim new file mode 100644 index 00000000..4359e86c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/json/jsonval.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: jsonval.vim +"Description: JSON syntax checker - using jsonval +"Maintainer: Miller Medeiros +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ + +if exists("g:loaded_syntastic_json_jsonval_checker") + finish +endif +let g:loaded_syntastic_json_jsonval_checker=1 + +function! SyntaxCheckers_json_jsonval_IsAvailable() + return executable('jsonval') +endfunction + +function! SyntaxCheckers_json_jsonval_GetLocList() + " based on https://gist.github.com/1196345 + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'jsonval', + \ 'filetype': 'json', + \ 'subchecker': 'jsonval' }) + + let errorformat = + \ '%E%f:\ %m\ at\ line\ %l,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'json', + \ 'name': 'jsonval'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/less/less-lint.coffee b/sources_non_forked/syntastic/syntax_checkers/less/less-lint.coffee new file mode 100644 index 00000000..0b05e4a7 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/less/less-lint.coffee @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +fs = require 'fs' +less = require 'less' +args = process.argv.slice(1) +options = {} + +args = args.filter (arg) -> + match = arg.match(/^-I(.+)$/) + if match + options.paths.push(match[1]); + return false + + match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i) + if match + arg = match[1] + else + return arg + + switch arg + when 'strict-imports' then options.strictImports = true + when 'include-path' + options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':') + .map (p) -> + if p + return path.resolve(process.cwd(), p) + when 'O0' then options.optimization = 0 + when 'O1' then options.optimization = 1 + when 'O2' then options.optimization = 2 + +options.filename = args[1] + +parser = new(less.Parser) options + +fs.readFile(options.filename, 'utf-8', (err,data) -> + parser.parse(data, (err, tree) -> + if err + less.writeError err + process.exit(1) + ) +) diff --git a/sources_non_forked/syntastic/syntax_checkers/less/less-lint.js b/sources_non_forked/syntastic/syntax_checkers/less/less-lint.js new file mode 100644 index 00000000..5abc653c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/less/less-lint.js @@ -0,0 +1,57 @@ +// Generated by CoffeeScript 1.3.3 +(function() { + var args, fs, less, options, parser; + + fs = require('fs'); + + less = require('less'); + + args = process.argv.slice(1); + + options = {}; + + args = args.filter(function(arg) { + var match; + match = arg.match(/^-I(.+)$/); + if (match) { + options.paths.push(match[1]); + return false; + } + match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i); + if (match) { + arg = match[1]; + } else { + return arg; + } + switch (arg) { + case 'strict-imports': + return options.strictImports = true; + case 'include-path': + return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) { + if (p) { + return path.resolve(process.cwd(), p); + } + }); + case 'O0': + return options.optimization = 0; + case 'O1': + return options.optimization = 1; + case 'O2': + return options.optimization = 2; + } + }); + + options.filename = args[1]; + + parser = new less.Parser(options); + + fs.readFile(options.filename, 'utf-8', function(err, data) { + return parser.parse(data, function(err, tree) { + if (err) { + less.writeError(err); + return process.exit(1); + } + }); + }); + +}).call(this); diff --git a/sources_non_forked/syntastic/syntax_checkers/less/lessc.vim b/sources_non_forked/syntastic/syntax_checkers/less/lessc.vim new file mode 100644 index 00000000..001be351 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/less/lessc.vim @@ -0,0 +1,61 @@ +"============================================================================ +"File: less.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Julien Blanchard +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" To send additional options to less use the variable g:syntastic_less_options. +" The default is +" let g:syntastic_less_options = "--no-color" +" +" To use less-lint instead of less set the variable +" g:syntastic_less_use_less_lint. + +if exists("g:loaded_syntastic_less_lessc_checker") + finish +endif +let g:loaded_syntastic_less_lessc_checker=1 + +if !exists("g:syntastic_less_options") + let g:syntastic_less_options = "--no-color" +endif + +if !exists("g:syntastic_less_use_less_lint") + let g:syntastic_less_use_less_lint = 0 +endif + +if g:syntastic_less_use_less_lint + let s:check_file = 'node ' . expand(':p:h') . '/less-lint.js' +else + let s:check_file = 'lessc' +end + +function! SyntaxCheckers_less_lessc_IsAvailable() + return executable('lessc') +endfunction + +function! SyntaxCheckers_less_lessc_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': s:check_file, + \ 'args': g:syntastic_less_options, + \ 'tail': syntastic#util#DevNull(), + \ 'filetype': 'less', + \ 'subchecker': 'lessc' }) + + let errorformat = '%m in %f:%l:%c' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'less', + \ 'name': 'lessc'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim b/sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim new file mode 100644 index 00000000..caf094f1 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: lisp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Karl Yngve Lervåg +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_lisp_clisp_checker") + finish +endif +let g:loaded_syntastic_lisp_clisp_checker=1 + +function! SyntaxCheckers_lisp_clisp_IsAvailable() + return executable("clisp") +endfunction + +function! SyntaxCheckers_lisp_clisp_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'clisp', + \ 'args': '-q -c', + \ 'tail': '-o /tmp/clisp-vim-compiled-file', + \ 'filetype': 'lisp', + \ 'subchecker': 'clisp' }) + + let errorformat = + \ '%-G;%.%#,' . + \ '%W%>WARNING:%.%#line %l : %m,' . + \ '%Z %#%m,' . + \ '%W%>WARNING:%.%#lines %l..%\d\# : %m,' . + \ '%Z %#%m,' . + \ '%E%>The following functions were %m,' . + \ '%Z %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr('')} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lisp', + \ 'name': 'clisp'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim b/sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim new file mode 100644 index 00000000..ea4fa04b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: llvm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Andrew Kelley +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_llvm_llvm_checker") + finish +endif +let g:loaded_syntastic_llvm_llvm_checker=1 + +function! SyntaxCheckers_llvm_llvm_IsAvailable() + return executable("llc") +endfunction + +function! SyntaxCheckers_llvm_llvm_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'llc', + \ 'args': syntastic#c#GetNullDevice(), + \ 'filetype': 'llvm', + \ 'subchecker': 'llvm' }) + + let errorformat = 'llc: %f:%l:%c: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'llvm', + \ 'name': 'llvm'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim new file mode 100644 index 00000000..c26e520a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim @@ -0,0 +1,64 @@ +"============================================================================ +"File: lua.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_lua_luac_checker") + finish +endif +let g:loaded_syntastic_lua_luac_checker=1 + +function! SyntaxCheckers_lua_luac_IsAvailable() + return executable('luac') +endfunction + +function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) + let near = matchstr(a:pos['text'], "near '[^']\\+'") + let result = '' + if len(near) > 0 + let near = split(near, "'")[1] + if near == '' + let p = getpos('$') + let a:pos['lnum'] = p[1] + let a:pos['col'] = p[2] + let result = '\%'.p[2].'c' + else + let result = '\V'.near + endif + let open = matchstr(a:pos['text'], "(to close '[^']\\+' at line [0-9]\\+)") + if len(open) > 0 + let oline = split(open, "'")[1:2] + let line = 0+strpart(oline[1], 9) + call matchadd('SpellCap', '\%'.line.'l\V'.oline[0]) + endif + endif + return result +endfunction + + +function! SyntaxCheckers_lua_luac_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'luac', + \ 'args': '-p', + \ 'filetype': 'lua', + \ 'subchecker': 'luac' }) + + let errorformat = 'luac: %#%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'lua', + \ 'name': 'luac'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/matlab/mlint.vim b/sources_non_forked/syntastic/syntax_checkers/matlab/mlint.vim new file mode 100644 index 00000000..380d22c8 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/matlab/mlint.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: matlab.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jason Graham +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_matlab_mlint_checker") + finish +endif +let g:loaded_syntastic_matlab_mlint_checker=1 + +function! SyntaxCheckers_matlab_mlint_IsAvailable() + return executable("mlint") +endfunction + +function! SyntaxCheckers_matlab_mlint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'mlint', + \ 'args': '-id $*', + \ 'filetype': 'matlab', + \ 'subchecker': 'mlint' }) + + let errorformat = + \ 'L %l (C %c): %*[a-zA-Z0-9]: %m,'. + \ 'L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'matlab', + \ 'name': 'mlint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim b/sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim new file mode 100644 index 00000000..9c6195cf --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: nasm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Håvard Pettersson +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_nasm_nasm_checker") + finish +endif +let g:loaded_syntastic_nasm_nasm_checker=1 + +function! SyntaxCheckers_nasm_nasm_IsAvailable() + return executable("nasm") +endfunction + +function! SyntaxCheckers_nasm_nasm_GetLocList() + let wd = syntastic#util#shescape(expand("%:p:h") . "/") + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'nasm', + \ 'args': '-X gnu -f elf -I ' . wd . ' ' . syntastic#c#GetNullDevice() + \ 'filetype': 'nasm', + \ 'subchecker': 'nasm' }) + + let errorformat = '%f:%l: %t%*[^:]: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nasm', + \ 'name': 'nasm'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/nroff/mandoc.vim b/sources_non_forked/syntastic/syntax_checkers/nroff/mandoc.vim new file mode 100644 index 00000000..3333d24e --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/nroff/mandoc.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: mandoc.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_nroff_mandoc_checker") + finish +endif +let g:loaded_syntastic_nroff_mandoc_checker=1 + +function! SyntaxCheckers_nroff_mandoc_IsAvailable() + return executable("mandoc") +endfunction + +function! SyntaxCheckers_nroff_mandoc_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'mandoc', + \ 'args': '-Tlint', + \ 'filetype': 'nroff', + \ 'subchecker': 'mandoc' }) + + let errorformat = + \ '%E%f:%l:%c: %tRROR: %m,' . + \ '%W%f:%l:%c: %tARNING: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2, 3, 4] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'nroff', + \ 'name': 'mandoc'}) + diff --git a/sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim b/sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim new file mode 100644 index 00000000..e16822f3 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim @@ -0,0 +1,184 @@ +"============================================================================ +"File: objc.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" (this usually creates a .gch file in your source directory) +" +" let g:syntastic_objc_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_objc_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_objc_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_objc_includes. Then the header files are being re-checked on +" the next file write. +" +" let g:syntastic_objc_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_objc_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_objc_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_objc_include_dirs. This list can be used like this: +" +" let g:syntastic_objc_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_objc_compiler_options': +" +" let g:syntastic_objc_compiler_options = ' -ansi' +" +" Additionally the setting 'g:syntastic_objc_config_file' allows you to define a +" file that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_objc_config': +" +" let g:syntastic_objc_config_file = '.config' +" +" Using the global variable 'g:syntastic_objc_remove_include_errors' you can +" specify whether errors of files included via the g:syntastic_objc_include_dirs' +" setting are removed from the result set: +" +" let g:syntastic_objc_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_objc_errorformat' to override the default error +" format: +" +" let g:syntastic_objc_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to gcc) +" +" let g:syntastic_objc_compiler = 'clang' + +if exists('g:loaded_syntastic_objc_gcc_checker') + finish +endif +let g:loaded_syntastic_objc_gcc_checker = 1 + +if !exists('g:syntastic_objc_compiler') + let g:syntastic_objc_compiler = 'gcc' +endif + +function! SyntaxCheckers_objc_gcc_IsAvailable() + return executable(g:syntastic_objc_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_objc_compiler_options') + let g:syntastic_objc_compiler_options = '-std=gnu99' +endif + +if !exists('g:syntastic_objc_config_file') + let g:syntastic_objc_config_file = '.syntastic_objc_config' +endif + +function! SyntaxCheckers_objc_gcc_GetLocList() + let makeprg = g:syntastic_objc_compiler . ' -x objective-c -fsyntax-only -lobjc' + let errorformat = + \ '%-G%f:%s:,' . + \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . + \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . + \ '%-GIn file included%.%#,'. + \ '%-G %#from %f:%l\,,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,' . + \ '%f:%l: %m' + + if exists('g:syntastic_objc_errorformat') + let errorformat = g:syntastic_objc_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_objc_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('objc') + + " determine whether to parse header files as well + if expand('%') =~? '\.h$' + if exists('g:syntastic_objc_check_header') + let makeprg = g:syntastic_objc_compiler . + \ ' -x objective-c-header ' . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' ' . g:syntastic_objc_compiler_options . + \ ' ' . syntastic#c#GetIncludeDirs('objc') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_objc_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_objc_no_include_search') || + \ g:syntastic_objc_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_objc_auto_refresh_includes') && + \ g:syntastic_objc_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_objc_includes') + let b:syntastic_objc_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_objc_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_objc_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_objc_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_objc_remove_include_errors') && + \ g:syntastic_objc_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objc', + \ 'name': 'gcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim b/sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim new file mode 100644 index 00000000..0ebd6612 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: oclint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: "UnCO" Lin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_oclint_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_oclint_config': +" +" let g:syntastic_oclint_config_file = '.config' + +if exists("g:loaded_syntastic_objc_oclint_checker") + finish +endif +let g:loaded_syntastic_objc_oclint_checker = 1 + +function! SyntaxCheckers_objc_oclint_IsAvailable() + return SyntaxCheckers_c_oclint_IsAvailable() +endfunction + +function! SyntaxCheckers_objc_oclint_GetLocList() + return SyntaxCheckers_c_oclint_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objc', + \ 'name': 'oclint'}) + +runtime! syntax_checkers/c/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/objc/ycm.vim b/sources_non_forked/syntastic/syntax_checkers/objc/ycm.vim new file mode 100644 index 00000000..40f53fb4 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objc/ycm.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: ycm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Val Markovic +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_objc_ycm_checker") + finish +endif +let g:loaded_syntastic_objc_ycm_checker = 1 + +runtime! syntax_checkers/c/*.vim + +function! SyntaxCheckers_objc_ycm_IsAvailable() + return SyntaxCheckers_c_ycm_IsAvailable() +endfunction + +if !exists('g:loaded_youcompleteme') + finish +endif + +function! SyntaxCheckers_objc_ycm_GetLocList() + return SyntaxCheckers_c_ycm_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objc', + \ 'name': 'ycm'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim b/sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim new file mode 100644 index 00000000..889a5973 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim @@ -0,0 +1,184 @@ +"============================================================================ +"File: objcpp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" (this usually creates a .gch file in your source directory) +" +" let g:syntastic_objcpp_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_objcpp_no_include_search = 1 +" +" To disable the include of the default include dirs (such as /usr/include) +" add this line to your .vimrc: +" +" let g:syntastic_objcpp_no_default_include_dirs = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_objcpp_includes. Then the header files are being re-checked on +" the next file write. +" +" let g:syntastic_objcpp_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_objcpp_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_objcpp_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_objcpp_include_dirs. This list can be used like this: +" +" let g:syntastic_objcpp_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_objcpp_compiler_options': +" +" let g:syntastic_objcpp_compiler_options = ' -ansi' +" +" Additionally the setting 'g:syntastic_objcpp_config_file' allows you to define a +" file that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_objcpp_config': +" +" let g:syntastic_objcpp_config_file = '.config' +" +" Using the global variable 'g:syntastic_objcpp_remove_include_errors' you can +" specify whether errors of files included via the g:syntastic_objcpp_include_dirs' +" setting are removed from the result set: +" +" let g:syntastic_objcpp_remove_include_errors = 1 +" +" Use the variable 'g:syntastic_objcpp_errorformat' to override the default error +" format: +" +" let g:syntastic_objcpp_errorformat = '%f:%l:%c: %trror: %m' +" +" Set your compiler executable with e.g. (defaults to gcc) +" +" let g:syntastic_objcpp_compiler = 'clang' + +if exists('g:loaded_syntastic_objcpp_gcc_checker') + finish +endif +let g:loaded_syntastic_objcpp_gcc_checker = 1 + +if !exists('g:syntastic_objcpp_compiler') + let g:syntastic_objcpp_compiler = 'gcc' +endif + +function! SyntaxCheckers_objcpp_gcc_IsAvailable() + return executable(g:syntastic_objcpp_compiler) +endfunction + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_objcpp_compiler_options') + let g:syntastic_objcpp_compiler_options = '-std=gnu99' +endif + +if !exists('g:syntastic_objcpp_config_file') + let g:syntastic_objcpp_config_file = '.syntastic_objcpp_config' +endif + +function! SyntaxCheckers_objcpp_gcc_GetLocList() + let makeprg = g:syntastic_objcpp_compiler . ' -x objective-c++ -fsyntax-only -lobjc' + let errorformat = + \ '%-G%f:%s:,' . + \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . + \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . + \ '%-GIn file included%.%#,'. + \ '%-G %#from %f:%l\,,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,' . + \ '%f:%l: %m' + + if exists('g:syntastic_objcpp_errorformat') + let errorformat = g:syntastic_objcpp_errorformat + endif + + " add optional user-defined compiler options + let makeprg .= g:syntastic_objcpp_compiler_options + + let makeprg .= ' ' . syntastic#util#shexpand('%') . + \ ' ' . syntastic#c#GetIncludeDirs('objcpp') + + " determine whether to parse header files as well + if expand('%') =~? '\.h$' + if exists('g:syntastic_objcpp_check_header') + let makeprg = g:syntastic_objcpp_compiler . + \ ' -x objective-c++-header ' . + \ ' -c ' . syntastic#util#shexpand('%') . + \ ' ' . g:syntastic_objcpp_compiler_options . + \ ' ' . syntastic#c#GetIncludeDirs('objcpp') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_objcpp_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_objcpp_no_include_search') || + \ g:syntastic_objcpp_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_objcpp_auto_refresh_includes') && + \ g:syntastic_objcpp_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_objcpp_includes') + let b:syntastic_objcpp_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_objcpp_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_objcpp_cflags + endif + + " add optional config file parameters + let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_objcpp_config_file) + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_objcpp_remove_include_errors') && + \ g:syntastic_objcpp_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objcpp', + \ 'name': 'gcc'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/syntax_checkers/objcpp/oclint.vim b/sources_non_forked/syntastic/syntax_checkers/objcpp/oclint.vim new file mode 100644 index 00000000..a46fe045 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objcpp/oclint.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: oclint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: "UnCO" Lin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +" +" The setting 'g:syntastic_oclint_config_file' allows you to define a file +" that contains additional compiler arguments like include directories or +" CFLAGS. The file is expected to contain one option per line. If none is +" given the filename defaults to '.syntastic_oclint_config': +" +" let g:syntastic_oclint_config_file = '.config' + +if exists("g:loaded_syntastic_objcpp_oclint_checker") + finish +endif +let g:loaded_syntastic_objcpp_oclint_checker = 1 + +function! SyntaxCheckers_objcpp_oclint_IsAvailable() + return SyntaxCheckers_c_oclint_IsAvailable() +endfunction + +function! SyntaxCheckers_objcpp_oclint_GetLocList() + return SyntaxCheckers_c_oclint_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objcpp', + \ 'name': 'oclint'}) + +runtime! syntax_checkers/c/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/objcpp/ycm.vim b/sources_non_forked/syntastic/syntax_checkers/objcpp/ycm.vim new file mode 100644 index 00000000..c9a0e458 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/objcpp/ycm.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: ycm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Val Markovic +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_objcpp_ycm_checker") + finish +endif +let g:loaded_syntastic_objcpp_ycm_checker = 1 + +runtime! syntax_checkers/c/*.vim + +function! SyntaxCheckers_objcpp_ycm_IsAvailable() + return SyntaxCheckers_c_ycm_IsAvailable() +endfunction + +if !exists('g:loaded_youcompleteme') + finish +endif + +function! SyntaxCheckers_objcpp_ycm_GetLocList() + return SyntaxCheckers_c_ycm_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'objcpp', + \ 'name': 'ycm'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim b/sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim new file mode 100644 index 00000000..ebec5cb7 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim @@ -0,0 +1,149 @@ +"============================================================================ +"File: ocaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Török Edwin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" The more reliable way to check for a single .ml file is to use ocamlc. +" You can do that setting this in your .vimrc: +" +" let g:syntastic_ocaml_use_ocamlc = 1 +" It's possible to use ocamlc in conjuction with Jane Street's Core. In order +" to do that, you have to specify this in your .vimrc: +" +" let g:syntastic_ocaml_use_janestreet_core = 1 +" let g:syntastic_ocaml_janestreet_core_dir = +" +" Where path is the path to your core installation (usually a collection of +" .cmx and .cmxa files). +" +" +" By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files, +" ocamllex is used to check .mll files and menhir is used to check .mly files. +" The output is all redirected to /dev/null, nothing is written to the disk. +" +" If your source code needs camlp4r then you can define this in your .vimrc: +" +" let g:syntastic_ocaml_camlp4r = 1 +" +" If you used some syntax extensions, or you want to also typecheck the source +" code, then you can define this: +" +" let g:syntastic_ocaml_use_ocamlbuild = 1 +" +" This will run ocamlbuild .inferred.mli, so it will write to your _build +" directory (and possibly rebuild your myocamlbuild.ml plugin), only enable this +" if you are ok with that. +" +" If you are using syntax extensions / external libraries and have a properly +" set up _tags (and myocamlbuild.ml file) then it should just work +" to enable this flag and get syntax / type checks through syntastic. +" +" For best results your current directory should be the project root +" (same situation if you want useful output from :make). + +if exists("g:loaded_syntastic_ocaml_camlp4o_checker") + finish +endif +let g:loaded_syntastic_ocaml_camlp4o_checker=1 + +if exists('g:syntastic_ocaml_camlp4r') && + \ g:syntastic_ocaml_camlp4r != 0 + let s:ocamlpp="camlp4r" +else + let s:ocamlpp="camlp4o" +endif + +function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() + return executable(s:ocamlpp) +endfunction + +if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc') + let g:syntastic_ocaml_use_ocamlc = 0 +endif + +if !exists('g:syntastic_ocaml_use_janestreet_core') + let g:syntastic_ocaml_use_ocamlc = 0 +endif + +if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild") + let g:syntastic_ocaml_use_ocamlbuild = 0 +endif + +function! SyntaxCheckers_ocaml_camlp4o_GetLocList() + let makeprg = s:GetMakeprg() + if makeprg == "" + return [] + endif + + let errorformat = + \ '%AFile "%f"\, line %l\, characters %c-%*\d:,'. + \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'. + \ '%AFile "%f"\, line %l\, character %c:,'. + \ '%AFile "%f"\, line %l\, character %c:%m,'. + \ '%-GPreprocessing error %.%#,'. + \ '%-GCommand exited %.%#,'. + \ '%C%tarning %n: %m,'. + \ '%C%m,'. + \ '%-G+%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +function s:GetMakeprg() + if g:syntastic_ocaml_use_ocamlc + return s:GetOcamlcMakeprg() + endif + + if g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build') + return s:GetOcamlBuildMakeprg() + endif + + return s:GetOtherMakeprg() +endfunction + +function s:GetOcamlcMakeprg() + if g:syntastic_ocaml_use_janestreet_core + let build_cmd = "ocamlc -I " + let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir) + let build_cmd .= " -c " . syntastic#util#shexpand('%') + return build_cmd + else + return "ocamlc -c " . syntastic#util#shexpand('%') + endif +endfunction + +function s:GetOcamlBuildMakeprg() + return "ocamlbuild -quiet -no-log -tag annot," . s:ocamlpp . " -no-links -no-hygiene -no-sanitize " . + \ syntastic#util#shexpand('%:r') . ".cmi" +endfunction + +function s:GetOtherMakeprg() + "TODO: give this function a better name? + " + "TODO: should use throw/catch instead of returning an empty makeprg + + let extension = expand('%:e') + let makeprg = "" + + if match(extension, 'mly') >= 0 && executable("menhir") + " ocamlyacc output can't be redirected, so use menhir + let makeprg = "menhir --only-preprocess " . syntastic#util#shexpand('%') . " >" . syntastic#util#DevNull() + elseif match(extension,'mll') >= 0 && executable("ocamllex") + let makeprg = "ocamllex -q " . syntastic#c#GetNullDevice() . " " . syntastic#util#shexpand('%') + else + let makeprg = "camlp4o " . syntastic#c#GetNullDevice() . " " . syntastic#util#shexpand('%') + endif + + return makeprg +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ocaml', + \ 'name': 'camlp4o'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/perl/efm_perl.pl b/sources_non_forked/syntastic/syntax_checkers/perl/efm_perl.pl new file mode 100644 index 00000000..2e74bcb0 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/perl/efm_perl.pl @@ -0,0 +1,186 @@ +#!/usr/bin/env perl +# vimparse.pl - Reformats the error messages of the Perl interpreter for use +# with the quickfix mode of Vim +# +# Copyright (c) 2001 by Jörg Ziefle +# Copyright (c) 2012 Eric Harmon +# You may use and distribute this software under the same terms as Perl itself. +# +# Usage: put one of the two configurations below in your ~/.vimrc (without the +# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl +# before): +# +# Program is run interactively with 'perl -w': +# +# set makeprg=$HOME/bin/vimparse.pl\ %\ $* +# set errorformat=%t:%f:%l:%m +# +# Program is only compiled with 'perl -wc': +# +# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $* +# set errorformat=%t:%f:%l:%m +# +# Usage: +# vimparse.pl [-c] [-w] [-f ] [programargs] +# +# -c compile only, don't run (perl -wc) +# -w output warnings as warnings instead of errors (slightly slower) +# -f write errors to +# +# Example usages: +# * From the command line: +# vimparse.pl program.pl +# +# vimparse.pl -c -w -f errorfile program.pl +# Then run vim -q errorfile to edit the errors with Vim. +# This uses the custom errorformat: %t:%f:%l:%m. +# +# * From Vim: +# Edit in Vim (and save, if you don't have autowrite on), then +# type ':mak' or ':mak args' (args being the program arguments) +# to error check. +# +# Version history: +# 0.3 (05/31/2012): +# * Added support for the seperate display of warnings +# * Switched output format to %t:%f:%l:%m to support error levels +# 0.2 (04/12/2001): +# * First public version (sent to Bram) +# * -c command line option for compiling only +# * grammatical fix: 'There was 1 error.' +# * bug fix for multiple arguments +# * more error checks +# * documentation (top of file, &usage) +# * minor code clean ups +# 0.1 (02/02/2001): +# * Initial version +# * Basic functionality +# +# Todo: +# * test on more systems +# * use portable way to determine the location of perl ('use Config') +# * include option that shows perldiag messages for each error +# * allow to pass in program by STDIN +# * more intuitive behaviour if no error is found (show message) +# +# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for +# you. +use warnings; +use strict; +use Getopt::Std; +use File::Temp qw( tempfile ); + +use vars qw/$opt_I $opt_c $opt_w $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars' + +use constant VERSION => 0.2; + +getopts('cwf:hI:'); + +&usage if $opt_h; # not necessarily needed, but good for further extension + +if (defined $opt_f) { + + open FILE, "> $opt_f" or do { + warn "Couldn't open $opt_f: $!. Using STDOUT instead.\n"; + undef $opt_f; + }; + +}; + +my $handle = (defined $opt_f ? \*FILE : \*STDOUT); + +(my $file = shift) or &usage; # display usage if no filename is supplied +my $args = (@ARGV ? ' ' . join ' ', @ARGV : ''); + +if ($file eq '-') { # make STDIN seek-able, so it can be read twice + my $fh = tempfile(); + print {$fh} ; + open \*STDIN, '<&', $fh or die "open: $!"; + seek \*STDIN, 0, 0 or die "seek: $!"; +} + +my $libs = join ' ', map {"-I$_"} split ',', $opt_I || ''; +my @error_lines = `$^X $libs @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-Mwarnings ']} "$file$args" 2>&1`; + +my @lines = map { "E:$_" } @error_lines; + +my @warn_lines; +if(defined($opt_w)) { + if ($file eq '-') { + seek \*STDIN, 0, 0 or die "seek: $!"; + } + @warn_lines = `$^X $libs @{[defined $opt_c ? '-c ' : '' ]} -Mwarnings "$file$args" 2>&1`; +} + +# Any new errors must be warnings +foreach my $line (@warn_lines) { + if(!grep { $_ eq $line } @error_lines) { + push(@lines, "W:$line"); + } +} + +my $errors = 0; +foreach my $line (@lines) { + + chomp($line); + my ($file, $lineno, $message, $rest, $severity); + + if ($line =~ /^([EW]):(.*)\sat\s(.*)\sline\s(\d+)(.*)$/) { + ($severity, $message, $file, $lineno, $rest) = ($1, $2, $3, $4, $5); + $errors++; + $message .= $rest if ($rest =~ s/^,//); + print $handle "$severity:$file:$lineno:$message\n"; + + } else { next }; + +} + +if (defined $opt_f) { + + my $msg; + if ($errors == 1) { + + $msg = "There was 1 error.\n"; + + } else { + + $msg = "There were $errors errors.\n"; + + }; + + print STDOUT $msg; + close FILE; + unlink $opt_f unless $errors; + +}; + +sub usage { + + (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program + print<] [programargs] + + -c compile only, don't run (executes 'perl -c') + -w output warnings as warnings instead of errors (slightly slower) + -f write errors to + -I specify \@INC/#include directory + +Examples: + * At the command line: + $0 program.pl + Displays output on STDOUT. + + $0 -c -w -f errorfile program.pl + Then run 'vim -q errorfile' to edit the errors with Vim. + This uses the custom errorformat: %t:%f:%l:%m. + + * In Vim: + Edit in Vim (and save, if you don't have autowrite on), then + type ':mak' or ':mak args' (args being the program arguments) + to error check. +EOT + + exit 0; + +}; diff --git a/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim b/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim new file mode 100644 index 00000000..d88437dd --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim @@ -0,0 +1,71 @@ +"============================================================================ +"File: perl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis , +" Eric Harmon +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" In order to add some custom lib directories that should be added to the +" perl command line you can add those as a comma-separated list to the variable +" g:syntastic_perl_lib_path. +" +" let g:syntastic_perl_lib_path = './lib,./lib/auto' +" +" To use your own perl error output munger script, use the +" g:syntastic_perl_efm_program option. Any command line parameters should be +" included in the variable declaration. The program should expect a single +" parameter; the fully qualified filename of the file to be checked. +" +" let g:syntastic_perl_efm_program = "foo.pl -o -m -g" +" + +if exists("g:loaded_syntastic_perl_perl_checker") + finish +endif +let g:loaded_syntastic_perl_perl_checker=1 + +if !exists("g:syntastic_perl_interpreter") + let g:syntastic_perl_interpreter = "perl" +endif + +function! SyntaxCheckers_perl_perl_IsAvailable() + return executable(g:syntastic_perl_interpreter) +endfunction + +if !exists("g:syntastic_perl_efm_program") + let g:syntastic_perl_efm_program = + \ g:syntastic_perl_interpreter . ' ' . + \ syntastic#util#shescape(expand(':p:h') . '/efm_perl.pl') . + \ ' -c -w' +endif + +function! SyntaxCheckers_perl_perl_GetLocList() + let makeprg = exists("b:syntastic_perl_efm_program") ? b:syntastic_perl_efm_program : g:syntastic_perl_efm_program + if exists("g:syntastic_perl_lib_path") + let makeprg .= ' -I' . g:syntastic_perl_lib_path + endif + let makeprg .= ' ' . syntastic#util#shexpand('%') . s:ExtraMakeprgArgs() + + let errorformat = '%t:%f:%l:%m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +function! s:ExtraMakeprgArgs() + let shebang = syntastic#util#parseShebang() + if index(shebang['args'], '-T') != -1 + return ' -Tc' + endif + + return '' +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'perl'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/perl/perlcritic.vim b/sources_non_forked/syntastic/syntax_checkers/perl/perlcritic.vim new file mode 100644 index 00000000..910ded2b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/perl/perlcritic.vim @@ -0,0 +1,65 @@ +"============================================================================ +"File: perlcritic.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For details about perlcritic see: +" +" - http://perlcritic.tigris.org/ +" - https://metacpan.org/module/Perl::Critic +" +" Checker options: +" +" - g:syntastic_perl_perlcritic_thres (integer; default: 5) +" error threshold: policy violations with a severity above this +" value are highlighted as errors, the others are warnings +" +" - g:syntastic_perl_perlcritic_args (string; default: empty) +" command line options to pass to perlcritic + +if exists("g:loaded_syntastic_perl_perlcritic_checker") + finish +endif +let g:loaded_syntastic_perl_perlcritic_checker=1 + +if !exists('g:syntastic_perl_perlcritic_thres') + let g:syntastic_perl_perlcritic_thres = 5 +endif + +function! SyntaxCheckers_perl_perlcritic_IsAvailable() + return executable('perlcritic') +endfunction + +function! SyntaxCheckers_perl_perlcritic_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'perlcritic', + \ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"', + \ 'filetype': 'perl', + \ 'subchecker': 'perlcritic' }) + + let errorformat = '%t:%f:%l:%c:%m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 2], + \ 'subtype': 'Style' }) + + " change error types according to the prescribed threshold + for n in range(len(loclist)) + let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_perl_perlcritic_thres ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'perlcritic'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/perl/podchecker.vim b/sources_non_forked/syntastic/syntax_checkers/perl/podchecker.vim new file mode 100644 index 00000000..e6f80e66 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/perl/podchecker.vim @@ -0,0 +1,30 @@ +"============================================================================ +"File: podchecker.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_perl_podchecker_checker") + finish +endif +let g:loaded_syntastic_perl_podchecker_checker=1 + +function! SyntaxCheckers_perl_podchecker_IsAvailable() + return SyntaxCheckers_pod_podchecker_IsAvailable() +endfunction + +function! SyntaxCheckers_perl_podchecker_GetLocList() + return SyntaxCheckers_pod_podchecker_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'perl', + \ 'name': 'podchecker'}) + +runtime! syntax_checkers/pod/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/php/php.vim b/sources_non_forked/syntastic/syntax_checkers/php/php.vim new file mode 100644 index 00000000..a6abffb1 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/php/php.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: php.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_php_php_checker") + finish +endif +let g:loaded_syntastic_php_php_checker=1 + +function! SyntaxCheckers_php_php_IsAvailable() + return executable("php") +endfunction + +function! SyntaxCheckers_php_php_GetHighlightRegex(item) + let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'") + if len(unexpected) < 1 + return '' + endif + return '\V'.split(unexpected, "'")[1] +endfunction + +function! SyntaxCheckers_php_php_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'php', + \ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0', + \ 'filetype': 'php', + \ 'subchecker': 'php' }) + + let errorformat = + \ '%-GNo syntax errors detected in%.%#,'. + \ 'Parse error: %#syntax %trror\, %m in %f on line %l,'. + \ 'Parse %trror: %m in %f on line %l,'. + \ 'Fatal %trror: %m in %f on line %l,'. + \ '%-G\s%#,'. + \ '%-GErrors parsing %.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'php'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim b/sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim new file mode 100644 index 00000000..f6646c66 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: phpcs.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" See here for details of phpcs +" - phpcs (see http://pear.php.net/package/PHP_CodeSniffer) +" +if exists("g:loaded_syntastic_php_phpcs_checker") + finish +endif +let g:loaded_syntastic_php_phpcs_checker=1 + +function! SyntaxCheckers_php_phpcs_IsAvailable() + return executable('phpcs') +endfunction + +function! SyntaxCheckers_php_phpcs_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'phpcs', + \ 'args': '--report=csv', + \ 'filetype': 'php', + \ 'subchecker': 'phpcs' }) + + let errorformat = + \ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,'. + \ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'phpcs'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim b/sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim new file mode 100644 index 00000000..c21362f9 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim @@ -0,0 +1,78 @@ +"============================================================================ +"File: phpmd.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" See here for details of phpmd +" - phpmd (see http://phpmd.org) + +if exists("g:loaded_syntastic_php_phpmd_checker") + finish +endif +let g:loaded_syntastic_php_phpmd_checker=1 + +function! SyntaxCheckers_php_phpmd_IsAvailable() + return executable('phpmd') +endfunction + +function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)') + if term != '' + return '\V'.substitute(term, '\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '') + endif + let term = matchstr(a:item['text'], '\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.') + if term != '' + return '\V'.substitute(term, '\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '') + endif + let term = matchstr(a:item['text'], '\C^Avoid using short method names like \S\+::\S\+()\.') + if term != '' + return '\V'.substitute(term, '\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '') + endif + let term = matchstr(a:item['text'], '\C^\S\+ accesses the super-global variable ') + if term != '' + return '\V'.substitute(term, '\C accesses the super-global variable .*$', '', '') + endif + let term = matchstr(a:item['text'], '\C^Constant \S\+ should be defined in uppercase') + if term != '' + return '\V'.substitute(term, '\C^Constant \(\S\+\) should be defined in uppercase', '\1', '') + endif + let term = matchstr(a:item['text'], "\\C^The '\\S\\+()' method which returns ") + if term != '' + return '\V'.substitute(term, "\\C^The '\\(\\S\\+\\()' method which returns.*", '\1', '') + endif + let term = matchstr(a:item['text'], '\C variable \S\+ should begin with ') + if term != '' + return '\V'.substitute(term, '\C.* variable \(\S\+\) should begin with .*', '\1', '') + endif + let term = matchstr(a:item['text'], "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'") + if term != '' + return '\V'.substitute(term, "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '') + endif + return '' +endfunction + +function! SyntaxCheckers_php_phpmd_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'phpmd', + \ 'post_args': 'text codesize,design,unusedcode,naming', + \ 'filetype': 'php', + \ 'subchecker': 'phpmd' }) + + let errorformat = '%E%f:%l%\s%#%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype' : 'Style' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'php', + \ 'name': 'phpmd'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/pod/podchecker.vim b/sources_non_forked/syntastic/syntax_checkers/pod/podchecker.vim new file mode 100644 index 00000000..c429a495 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/pod/podchecker.vim @@ -0,0 +1,51 @@ +"============================================================================ +"File: podchecker.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_pod_podchecker_checker") + finish +endif +let g:loaded_syntastic_pod_podchecker_checker=1 + +function! SyntaxCheckers_pod_podchecker_IsAvailable() + return executable("podchecker") +endfunction + +function! SyntaxCheckers_pod_podchecker_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'podchecker', + \ 'filetype': 'pod', + \ 'subchecker': 'podchecker' }) + + let errorformat = + \ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' . + \ '%W%[%#]%[%#]%[%#] WARNING: %m at line EOF in file %f,' . + \ '%E%[%#]%[%#]%[%#] ERROR: %m at line %l in file %f,' . + \ '%E%[%#]%[%#]%[%#] ERROR: %m at line EOF in file %f' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1, 2] }) + + for n in range(len(loclist)) + let e = loclist[n] + if e['valid'] && e['lnum'] == 0 + let e['lnum'] = str2nr(matchstr(e['text'], '\m\ +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_puppet_puppet_checker") + finish +endif +let g:loaded_syntastic_puppet_puppet_checker=1 + +function! SyntaxCheckers_puppet_puppet_IsAvailable() + return executable("puppet") +endfunction + +function! SyntaxCheckers_puppet_puppet_GetLocList() + + let ver = syntastic#util#parseVersion('puppet --version 2>' . syntastic#util#DevNull()) + + if syntastic#util#versionIsAtLeast(ver, [2,7,0]) + let args = 'parser validate --color=false' + else + let args = '--color=false --parseonly' + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'puppet', + \ 'args': args, + \ 'filetype': 'puppet', + \ 'subchecker': 'puppet' }) + + let errorformat = + \ '%-Gerr: Try ''puppet help parser validate'' for usage,' . + \ '%-GError: Try ''puppet help parser validate'' for usage,' . + \ '%Eerr: Could not parse for environment %*[a-z]: %m at %f:%l,' . + \ '%EError: Could not parse for environment %*[a-z]: %m at %f:%l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'puppet', + \ 'name': 'puppet'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/puppet/puppetlint.vim b/sources_non_forked/syntastic/syntax_checkers/puppet/puppetlint.vim new file mode 100644 index 00000000..c65e601b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/puppet/puppetlint.vim @@ -0,0 +1,47 @@ +"============================================================================ +"File: puppetlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Eivind Uggedal +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_puppet_puppetlint_checker") + finish +endif +let g:loaded_syntastic_puppet_puppetlint_checker=1 + +if exists("g:syntastic_puppet_lint_arguments") + let g:syntastic_puppet_puppetlint_args = g:syntastic_puppet_lint_arguments + call syntastic#util#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead") +endif + +function! SyntaxCheckers_puppet_puppetlint_IsAvailable() + return + \ executable("puppet") && + \ executable("puppet-lint") && + \ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('puppet-lint --version 2>' . + \ syntastic#util#DevNull()), [0,1,10]) +endfunction + +function! SyntaxCheckers_puppet_puppetlint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'puppet-lint', + \ 'post_args': '--log-format "\%{KIND} [\%{check}] \%{message} at \%{fullpath}:\%{linenumber}"', + \ 'filetype': 'puppet', + \ 'subchecker': 'puppetlint' }) + + let errorformat = '%t%*[a-zA-Z] %m at %f:%l' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'puppet', + \ 'name': 'puppetlint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/python/flake8.vim b/sources_non_forked/syntastic/syntax_checkers/python/flake8.vim new file mode 100644 index 00000000..796ba6bd --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/flake8.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: flake8.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Sylvain Soliman +" kstep +" +"============================================================================ +if exists("g:loaded_syntastic_python_flake8_checker") + finish +endif +let g:loaded_syntastic_python_flake8_checker=1 + +function! SyntaxCheckers_python_flake8_IsAvailable() + return executable('flake8') +endfunction + +function! SyntaxCheckers_python_flake8_GetHighlightRegex(i) + return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i) +endfunction + +function! SyntaxCheckers_python_flake8_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'flake8', + \ 'filetype': 'python', + \ 'subchecker': 'flake8' }) + + let errorformat = + \ '%E%f:%l: could not compile,%-Z%p^,'. + \ '%W%f:%l:%c: F%n %m,'. + \ '%W%f:%l:%c: C%n %m,'. + \ '%E%f:%l:%c: %t%n %m,'. + \ '%E%f:%l: %t%n %m,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'flake8'}) + +runtime! syntax_checkers/python/pyflakes.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/python/pep8.vim b/sources_non_forked/syntastic/syntax_checkers/python/pep8.vim new file mode 100644 index 00000000..71837187 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/pep8.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: pep8.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For details about pep8 see: https://github.com/jcrocholl/pep8 + +if exists("g:loaded_syntastic_python_pep8_checker") + finish +endif +let g:loaded_syntastic_python_pep8_checker=1 + +function! SyntaxCheckers_python_pep8_IsAvailable() + return executable('pep8') +endfunction + +function! SyntaxCheckers_python_pep8_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'pep8', + \ 'filetype': 'python', + \ 'subchecker': 'pep8' }) + + let errorformat = '%f:%l:%c: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style' }) + + for n in range(len(loclist)) + let loclist[n]['type'] = loclist[n]['text'] =~? '^W' ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pep8'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/python/py3kwarn.vim b/sources_non_forked/syntastic/syntax_checkers/python/py3kwarn.vim new file mode 100644 index 00000000..44d03655 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/py3kwarn.vim @@ -0,0 +1,31 @@ +"============================================================================ +"File: py3kwarn.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Liam Curry +" +"============================================================================ +if exists("g:loaded_syntastic_python_py3kwarn_checker") + finish +endif +let g:loaded_syntastic_python_py3kwarn_checker=1 + +function! SyntaxCheckers_python_py3kwarn_IsAvailable() + return executable('py3kwarn') +endfunction + +function! SyntaxCheckers_python_py3kwarn_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'py3kwarn', + \ 'filetype': 'python', + \ 'subchecker': 'py3kwarn' }) + + let errorformat = '%W%f:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'py3kwarn'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/python/pyflakes.vim b/sources_non_forked/syntastic/syntax_checkers/python/pyflakes.vim new file mode 100644 index 00000000..f93047bf --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/pyflakes.vim @@ -0,0 +1,63 @@ +"============================================================================ +"File: pyflakes.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Martin Grenfell +" kstep +" Parantapa Bhattacharya +" +"============================================================================ +if exists("g:loaded_syntastic_python_pyflakes_checker") + finish +endif +let g:loaded_syntastic_python_pyflakes_checker=1 + +function! SyntaxCheckers_python_pyflakes_IsAvailable() + return executable('pyflakes') +endfunction + +function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i) + if match(a:i['text'], 'is assigned to but never used') > -1 + \ || match(a:i['text'], 'imported but unused') > -1 + \ || match(a:i['text'], 'undefined name') > -1 + \ || match(a:i['text'], 'redefinition of') > -1 + \ || match(a:i['text'], 'referenced before assignment') > -1 + \ || match(a:i['text'], 'duplicate argument') > -1 + \ || match(a:i['text'], 'after other statements') > -1 + \ || match(a:i['text'], 'shadowed by loop variable') > -1 + + " fun with Python's %r: try "..." first, then '...' + let terms = split(a:i['text'], '"', 1) + if len(terms) > 2 + return terms[1] + endif + + let terms = split(a:i['text'], "'", 1) + if len(terms) > 2 + return terms[1] + endif + endif + return '' +endfunction + +function! SyntaxCheckers_python_pyflakes_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'pyflakes', + \ 'filetype': 'python', + \ 'subchecker': 'pyflakes' }) + + let errorformat = + \ '%E%f:%l: could not compile,'. + \ '%-Z%p^,'. + \ '%E%f:%l:%c: %m,'. + \ '%E%f:%l: %m,'. + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'text': "Syntax error"} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pyflakes'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/python/pylama.vim b/sources_non_forked/syntastic/syntax_checkers/python/pylama.vim new file mode 100644 index 00000000..4d7d02ad --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/pylama.vim @@ -0,0 +1,53 @@ +"============================================================================ +"File: pylama.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_python_pylama_checker") + finish +endif +let g:loaded_syntastic_python_pylama_checker=1 + +function! SyntaxCheckers_python_pylama_IsAvailable() + return executable('pylama') +endfunction + +function! SyntaxCheckers_python_pylama_GetHighlightRegex(i) + return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i) +endfunction + +function! SyntaxCheckers_python_pylama_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'pylama', + \ 'post_args': ' -f pep8', + \ 'filetype': 'python', + \ 'subchecker': 'pylama' }) + + let errorformat = '%A%f:%l:%c: %m' + + let loclist=SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['sort'] }) + + for n in range(len(loclist)) + let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][0]) >= 0 ? 'W' : 'E' + if loclist[n]['text'] =~# '\v\[%(pep8|pep257|mccabe)\]$' + let loclist[n]['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pylama' }) + +runtime! syntax_checkers/python/pyflakes.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/python/pylint.vim b/sources_non_forked/syntastic/syntax_checkers/python/pylint.vim new file mode 100644 index 00000000..923664d4 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/pylint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: pylint.vim +"Description: Syntax checking plugin for syntastic.vim +"Author: Parantapa Bhattacharya +" +"============================================================================ +if exists("g:loaded_syntastic_python_pylint_checker") + finish +endif +let g:loaded_syntastic_python_pylint_checker=1 + +function! SyntaxCheckers_python_pylint_IsAvailable() + return executable('pylint') +endfunction + +function! SyntaxCheckers_python_pylint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'pylint', + \ 'args': ' -f parseable -r n -i y', + \ 'filetype': 'python', + \ 'subchecker': 'pylint' }) + + let errorformat = + \ '%A%f:%l:%m,' . + \ '%A%f:(%l):%m,' . + \ '%-Z%p^%.%#,' . + \ '%-G%.%#' + + let loclist=SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['sort'] }) + + for n in range(len(loclist)) + let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][2]) >= 0 ? 'W' : 'E' + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'pylint' }) diff --git a/sources_non_forked/syntastic/syntax_checkers/python/python.vim b/sources_non_forked/syntastic/syntax_checkers/python/python.vim new file mode 100644 index 00000000..eff1696b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/python/python.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: python.vim +"Description: Syntax checking plugin for syntastic.vim +"Author: Artem Nezvigin +" +" `errorformat` derived from: +" http://www.vim.org/scripts/download_script.php?src_id=1392 +" +"============================================================================ +if exists("g:loaded_syntastic_python_python_checker") + finish +endif +let g:loaded_syntastic_python_python_checker=1 + +function! SyntaxCheckers_python_python_IsAvailable() + return executable('python') +endfunction + +function! SyntaxCheckers_python_python_GetLocList() + let fname = "'" . escape(expand('%'), "\\'") . "'" + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'python', + \ 'args': '-c', + \ 'fname': syntastic#util#shescape("compile(open(" . fname . ").read(), " . fname . ", 'exec')"), + \ 'filetype': 'python', + \ 'subchecker': 'python' }) + + let errorformat = + \ '%E File "%f"\, line %l,' . + \ '%C %p^,' . + \ '%C %.%#,' . + \ '%Z%m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'python', + \ 'name': 'python'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/rst/rst2pseudoxml.vim b/sources_non_forked/syntastic/syntax_checkers/rst/rst2pseudoxml.vim new file mode 100644 index 00000000..454b4d85 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/rst/rst2pseudoxml.vim @@ -0,0 +1,62 @@ +"============================================================================ +"File: rst.vim +"Description: Syntax checking plugin for docutil's reStructuredText files +"Maintainer: James Rowe +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" We use rst2pseudoxml.py, as it is ever so marginally faster than the other +" rst2${x} tools in docutils. + +if exists("g:loaded_syntastic_rst_rst2pseudoxml_checker") + finish +endif +let g:loaded_syntastic_rst_rst2pseudoxml_checker=1 + +function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() + return executable("rst2pseudoxml.py") || executable("rst2pseudoxml") +endfunction + +function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': s:exe(), + \ 'args': '--report=2 --exit-status=1', + \ 'tail': syntastic#util#DevNull(), + \ 'filetype': 'rst', + \ 'subchecker': 'rst2pseudoxml' }) + + let errorformat = + \ '%f:%l: (%tNFO/1) %m,'. + \ '%f:%l: (%tARNING/2) %m,'. + \ '%f:%l: (%tRROR/3) %m,'. + \ '%f:%l: (%tEVERE/4) %m,'. + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + for n in range(len(loclist)) + if loclist[n]['type'] ==? 'S' + let loclist[n]['type'] = 'E' + elseif loclist[n]['type'] ==? 'I' + let loclist[n]['type'] = 'W' + let loclist[n]['subtype'] = 'Style' + endif + endfor + + return loclist +endfunction + +function s:exe() + return executable("rst2pseudoxml.py") ? "rst2pseudoxml.py" : "rst2pseudoxml" +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rst', + \ 'name': 'rst2pseudoxml'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim b/sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim new file mode 100644 index 00000000..bef2b5f5 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: jruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Leonid Shevtsov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_ruby_jruby_checker") + finish +endif +let g:loaded_syntastic_ruby_jruby_checker=1 + +function! SyntaxCheckers_ruby_jruby_IsAvailable() + return executable('jruby') +endfunction + +function! SyntaxCheckers_ruby_jruby_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': s:exe(), + \ 'args': s:args(), + \ 'filetype': 'ruby', + \ 'subchecker': 'jruby' }) + + let errorformat = + \ '%-GSyntax OK for %f,'. + \ '%ESyntaxError in %f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +function s:args() + return has('win32') ? '-W1 -T1 -c' : '-W1 -c' +endfunction + +function s:exe() + return has('win32') ? 'jruby' : 'RUBYOPT= jruby' +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'jruby'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/ruby/macruby.vim b/sources_non_forked/syntastic/syntax_checkers/ruby/macruby.vim new file mode 100644 index 00000000..9226e41e --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ruby/macruby.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: macruby.vim +"Description: Syntax checking plugin for syntastic.vim +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_ruby_macruby_checker") + finish +endif +let g:loaded_syntastic_ruby_macruby_checker=1 + +function! SyntaxCheckers_ruby_macruby_IsAvailable() + return executable('macruby') +endfunction + +function! SyntaxCheckers_ruby_macruby_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'RUBYOPT= macruby', + \ 'args': '-W1 -c', + \ 'filetype': 'ruby', + \ 'subchecker': 'macruby' }) + + let errorformat = + \ '%-GSyntax OK,'. + \ '%E%f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'macruby'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim b/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim new file mode 100644 index 00000000..27a46a48 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim @@ -0,0 +1,77 @@ +"============================================================================ +"File: mri.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_ruby_mri_checker") + finish +endif +let g:loaded_syntastic_ruby_mri_checker=1 + +if !exists("g:syntastic_ruby_exec") + let g:syntastic_ruby_exec = "ruby" +endif + +function! SyntaxCheckers_ruby_mri_IsAvailable() + return executable(expand(g:syntastic_ruby_exec)) +endfunction + +function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i) + if match(a:i['text'], 'assigned but unused variable') > -1 + let term = split(a:i['text'], ' - ')[1] + return '\V\<'.term.'\>' + endif + + return '' +endfunction + +function! SyntaxCheckers_ruby_mri_GetLocList() + let exe = expand(g:syntastic_ruby_exec) + if !has('win32') + let exe = 'RUBYOPT= ' . exe + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': exe, + \ 'args': '-w -T1 -c', + \ 'filetype': 'ruby', + \ 'subchecker': 'mri' }) + + "this is a hack to filter out a repeated useless warning in rspec files + "containing lines like + " + " foo.should == 'bar' + " + "Which always generate the warning below. Note that ruby >= 1.9.3 includes + "the word "possibly" in the warning + let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,' + + " filter out lines starting with ... + " long lines are truncated and wrapped in ... %p then returns the wrong + " column offset + let errorformat .= '%-G%\%.%\%.%\%.%.%#,' + + let errorformat .= + \ '%-GSyntax OK,'. + \ '%E%f:%l: syntax error\, %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: warning: %m,'. + \ '%Z%p^,'. + \ '%W%f:%l: %m,'. + \ '%-C%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'mri'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/ruby/rubocop.vim b/sources_non_forked/syntastic/syntax_checkers/ruby/rubocop.vim new file mode 100644 index 00000000..b93d8d1a --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/ruby/rubocop.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: rubocop.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Recai Oktaş +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" In order to use rubocop with the default ruby checker (mri): +" let g:syntastic_ruby_checkers = ['mri', 'rubocop'] + +if exists("g:loaded_syntastic_ruby_rubocop_checker") + finish +endif +let g:loaded_syntastic_ruby_rubocop_checker=1 + +function! SyntaxCheckers_ruby_rubocop_IsAvailable() + return + \ executable('rubocop') && + \ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('rubocop --version'), [0,9,0]) +endfunction + +function! SyntaxCheckers_ruby_rubocop_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'rubocop', + \ 'args': '--format emacs --silent', + \ 'filetype': 'ruby', + \ 'subchecker': 'rubocop' }) + + let errorformat = '%f:%l:%c: %t: %m' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style'}) + + " convert rubocop severities to error types recognized by syntastic + for n in range(len(loclist)) + if loclist[n]['type'] == 'F' + let loclist[n]['type'] = 'E' + elseif loclist[n]['type'] != 'W' && loclist[n]['type'] != 'E' + let loclist[n]['type'] = 'W' + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ruby', + \ 'name': 'rubocop'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim b/sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim new file mode 100644 index 00000000..e88b4cf9 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: rust.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Chad Jablonski +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_rust_rustc_checker") + finish +endif +let g:loaded_syntastic_rust_rustc_checker=1 + +function! SyntaxCheckers_rust_rustc_IsAvailable() + return executable("rustc") +endfunction + +function! SyntaxCheckers_rust_rustc_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'rustc', + \ 'args': '--parse-only', + \ 'filetype': 'rust', + \ 'subchecker': 'rustc' }) + + let errorformat = + \ '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,' . + \ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' . + \ '%C%f:%l %m,' . + \ '%-Z%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'rust', + \ 'name': 'rustc'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/sass/sass.vim b/sources_non_forked/syntastic/syntax_checkers/sass/sass.vim new file mode 100644 index 00000000..4b8d4863 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/sass/sass.vim @@ -0,0 +1,78 @@ +"============================================================================ +"File: sass.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_sass_sass_checker") + finish +endif +let g:loaded_syntastic_sass_sass_checker=1 + +function! SyntaxCheckers_sass_sass_IsAvailable() + return executable("sass") +endfunction + +"sass caching for large files drastically speeds up the checking, but store it +"in a temp location otherwise sass puts .sass_cache dirs in the users project +let s:sass_cache_location = tempname() + +"By default do not check partials as unknown variables are a syntax error +if !exists("g:syntastic_sass_check_partials") + let g:syntastic_sass_check_partials = 0 +endif + +"use compass imports if available +let s:imports = "" +if executable("compass") + let s:imports = "--compass" +endif + +function! SyntaxCheckers_sass_sass_GetLocList() + if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_' + return [] + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'sass', + \ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check', + \ 'filetype': 'sass', + \ 'subchecker': 'sass' }) + + let errorformat = + \ '%ESyntax %trror: %m,' . + \ '%+C %.%#,' . + \ '%C on line %l of %f\, %.%#,' . + \ '%C on line %l of %f,' . + \ '%-G %\+from line %.%#,' . + \ '%-G %\+Use --trace for backtrace.,' . + \ '%W%>DEPRECATION WARNING on line %l of %f:,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING: on line %l of %f:,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING on line %l of %f: %m,' . + \ '%+C%> %.%#,' . + \ '%W%>WARNING on line %l of %f:,' . + \ '%Z%m,' . + \ '%W%>WARNING: %m,' . + \ '%C on line %l of %f\, %.%#,' . + \ '%C on line %l of %f,' . + \ '%-G %\+from line %.%#,' . + \ 'Syntax %trror on line %l: %m,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sass', + \ 'name': 'sass'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim b/sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim new file mode 100644 index 00000000..d0e95a7d --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: fsc.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('g:loaded_syntastic_scala_fsc_checker') + finish +endif +let g:loaded_syntastic_scala_fsc_checker = 1 + +function! SyntaxCheckers_scala_fsc_IsAvailable() + return executable('fsc') +endfunction + +if !exists('g:syntastic_scala_options') + let g:syntastic_scala_options = '' +endif + +function! SyntaxCheckers_scala_fsc_GetLocList() + " fsc has some serious problems with the + " working directory changing after being started + " that's why we better pass an absolute path + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'fsc', + \ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options, + \ 'fname': syntastic#util#shexpand('%:p'), + \ 'filetype': 'scala', + \ 'subchecker': 'fsc' }) + + let errorformat = '%f:%l: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scala', + \ 'name': 'fsc'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/scala/scalac.vim b/sources_non_forked/syntastic/syntax_checkers/scala/scalac.vim new file mode 100644 index 00000000..d6319c16 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/scala/scalac.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: scala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Rickey Visinski +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_scala_scalac_checker") + finish +endif +let g:loaded_syntastic_scala_scalac_checker=1 + +function! SyntaxCheckers_scala_scalac_IsAvailable() + return executable("scalac") +endfunction + +if !exists('g:syntastic_scala_options') + let g:syntastic_scala_options = '' +endif + + +function! SyntaxCheckers_scala_scalac_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'scalac', + \ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options, + \ 'filetype': 'scala', + \ 'subchecker': 'scalac' }) + + let errorformat = '%f:%l: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scala', + \ 'name': 'scalac'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/scss/sass.vim b/sources_non_forked/syntastic/syntax_checkers/scss/sass.vim new file mode 100644 index 00000000..604bb41d --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/scss/sass.vim @@ -0,0 +1,31 @@ + +"============================================================================ +"File: scss.vim +"Description: scss syntax checking plugin for syntastic +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_scss_sass_checker") + finish +endif +let g:loaded_syntastic_scss_sass_checker=1 + +function! SyntaxCheckers_scss_sass_IsAvailable() + return SyntaxCheckers_sass_sass_IsAvailable() +endfunction + +function! SyntaxCheckers_scss_sass_GetLocList() + return SyntaxCheckers_sass_sass_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'scss', + \ 'name': 'sass'}) + +runtime! syntax_checkers/sass/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/sh/checkbashisms.vim b/sources_non_forked/syntastic/syntax_checkers/sh/checkbashisms.vim new file mode 100644 index 00000000..9fb1f7ae --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/sh/checkbashisms.vim @@ -0,0 +1,45 @@ +"============================================================================ +"File: checkbashisms.vim +"Description: Shell script syntax/style checking plugin for syntastic.vim +"Notes: checkbashisms.pl can be downloaded from +" http://debian.inode.at/debian/pool/main/d/devscripts/ +" as part of the devscripts package. +"============================================================================ + +if exists("g:loaded_syntastic_sh_checkbashisms_checker") + finish +endif +let g:loaded_syntastic_sh_checkbashisms_checker=1 + + +function! SyntaxCheckers_sh_checkbashisms_IsAvailable() + return executable('checkbashisms') +endfunction + + +function! SyntaxCheckers_sh_checkbashisms_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'checkbashisms', + \ 'args': '-fx', + \ 'filetype': 'sh', + \ 'subchecker': 'checkbashisms'}) + + let errorformat = + \ '%-Gscript %f is already a bash script; skipping,' . + \ '%Eerror: %f: %m\, opened in line %l,' . + \ '%Eerror: %f: %m,' . + \ '%Ecannot open script %f for reading: %m,' . + \ '%Wscript %f %m,%C%.# lines,' . + \ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style'}) +endfunction + + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'checkbashisms'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/sh/sh.vim b/sources_non_forked/syntastic/syntax_checkers/sh/sh.vim new file mode 100644 index 00000000..8c44960b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/sh/sh.vim @@ -0,0 +1,83 @@ +"============================================================================ +"File: sh.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_sh_sh_checker") + finish +endif +let g:loaded_syntastic_sh_sh_checker=1 + +function! s:GetShell() + if !exists('b:shell') || b:shell == '' + let b:shell = '' + let shebang = getbufline(bufnr('%'), 1)[0] + if len(shebang) > 0 + if match(shebang, 'bash') >= 0 + let b:shell = 'bash' + elseif match(shebang, 'zsh') >= 0 + let b:shell = 'zsh' + elseif match(shebang, 'sh') >= 0 + let b:shell = 'sh' + endif + endif + " try to use env variable in case no shebang could be found + if b:shell == '' + let b:shell = fnamemodify(expand('$SHELL'), ':t') + endif + endif + return b:shell +endfunction + +function! s:ForwardToZshChecker() + let registry = g:SyntasticRegistry.Instance() + if registry.checkable('zsh') + return SyntaxCheckers_zsh_zsh_GetLocList() + else + return [] + endif + +endfunction + + +function! s:IsShellValid() + return len(s:GetShell()) > 0 && executable(s:GetShell()) +endfunction + + +function! SyntaxCheckers_sh_sh_IsAvailable() + return s:IsShellValid() +endfunction + +function! SyntaxCheckers_sh_sh_GetLocList() + if s:GetShell() == 'zsh' + return s:ForwardToZshChecker() + endif + + if !s:IsShellValid() + return [] + endif + + let makeprg = syntastic#makeprg#build({ + \ 'exe': s:GetShell(), + \ 'args': '-n', + \ 'filetype': 'sh', + \ 'subchecker': 'sh'}) + + let errorformat = '%f: line %l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'sh', + \ 'name': 'sh'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim b/sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim new file mode 100644 index 00000000..2644decf --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: slim.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_slim_slimrb_checker") + finish +endif +let g:loaded_syntastic_slim_slimrb_checker=1 + +function! SyntaxCheckers_slim_slimrb_IsAvailable() + return executable("slimrb") +endfunction + +function! s:SlimrbVersion() + if !exists('s:slimrb_version') + let s:slimrb_version = syntastic#util#parseVersion('slimrb --version 2>' . syntastic#util#DevNull()) + end + return s:slimrb_version +endfunction + +function! SyntaxCheckers_slim_slimrb_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'slimrb', + \ 'args': '-c', + \ 'filetype': 'slim', + \ 'subchecker': 'slimrb' }) + + if syntastic#util#versionIsAtLeast(s:SlimrbVersion(), [1,3,1]) + let errorformat = + \ '%C\ %#%f\, Line %l\, Column %c,'. + \ '%-G\ %.%#,'. + \ '%ESlim::Parser::SyntaxError: %m,'. + \ '%+C%.%#' + else + let errorformat = + \ '%C\ %#%f\, Line %l,'. + \ '%-G\ %.%#,'. + \ '%ESlim::Parser::SyntaxError: %m,'. + \ '%+C%.%#' + endif + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'slim', + \ 'name': 'slimrb'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/tcl/nagelfar.vim b/sources_non_forked/syntastic/syntax_checkers/tcl/nagelfar.vim new file mode 100644 index 00000000..b93b17b9 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/tcl/nagelfar.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: nagelfar.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: James Pickard +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"Notes: Requires nagelfar v1.1.12 or later with support for -H option. +" See nagelfar homepage http://nagelfar.berlios.de/. +" +"============================================================================ +if exists("g:loaded_syntastic_tcl_nagelfar_checker") + finish +endif +let g:loaded_syntastic_tcl_nagelfar_checker=1 + +function! SyntaxCheckers_tcl_nagelfar_IsAvailable() + return executable('nagelfar') +endfunction + +function! SyntaxCheckers_tcl_nagelfar_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'nagelfar', + \ 'args': '-H ' . g:syntastic_tcl_nagelfar_conf, + \ 'filetype': 'tcl', + \ 'subchecker': 'nagelfar' }) + + let errorformat = + \ '%I%f: %l: N %m,'. + \ '%f: %l: %t %m,'. + \ '%-GChecking file %f' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tcl', + \ 'name': 'nagelfar'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/tex/chktex.vim b/sources_non_forked/syntastic/syntax_checkers/tex/chktex.vim new file mode 100644 index 00000000..d7a55e0f --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/tex/chktex.vim @@ -0,0 +1,62 @@ +"============================================================================ +"File: chktex.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" For details about ChkTeX see: +" +" http://baruch.ev-en.org/proj/chktex/ +" +" Checker options: +" +" - g:syntastic_tex_chktex_showmsgs (boolean; default: 1) +" whether to show informational messages (chktex option "-m"); +" by default informational messages are shown as warnings +" +" - g:syntastic_tex_chktex_args (string; default: empty) +" command line options to pass to chktex + +if exists("g:loaded_syntastic_tex_chktex_checker") + finish +endif +let g:loaded_syntastic_tex_chktex_checker = 1 + +if !exists('g:syntastic_tex_chktex_showmsgs') + let g:syntastic_tex_chktex_showmsgs = 1 +endif + +function! SyntaxCheckers_tex_chktex_IsAvailable() + return executable("chktex") +endfunction + +function! SyntaxCheckers_tex_chktex_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'chktex', + \ 'post_args': '-q -v1', + \ 'filetype': 'tex', + \ 'subchecker': 'chktex' }) + + let errorformat = + \ '%EError\ %\\d%\\+\ in\ %f\ line\ %l:\ %m,' . + \ '%WWarning\ %\\d%\\+\ in\ %f\ line\ %l:\ %m,' . + \ (g:syntastic_tex_chktex_showmsgs ? '%WMessage\ %\\d%\\+\ in\ %f\ line %l:\ %m,' : '') . + \ '%+Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'postprocess': ['sort'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tex', + \ 'name': 'chktex'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/tex/lacheck.vim b/sources_non_forked/syntastic/syntax_checkers/tex/lacheck.vim new file mode 100644 index 00000000..38510e85 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/tex/lacheck.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: tex.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_tex_lacheck_checker") + finish +endif +let g:loaded_syntastic_tex_lacheck_checker=1 + +function! SyntaxCheckers_tex_lacheck_IsAvailable() + return executable("lacheck") +endfunction + +function! SyntaxCheckers_tex_lacheck_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'lacheck', + \ 'filetype': 'tex', + \ 'subchecker': 'lacheck' }) + + let errorformat = '%-G** %f:,%E"%f"\, line %l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'tex', + \ 'name': 'lacheck'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim b/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim new file mode 100644 index 00000000..9f5061b8 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: atdtool.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: LCD 47 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_text_atdtool_checker") + finish +endif +let g:loaded_syntastic_text_atdtool_checker = 1 + +function! SyntaxCheckers_text_atdtool_IsAvailable() + return executable('atdtool') +endfunction + +function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item) + let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)') + if term != '' + let col = get(a:item, 'col', 0) + let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . term + endif + return term +endfunction + +function! SyntaxCheckers_text_atdtool_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'atdtool', + \ 'tail': '2>' . syntastic#util#DevNull(), + \ 'filetype': 'text', + \ 'subchecker': 'atdtool' }) + + let errorformat = + \ '%W%f:%l:%c: %m,'. + \ '%+C suggestions:%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0], + \ 'subtype': 'Style' }) + + for n in range(len(loclist)) + let loclist[n]['text'] = substitute(loclist[n]['text'], '\n\s\+', ' | ', 'g') + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'text', + \ 'name': 'atdtool'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/twig/twiglint.vim b/sources_non_forked/syntastic/syntax_checkers/twig/twiglint.vim new file mode 100644 index 00000000..7cbba5f4 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/twig/twiglint.vim @@ -0,0 +1,43 @@ +"============================================================================ +"File: twig.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Alexander +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_twig_twiglint_checker") + finish +endif +let g:loaded_syntastic_twig_twiglint_checker=1 + +function! SyntaxCheckers_twig_twiglint_GetHighlightRegex(item) + " Let's match the full line for now + return '\V' +endfunction + +function! SyntaxCheckers_twig_twiglint_IsAvailable() + return executable('twig-lint') +endfunction + +function! SyntaxCheckers_twig_twiglint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'twig-lint', + \ 'args': 'lint --format=csv', + \ 'filetype': 'twig', + \ 'subchecker': 'twiglint' }) + + let errorformat = '"%f"\,%l\,%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'twig', + \ 'name': 'twiglint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/typescript/tsc.vim b/sources_non_forked/syntastic/syntax_checkers/typescript/tsc.vim new file mode 100644 index 00000000..78469822 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/typescript/tsc.vim @@ -0,0 +1,33 @@ +"============================================================================ +"File: typescript.vim +"Description: TypeScript syntax checker. For TypeScript v0.8.0 +"Maintainer: Bill Casarin +"============================================================================ + +if exists("g:loaded_syntastic_typescript_tsc_checker") + finish +endif +let g:loaded_syntastic_typescript_tsc_checker=1 + +function! SyntaxCheckers_typescript_tsc_IsAvailable() + return executable("tsc") +endfunction + + +function! SyntaxCheckers_typescript_tsc_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'tsc', + \ 'post_args': '--out ' . syntastic#util#DevNull(), + \ 'filetype': 'typescript', + \ 'subchecker': 'tsc' }) + + let errorformat = '%f %#(%l\,%c): %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'typescript', + \ 'name': 'tsc'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim b/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim new file mode 100644 index 00000000..09b6c28b --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim @@ -0,0 +1,74 @@ +"============================================================================ +"File: vala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Konstantin Stepanov (me@kstep.me) +"Notes: Add special comment line into your vala file starting with +" "// modules: " and containing space delimited list of vala +" modules, used by the file, so this script can build correct +" --pkg arguments. +" Alternatively you can set g:syntastic_vala_modules array +" in your .vimrc or .lvimrc with localvimrc plugin +" (http://www.vim.org/scripts/script.php?script_id=441). +" Valac compiler is not the fastest thing in the world, so you +" may want to disable this plugin with +" let g:syntastic_vala_check_disabled = 1 command in your .vimrc or +" command line. Unlet this variable to set it to 0 to reenable +" this checker. +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_vala_valac_checker") + finish +endif +let g:loaded_syntastic_vala_valac_checker = 1 + +function! SyntaxCheckers_vala_valac_IsAvailable() + return executable('valac') +endfunction + +function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) + let strlength = strlen(matchstr(a:pos['text'], '\^\+$')) + return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c' +endfunction + +function! s:GetValaModules() + if exists('g:syntastic_vala_modules') + if type(g:syntastic_vala_modules) == type('') + return split(g:syntastic_vala_modules, '\s\+') + elseif type(g:syntastic_vala_modules) == type([]) + return copy(g:syntastic_vala_modules) + else + echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string' + endif + endif + + let modules_line = search('^// modules: ', 'n') + let modules_str = getline(modules_line) + return split(strpart(modules_str, 12), '\s\+') +endfunction + +function! SyntaxCheckers_vala_valac_GetLocList() + let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'valac', + \ 'args': '-C ' . vala_pkg_args, + \ 'filetype': 'vala', + \ 'subchecker': 'valac' }) + let errorformat = + \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'. + \ '%C%m,'. + \ '%Z%m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vala', + \ 'name': 'valac'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/vhdl/ghdl.vim b/sources_non_forked/syntastic/syntax_checkers/vhdl/ghdl.vim new file mode 100644 index 00000000..7158cd78 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/vhdl/ghdl.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: ghdl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jan Wagner +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("g:loaded_syntastic_vhdl_ghdl_checker") + finish +endif +let g:loaded_syntastic_vhdl_ghdl_checker = 1 + +function! SyntaxCheckers_vhdl_ghdl_IsAvailable() + return executable("ghdl") +endfunction + +function! SyntaxCheckers_vhdl_ghdl_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'ghdl', + \ 'args': '-s', + \ 'filetype': 'vhdl', + \ 'subchecker': 'ghdl' }) + + let errorformat = '%f:%l:%c: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'vhdl', + \ 'name': 'ghdl'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/xhtml/tidy.vim b/sources_non_forked/syntastic/syntax_checkers/xhtml/tidy.vim new file mode 100644 index 00000000..e0c22fbb --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/xhtml/tidy.vim @@ -0,0 +1,89 @@ +"============================================================================ +"File: xhtml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" Checker option: +" +" - g:syntastic_xhtml_tidy_ignore_errors (list; default: []) +" list of errors to ignore + +if exists("g:loaded_syntastic_xhtml_tidy_checker") + finish +endif +let g:loaded_syntastic_xhtml_tidy_checker=1 + +if !exists('g:syntastic_xhtml_tidy_ignore_errors') + let g:syntastic_xhtml_tidy_ignore_errors = [] +endif + +function! SyntaxCheckers_xhtml_tidy_IsAvailable() + return executable("tidy") +endfunction + +" TODO: join this with html.vim DRY's sake? +function! s:TidyEncOptByFenc() + let tidy_opts = { + \'utf-8' : '-utf8', + \'ascii' : '-ascii', + \'latin1' : '-latin1', + \'iso-2022-jp' : '-iso-2022', + \'cp1252' : '-win1252', + \'macroman' : '-mac', + \'utf-16le' : '-utf16le', + \'utf-16' : '-utf16', + \'big5' : '-big5', + \'cp932' : '-shiftjis', + \'sjis' : '-shiftjis', + \'cp850' : '-ibm858', + \} + return get(tidy_opts, &fileencoding, '-utf8') +endfunction + +function! s:IgnoreError(text) + for i in g:syntastic_xhtml_tidy_ignore_errors + if stridx(a:text, i) != -1 + return 1 + endif + endfor + return 0 +endfunction + +function! SyntaxCheckers_xhtml_tidy_GetLocList() + let encopt = s:TidyEncOptByFenc() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'tidy', + \ 'args': encopt . ' -xml -e', + \ 'filetype': 'xhtml', + \ 'subchecker': 'tidy' }) + + let errorformat= + \ '%Wline %l column %v - Warning: %m,' . + \ '%Eline %l column %v - Error: %m,' . + \ '%-G%.%#' + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")}, + \ 'returns': [0, 1, 2] }) + + for n in range(len(loclist)) + if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1 + let loclist[n]['valid'] = 0 + endif + endfor + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xhtml', + \ 'name': 'tidy'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/xml/xmllint.vim b/sources_non_forked/syntastic/syntax_checkers/xml/xmllint.vim new file mode 100644 index 00000000..5a6e1db7 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/xml/xmllint.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: xml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_xml_xmllint_checker") + finish +endif +let g:loaded_syntastic_xml_xmllint_checker=1 + +" You can use a local installation of DTDs to significantly speed up validation +" and allow you to validate XML data without network access, see xmlcatalog(1) +" and http://www.xmlsoft.org/catalog.html for more information. + +function! SyntaxCheckers_xml_xmllint_IsAvailable() + return executable('xmllint') +endfunction + +function! SyntaxCheckers_xml_xmllint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'xmllint', + \ 'args': '--xinclude --noout --postvalid', + \ 'filetype': 'xml', + \ 'subchecker': 'xmllint' }) + + let errorformat= + \ '%E%f:%l: error : %m,' . + \ '%-G%f:%l: validity error : Validation failed: no DTD found %m,' . + \ '%W%f:%l: warning : %m,' . + \ '%W%f:%l: validity warning : %m,' . + \ '%E%f:%l: validity error : %m,' . + \ '%E%f:%l: parser error : %m,' . + \ '%E%f:%l: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'returns': [0, 1, 2, 3, 4, 5] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xml', + \ 'name': 'xmllint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/xslt/xmllint.vim b/sources_non_forked/syntastic/syntax_checkers/xslt/xmllint.vim new file mode 100644 index 00000000..db397ed8 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/xslt/xmllint.vim @@ -0,0 +1,30 @@ +"============================================================================ +"File: xslt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_xslt_xmllint_checker") + finish +endif +let g:loaded_syntastic_xslt_xmllint_checker=1 + +function! SyntaxCheckers_xslt_xmllint_IsAvailable() + return SyntaxCheckers_xml_xmllint_IsAvailable() +endfunction + +function! SyntaxCheckers_xslt_xmllint_GetLocList() + return SyntaxCheckers_xml_xmllint_GetLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'xslt', + \ 'name': 'xmllint'}) + +runtime! syntax_checkers/xml/*.vim diff --git a/sources_non_forked/syntastic/syntax_checkers/yaml/jsyaml.vim b/sources_non_forked/syntastic/syntax_checkers/yaml/jsyaml.vim new file mode 100644 index 00000000..9ffdc658 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/yaml/jsyaml.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: yaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" +"Installation: $ npm install -g js-yaml +" +"============================================================================ + +if exists("g:loaded_syntastic_yaml_jsyaml_checker") + finish +endif +let g:loaded_syntastic_yaml_jsyaml_checker=1 + +function! SyntaxCheckers_yaml_jsyaml_IsAvailable() + return executable("js-yaml") +endfunction + +function! SyntaxCheckers_yaml_jsyaml_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'js-yaml', + \ 'args': '--compact', + \ 'filetype': 'yaml', + \ 'subchecker': 'jsyaml' }) + + let errorformat='Error on line %l\, col %c:%m,%-G%.%#' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'yaml', + \ 'name': 'jsyaml'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/z80/z80syntaxchecker.vim b/sources_non_forked/syntastic/syntax_checkers/z80/z80syntaxchecker.vim new file mode 100644 index 00000000..b68acf13 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/z80/z80syntaxchecker.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: z80.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Romain Giot +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_z80_z80syntaxchecker_checker") + finish +endif +let g:loaded_syntastic_z80_z80syntaxchecker_checker=1 + +"bail if the user doesnt have z80_syntax_checker.py installed +"To obtain this application there are two solutions: +" - Install this python package: https://github.com/rgiot/pycpcdemotools +" - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py +function! SyntaxCheckers_z80_z80syntaxchecker_IsAvailable() + return executable("z80_syntax_checker.py") +endfunction + +function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'z80_syntax_checker.py', + \ 'filetype': 'z80', + \ 'subchecker': 'z80syntaxchecker' }) + + let errorformat = '%f:%l %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'z80', + \ 'name': 'z80syntaxchecker'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/zpt/zptlint.vim b/sources_non_forked/syntastic/syntax_checkers/zpt/zptlint.vim new file mode 100644 index 00000000..ae6ab8a3 --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/zpt/zptlint.vim @@ -0,0 +1,50 @@ +"============================================================================ +"File: zpt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: claytron +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_zpt_zptlint_checker") + finish +endif +let g:loaded_syntastic_zpt_zptlint_checker=1 + +" In order for this plugin to be useful, you will need to set up the +" zpt filetype in your vimrc +" +" " set up zope page templates as the zpt filetype +" au BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml +" +" Then install the zptlint program, found on pypi: +" http://pypi.python.org/pypi/zptlint + +function! SyntaxCheckers_zpt_zptlint_IsAvailable() + return executable("zptlint") +endfunction + +function! SyntaxCheckers_zpt_zptlint_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'zptlint', + \ 'filetype': 'zpt', + \ 'subchecker': 'zptlint' }) + + let errorformat= + \ '%-P*** Error in: %f,'. + \ '%Z%*\s\, at line %l\, column %c,'. + \ '%E%*\s%m,'. + \ '%-Q' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'zpt', + \ 'name': 'zptlint'}) diff --git a/sources_non_forked/syntastic/syntax_checkers/zsh/zsh.vim b/sources_non_forked/syntastic/syntax_checkers/zsh/zsh.vim new file mode 100644 index 00000000..5e339a9c --- /dev/null +++ b/sources_non_forked/syntastic/syntax_checkers/zsh/zsh.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: zsh.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_zsh_zsh_checker") + finish +endif +let g:loaded_syntastic_zsh_zsh_checker=1 + +function! SyntaxCheckers_zsh_zsh_IsAvailable() + return executable("zsh") +endfunction + +function! SyntaxCheckers_zsh_zsh_GetLocList() + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'zsh', + \ 'args': '-n', + \ 'filetype': 'zsh', + \ 'subchecker': 'zsh' }) + + let errorformat = '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat}) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'zsh', + \ 'name': 'zsh'}) diff --git a/sources_non_forked/vim-easymotion/.gitignore b/sources_non_forked/vim-easymotion/.gitignore new file mode 100644 index 00000000..926ccaaf --- /dev/null +++ b/sources_non_forked/vim-easymotion/.gitignore @@ -0,0 +1 @@ +doc/tags diff --git a/sources_non_forked/vim-easymotion/README.md b/sources_non_forked/vim-easymotion/README.md new file mode 100644 index 00000000..7c0caf9d --- /dev/null +++ b/sources_non_forked/vim-easymotion/README.md @@ -0,0 +1,52 @@ +# Introduction + +EasyMotion provides a much simpler way to use some motions in vim. It +takes the `` out of `w` or `f{char}` by +highlighting all possible choices and allowing you to press one key to +jump directly to the target. + +When one of the available motions is triggered, all visible text +preceding or following the cursor is faded, and motion targets are +highlighted. + +EasyMotion is triggered by one of the provided mappings. + +# Important notes about the default bindings + +**The default leader has been changed to `` to avoid +conflicts with other plugins you may have installed.** This can easily be +changed back to pre-1.3 behavior by rebinding the leader in your vimrc: + + let g:EasyMotion_leader_key = '' + +All motions are now triggered with `` by default, e.g. +`t`, `gE`. + +## Usage example + +Type `w` to trigger the word motion `w`. When the motion is +triggered, the text is updated (no braces are actually added, the text +is highlighted in red by default): + + Lorem {a}psum {b}olor {c}it {d}met. + +Press `c` to jump to the beginning of the word "sit": + + Lorem ipsum dolor sit amet. + +Similarly, if you're looking for an "o", you can use the `f` motion. +Type `fo`, and all "o" characters are highlighted: + + L{a}rem ipsum d{b}l{c}r sit amet. + +Press `b` to jump to the second "o": + + Lorem ipsum dolor sit amet. + +Jeffrey Way of Nettuts+ has also [written +a tutorial](http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/) +about EasyMotion. + +## Animated demonstration + +![Animated demonstration](http://oi54.tinypic.com/2yysefm.jpg) diff --git a/sources_non_forked/vim-easymotion/autoload/EasyMotion.vim b/sources_non_forked/vim-easymotion/autoload/EasyMotion.vim new file mode 100644 index 00000000..7c79dd81 --- /dev/null +++ b/sources_non_forked/vim-easymotion/autoload/EasyMotion.vim @@ -0,0 +1,573 @@ +" EasyMotion - Vim motions on speed! +" +" Author: Kim Silkebækken +" Source repository: https://github.com/Lokaltog/vim-easymotion + +" Default configuration functions {{{ + function! EasyMotion#InitOptions(options) " {{{ + for [key, value] in items(a:options) + if ! exists('g:EasyMotion_' . key) + exec 'let g:EasyMotion_' . key . ' = ' . string(value) + endif + endfor + endfunction " }}} + function! EasyMotion#InitHL(group, colors) " {{{ + let group_default = a:group . 'Default' + + " Prepare highlighting variables + let guihl = printf('guibg=%s guifg=%s gui=%s', a:colors.gui[0], a:colors.gui[1], a:colors.gui[2]) + if !exists('g:CSApprox_loaded') + let ctermhl = &t_Co == 256 + \ ? printf('ctermbg=%s ctermfg=%s cterm=%s', a:colors.cterm256[0], a:colors.cterm256[1], a:colors.cterm256[2]) + \ : printf('ctermbg=%s ctermfg=%s cterm=%s', a:colors.cterm[0], a:colors.cterm[1], a:colors.cterm[2]) + else + let ctermhl = '' + endif + + " Create default highlighting group + execute printf('hi default %s %s %s', group_default, guihl, ctermhl) + + " Check if the hl group exists + if hlexists(a:group) + redir => hlstatus | exec 'silent hi ' . a:group | redir END + + " Return if the group isn't cleared + if hlstatus !~ 'cleared' + return + endif + endif + + " No colors are defined for this group, link to defaults + execute printf('hi default link %s %s', a:group, group_default) + endfunction " }}} + function! EasyMotion#InitMappings(motions) "{{{ + for motion in keys(a:motions) + call EasyMotion#InitOptions({ 'mapping_' . motion : g:EasyMotion_leader_key . motion }) + endfor + + if g:EasyMotion_do_mapping + for [motion, fn] in items(a:motions) + if empty(g:EasyMotion_mapping_{motion}) + continue + endif + + silent exec 'nnoremap ' . g:EasyMotion_mapping_{motion} . ' :call EasyMotion#' . fn.name . '(0, ' . fn.dir . ')' + silent exec 'onoremap ' . g:EasyMotion_mapping_{motion} . ' :call EasyMotion#' . fn.name . '(0, ' . fn.dir . ')' + silent exec 'vnoremap ' . g:EasyMotion_mapping_{motion} . ' :call EasyMotion#' . fn.name . '(1, ' . fn.dir . ')' + endfor + endif + endfunction "}}} +" }}} +" Motion functions {{{ + function! EasyMotion#F(visualmode, direction) " {{{ + let char = s:GetSearchChar(a:visualmode) + + if empty(char) + return + endif + + let re = '\C' . escape(char, '.$^~') + + call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1)) + endfunction " }}} + function! EasyMotion#T(visualmode, direction) " {{{ + let char = s:GetSearchChar(a:visualmode) + + if empty(char) + return + endif + + if a:direction == 1 + let re = '\C' . escape(char, '.$^~') . '\zs.' + else + let re = '\C.' . escape(char, '.$^~') + endif + + call s:EasyMotion(re, a:direction, a:visualmode ? visualmode() : '', mode(1)) + endfunction " }}} + function! EasyMotion#WB(visualmode, direction) " {{{ + call s:EasyMotion('\(\<.\|^$\)', a:direction, a:visualmode ? visualmode() : '', '') + endfunction " }}} + function! EasyMotion#WBW(visualmode, direction) " {{{ + call s:EasyMotion('\(\(^\|\s\)\@<=\S\|^$\)', a:direction, a:visualmode ? visualmode() : '', '') + endfunction " }}} + function! EasyMotion#E(visualmode, direction) " {{{ + call s:EasyMotion('\(.\>\|^$\)', a:direction, a:visualmode ? visualmode() : '', mode(1)) + endfunction " }}} + function! EasyMotion#EW(visualmode, direction) " {{{ + call s:EasyMotion('\(\S\(\s\|$\)\|^$\)', a:direction, a:visualmode ? visualmode() : '', mode(1)) + endfunction " }}} + function! EasyMotion#JK(visualmode, direction) " {{{ + call s:EasyMotion('^\(\w\|\s*\zs\|$\)', a:direction, a:visualmode ? visualmode() : '', '') + endfunction " }}} + function! EasyMotion#Search(visualmode, direction) " {{{ + call s:EasyMotion(@/, a:direction, a:visualmode ? visualmode() : '', '') + endfunction " }}} +" }}} +" Helper functions {{{ + function! s:Message(message) " {{{ + echo 'EasyMotion: ' . a:message + endfunction " }}} + function! s:Prompt(message) " {{{ + echohl Question + echo a:message . ': ' + echohl None + endfunction " }}} + function! s:VarReset(var, ...) " {{{ + if ! exists('s:var_reset') + let s:var_reset = {} + endif + + let buf = bufname("") + + if a:0 == 0 && has_key(s:var_reset, a:var) + " Reset var to original value + call setbufvar(buf, a:var, s:var_reset[a:var]) + elseif a:0 == 1 + let new_value = a:0 == 1 ? a:1 : '' + + " Store original value + let s:var_reset[a:var] = getbufvar(buf, a:var) + + " Set new var value + call setbufvar(buf, a:var, new_value) + endif + endfunction " }}} + function! s:SetLines(lines, key) " {{{ + try + " Try to join changes with previous undo block + undojoin + catch + endtry + + for [line_num, line] in a:lines + call setline(line_num, line[a:key]) + endfor + endfunction " }}} + function! s:GetChar() " {{{ + let char = getchar() + + if char == 27 + " Escape key pressed + redraw + + call s:Message('Cancelled') + + return '' + endif + + return nr2char(char) + endfunction " }}} + function! s:GetSearchChar(visualmode) " {{{ + call s:Prompt('Search for character') + + let char = s:GetChar() + + " Check that we have an input char + if empty(char) + " Restore selection + if ! empty(a:visualmode) + silent exec 'normal! gv' + endif + + return '' + endif + + return char + endfunction " }}} +" }}} +" Grouping algorithms {{{ + let s:grouping_algorithms = { + \ 1: 'SCTree' + \ , 2: 'Original' + \ } + " Single-key/closest target priority tree {{{ + " This algorithm tries to assign one-key jumps to all the targets closest to the cursor. + " It works recursively and will work correctly with as few keys as two. + function! s:GroupingAlgorithmSCTree(targets, keys) + " Prepare variables for working + let targets_len = len(a:targets) + let keys_len = len(a:keys) + + let groups = {} + + let keys = reverse(copy(a:keys)) + + " Semi-recursively count targets {{{ + " We need to know exactly how many child nodes (targets) this branch will have + " in order to pass the correct amount of targets to the recursive function. + + " Prepare sorted target count list {{{ + " This is horrible, I know. But dicts aren't sorted in vim, so we need to + " work around that. That is done by having one sorted list with key counts, + " and a dict which connects the key with the keys_count list. + + let keys_count = [] + let keys_count_keys = {} + + let i = 0 + for key in keys + call add(keys_count, 0) + + let keys_count_keys[key] = i + + let i += 1 + endfor + " }}} + + let targets_left = targets_len + let level = 0 + let i = 0 + + while targets_left > 0 + " Calculate the amount of child nodes based on the current level + let childs_len = (level == 0 ? 1 : (keys_len - 1) ) + + for key in keys + " Add child node count to the keys_count array + let keys_count[keys_count_keys[key]] += childs_len + + " Subtract the child node count + let targets_left -= childs_len + + if targets_left <= 0 + " Subtract the targets left if we added too many too + " many child nodes to the key count + let keys_count[keys_count_keys[key]] += targets_left + + break + endif + + let i += 1 + endfor + + let level += 1 + endwhile + " }}} + " Create group tree {{{ + let i = 0 + let key = 0 + + call reverse(keys_count) + + for key_count in keys_count + if key_count > 1 + " We need to create a subgroup + " Recurse one level deeper + let groups[a:keys[key]] = s:GroupingAlgorithmSCTree(a:targets[i : i + key_count - 1], a:keys) + elseif key_count == 1 + " Assign single target key + let groups[a:keys[key]] = a:targets[i] + else + " No target + continue + endif + + let key += 1 + let i += key_count + endfor + " }}} + + " Finally! + return groups + endfunction + " }}} + " Original {{{ + function! s:GroupingAlgorithmOriginal(targets, keys) + " Split targets into groups (1 level) + let targets_len = len(a:targets) + let keys_len = len(a:keys) + + let groups = {} + + let i = 0 + let root_group = 0 + try + while root_group < targets_len + let groups[a:keys[root_group]] = {} + + for key in a:keys + let groups[a:keys[root_group]][key] = a:targets[i] + + let i += 1 + endfor + + let root_group += 1 + endwhile + catch | endtry + + " Flatten the group array + if len(groups) == 1 + let groups = groups[a:keys[0]] + endif + + return groups + endfunction + " }}} + " Coord/key dictionary creation {{{ + function! s:CreateCoordKeyDict(groups, ...) + " Dict structure: + " 1,2 : a + " 2,3 : b + let sort_list = [] + let coord_keys = {} + let group_key = a:0 == 1 ? a:1 : '' + + for [key, item] in items(a:groups) + let key = ( ! empty(group_key) ? group_key : key) + + if type(item) == 3 + " Destination coords + + " The key needs to be zero-padded in order to + " sort correctly + let dict_key = printf('%05d,%05d', item[0], item[1]) + let coord_keys[dict_key] = key + + " We need a sorting list to loop correctly in + " PromptUser, dicts are unsorted + call add(sort_list, dict_key) + else + " Item is a dict (has children) + let coord_key_dict = s:CreateCoordKeyDict(item, key) + + " Make sure to extend both the sort list and the + " coord key dict + call extend(sort_list, coord_key_dict[0]) + call extend(coord_keys, coord_key_dict[1]) + endif + + unlet item + endfor + + return [sort_list, coord_keys] + endfunction + " }}} +" }}} +" Core functions {{{ + function! s:PromptUser(groups) "{{{ + " If only one possible match, jump directly to it {{{ + let group_values = values(a:groups) + + if len(group_values) == 1 + redraw + + return group_values[0] + endif + " }}} + " Prepare marker lines {{{ + let lines = {} + let hl_coords = [] + let coord_key_dict = s:CreateCoordKeyDict(a:groups) + + for dict_key in sort(coord_key_dict[0]) + let target_key = coord_key_dict[1][dict_key] + let [line_num, col_num] = split(dict_key, ',') + + let line_num = str2nr(line_num) + let col_num = str2nr(col_num) + + " Add original line and marker line + if ! has_key(lines, line_num) + let current_line = getline(line_num) + + let lines[line_num] = { 'orig': current_line, 'marker': current_line, 'mb_compensation': 0 } + endif + + " Compensate for byte difference between marker + " character and target character + " + " This has to be done in order to match the correct + " column; \%c matches the byte column and not display + " column. + let target_char_len = strlen(matchstr(lines[line_num]['marker'], '\%' . col_num . 'c.')) + let target_key_len = strlen(target_key) + + " Solve multibyte issues by matching the byte column + " number instead of the visual column + let col_num -= lines[line_num]['mb_compensation'] + + if strlen(lines[line_num]['marker']) > 0 + " Substitute marker character if line length > 0 + let lines[line_num]['marker'] = substitute(lines[line_num]['marker'], '\%' . col_num . 'c.', target_key, '') + else + " Set the line to the marker character if the line is empty + let lines[line_num]['marker'] = target_key + endif + + " Add highlighting coordinates + call add(hl_coords, '\%' . line_num . 'l\%' . col_num . 'c') + + " Add marker/target lenght difference for multibyte + " compensation + let lines[line_num]['mb_compensation'] += (target_char_len - target_key_len) + endfor + + let lines_items = items(lines) + " }}} + " Highlight targets {{{ + let target_hl_id = matchadd(g:EasyMotion_hl_group_target, join(hl_coords, '\|'), 1) + " }}} + + try + " Set lines with markers + call s:SetLines(lines_items, 'marker') + + redraw + + " Get target character {{{ + call s:Prompt('Target key') + + let char = s:GetChar() + " }}} + finally + " Restore original lines + call s:SetLines(lines_items, 'orig') + + " Un-highlight targets {{{ + if exists('target_hl_id') + call matchdelete(target_hl_id) + endif + " }}} + + redraw + endtry + + " Check if we have an input char {{{ + if empty(char) + throw 'Cancelled' + endif + " }}} + " Check if the input char is valid {{{ + if ! has_key(a:groups, char) + throw 'Invalid target' + endif + " }}} + + let target = a:groups[char] + + if type(target) == 3 + " Return target coordinates + return target + else + " Prompt for new target character + return s:PromptUser(target) + endif + endfunction "}}} + function! s:EasyMotion(regexp, direction, visualmode, mode) " {{{ + let orig_pos = [line('.'), col('.')] + let targets = [] + + try + " Reset properties {{{ + call s:VarReset('&scrolloff', 0) + call s:VarReset('&modified', 0) + call s:VarReset('&modifiable', 1) + call s:VarReset('&readonly', 0) + call s:VarReset('&spell', 0) + call s:VarReset('&virtualedit', '') + " }}} + " Find motion targets {{{ + let search_direction = (a:direction == 1 ? 'b' : '') + let search_stopline = line(a:direction == 1 ? 'w0' : 'w$') + + while 1 + let pos = searchpos(a:regexp, search_direction, search_stopline) + + " Reached end of search range + if pos == [0, 0] + break + endif + + " Skip folded lines + if foldclosed(pos[0]) != -1 + continue + endif + + call add(targets, pos) + endwhile + + let targets_len = len(targets) + if targets_len == 0 + throw 'No matches' + endif + " }}} + + let GroupingFn = function('s:GroupingAlgorithm' . s:grouping_algorithms[g:EasyMotion_grouping]) + let groups = GroupingFn(targets, split(g:EasyMotion_keys, '\zs')) + + " Shade inactive source {{{ + if g:EasyMotion_do_shade + let shade_hl_pos = '\%' . orig_pos[0] . 'l\%'. orig_pos[1] .'c' + + if a:direction == 1 + " Backward + let shade_hl_re = '\%'. line('w0') .'l\_.*' . shade_hl_pos + else + " Forward + let shade_hl_re = shade_hl_pos . '\_.*\%'. line('w$') .'l' + endif + + let shade_hl_id = matchadd(g:EasyMotion_hl_group_shade, shade_hl_re, 0) + endif + " }}} + + " Prompt user for target group/character + let coords = s:PromptUser(groups) + + " Update selection {{{ + if ! empty(a:visualmode) + keepjumps call cursor(orig_pos[0], orig_pos[1]) + + exec 'normal! ' . a:visualmode + endif + " }}} + " Handle operator-pending mode {{{ + if a:mode == 'no' + " This mode requires that we eat one more + " character to the right if we're using + " a forward motion + if a:direction != 1 + let coords[1] += 1 + endif + endif + " }}} + + " Update cursor position + call cursor(orig_pos[0], orig_pos[1]) + mark ' + call cursor(coords[0], coords[1]) + + call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']') + catch + redraw + + " Show exception message + call s:Message(v:exception) + + " Restore original cursor position/selection {{{ + if ! empty(a:visualmode) + silent exec 'normal! gv' + else + keepjumps call cursor(orig_pos[0], orig_pos[1]) + endif + " }}} + finally + " Restore properties {{{ + call s:VarReset('&scrolloff') + call s:VarReset('&modified') + call s:VarReset('&modifiable') + call s:VarReset('&readonly') + call s:VarReset('&spell') + call s:VarReset('&virtualedit') + " }}} + " Remove shading {{{ + if g:EasyMotion_do_shade && exists('shade_hl_id') + call matchdelete(shade_hl_id) + endif + " }}} + endtry + endfunction " }}} +" }}} + +" vim: fdm=marker:noet:ts=4:sw=4:sts=4 diff --git a/sources_non_forked/vim-easymotion/doc/easymotion.txt b/sources_non_forked/vim-easymotion/doc/easymotion.txt new file mode 100644 index 00000000..c91a9595 --- /dev/null +++ b/sources_non_forked/vim-easymotion/doc/easymotion.txt @@ -0,0 +1,319 @@ +*easymotion.txt* Version 1.3. Last change: 2011 Nov 7 + + + ______ __ ___ __ _ + / ____/____ ________ __/ |/ /____ / /_(_)____ ____ + / __/ / __ `/ ___/ / / / /|_/ // __ \/ __/ // __ \/ __ \ + / /___ / /_/ (__ ) /_/ / / / // /_/ / /_/ // /_/ / / / / + /_____/ \__,_/____/\__, /_/ /_/ \____/\__/_/ \____/_/ /_/ + /____/ + - Vim motions on speed! + + +============================================================================== +CONTENTS *easymotion-contents* + + 1. Introduction ....................... |easymotion-introduction| + 2. Usage .............................. |easymotion-usage| + 2.1 Default mappings ............... |easymotion-default-mappings| + 3. Requirements ....................... |easymotion-requirements| + 4. Configuration ...................... |easymotion-configuration| + 4.1 EasyMotion_keys ................ |EasyMotion_keys| + 4.2 EasyMotion_do_shade ............ |EasyMotion_do_shade| + 4.3 EasyMotion_do_mapping .......... |EasyMotion_do_mapping| + 4.4 EasyMotion_grouping ............ |EasyMotion_grouping| + 4.5 Custom highlighting ............ |easymotion-custom-hl| + 4.6 Custom mappings ................ |easymotion-custom-mappings| + 4.6.1 Leader key ............... |easymotion-leader-key| + 4.6.2 Custom keys .............. |easymotion-custom-keys| + 5. License ............................ |easymotion-license| + 6. Known bugs ......................... |easymotion-known-bugs| + 7. Contributing ....................... |easymotion-contributing| + 8. Credits ............................ |easymotion-credits| + +============================================================================== +1. Introduction *easymotion* *easymotion-introduction* + +EasyMotion provides a much simpler way to use some motions in vim. It takes +the out of w or f{char} by highlighting all possible +choices and allowing you to press one key to jump directly to the target. + +When one of the available motions is triggered, all visible text preceding or +following the cursor is faded, and motion targets are highlighted. + +============================================================================== +2. Usage *easymotion-usage* + +EasyMotion is triggered by one of the provided mappings (see +|easymotion-default-mappings| for details). + +Example: > + + Lorem ipsum dolor sit amet. + +Type w to trigger the word motion |w|. See +|easymotion-leader-key| for details about the leader key. When the +motion is triggered, the text is updated (no braces are actually added, +the text is highlighted in red by default): > + + Lorem {a}psum {b}olor {c}it {d}met. + +Press "c" to jump to the beginning of the word "sit": > + + Lorem ipsum dolor sit amet. + +Similarly, if you're looking for an "o", you can use the |f| motion. +Type fo, and all "o" characters are highlighted: > + + L{a}rem ipsum d{b}l{c}r sit amet. + +Press "b" to jump to the second "o": > + + Lorem ipsum dolor sit amet. + +And that's it! + +------------------------------------------------------------------------------ +2.1 Default mappings *easymotion-default-mappings* + +The default configuration defines the following mappings in normal, +visual and operator-pending mode: + + Mapping | Details + ------------------|---------------------------------------------- + f{char} | Find {char} to the right. See |f|. + F{char} | Find {char} to the left. See |F|. + t{char} | Till before the {char} to the right. See |t|. + T{char} | Till after the {char} to the left. See |T|. + w | Beginning of word forward. See |w|. + W | Beginning of WORD forward. See |W|. + b | Beginning of word backward. See |b|. + B | Beginning of WORD backward. See |B|. + e | End of word forward. See |e|. + E | End of WORD forward. See |E|. + ge | End of word backward. See |ge|. + gE | End of WORD backward. See |gE|. + j | Line downward. See |j|. + k | Line upward. See |k|. + n | Jump to latest "/" or "?" forward. See |n|. + N | Jump to latest "/" or "?" backward. See |N|. + +See |easymotion-leader-key| and |mapleader| for details about the leader key. +See |easymotion-custom-mappings| for customizing the default mappings. + +============================================================================== +3. Requirements *easymotion-requirements* + +EasyMotion has been developed and tested in vim 7.3, but it should run without +any problems in vim 7.2. + +Vi-compatible mode must be disabled. + +============================================================================== +4. Configuration *easymotion-configuration* + +EasyMotion will work fine without any configuration, but you can override the +default behavior by setting configuration variables globally in your |vimrc| +file. + +Example (this will change the target keys and disable shading): > + + let g:EasyMotion_keys = '1234567890' + let g:EasyMotion_do_shade = 0 + +------------------------------------------------------------------------------ +4.1 EasyMotion_keys *EasyMotion_keys* + +Set the keys which will be used for motion targets. Add as many keys as you +want. There's a lower chance that the motion targets will be grouped if many +keys are available. + +Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + +------------------------------------------------------------------------------ +4.2 EasyMotion_do_shade *EasyMotion_do_shade* + +The default behavior is to shade the text following the cursor (forward +motions) or preceding the cursor (backward motions) to make the motion targets +more visible. Set this option to 0 if you want to disable text shading. + +Default: 1 + +------------------------------------------------------------------------------ +4.3 EasyMotion_do_mapping *EasyMotion_do_mapping* + +Set this option to 0 if you want to disable the default mappings. See +|easymotion-default-mappings| for details about the default mappings. + +Note: If you disable this option, you'll have to map the motions yourself. See +the plugin source code for mapping details. You usually shouldn't need to do +this, see |easymotion-custom-mappings| for customizing the default mappings. + +Default: 1 + +------------------------------------------------------------------------------ +4.4 EasyMotion_grouping *EasyMotion_grouping* + +When there are too many possible targets on the screen, the results have to be +grouped. This configuration option lets you change which grouping algorithm +you want to use. There are two grouping algorithms available: + + * Single-key priority (value: 1) + ------------------- + + This algorithm prioritizes single-key jumps for the targets closest to + the cursor and only groups the last jump targets to maximize the amount + of single-key jumps. + + This algorithm works recursively and will work with as few keys as two. + + Example (with |EasyMotion_keys| = "abcdef"): > + + x x x x x x x x x +< + The |w| motion is triggered: > + + a b c d e f f f f + ^ ^ ^ ^ ^ Direct jump to target + ^ ^ ^ ^ Enter group "f" +< + * Original (value: 2) + -------- + + This is the original algorithm which always groups all targets if there + are too many possible motion targets. + + Example (with |EasyMotion_keys| = "abcdef"): > + + x x x x x x x x x +< + The |w| motion is triggered: > + + a a a a a a b b b + ^ ^ ^ ^ ^ ^ Enter group "a" + ^ ^ ^ Enter group "b" + +Default: 1 + +------------------------------------------------------------------------------ +4.5 Custom highlighting *easymotion-custom-hl* + +The default EasyMotion configuration uses two highlighting groups that link +to groups with default values. The highlighting groups are: + + * EasyMotionTarget + + Highlights motion targets, the default value is bold red + + * EasyMotionShade + + Highlights shaded text, the default value is dark gray + +There are two ways to override the default colors: + + 1) Set the highlighting in your color scheme + + This will only affect a single color scheme. The default red/gray colors + will be used if you change the color scheme to one that doesn't assign + any EasyMotion colors. + + Example: > + + hi EasyMotionTarget ctermbg=none ctermfg=green + hi EasyMotionShade ctermbg=none ctermfg=blue +< + 2) Set the highlighting in your vimrc + + This is ideal if you want to link the colors to highlighting groups that + are available in almost every color scheme, e.g. |ErrorMsg| (usually + bright red) and Comment (usually faded). You can be sure that the + color scheme's colors will be used instead of the default red/gray + if you choose this option. + + Example: > + + hi link EasyMotionTarget ErrorMsg + hi link EasyMotionShade Comment +< +------------------------------------------------------------------------------ +4.6 Custom mappings *easymotion-custom-mappings* + +EasyMotion allows you to customize all default mappings to avoid conflicts +with existing mappings. It is possible to change the default leader key +of all mappings to another key or sequence. It is also possible to fine +tune the plugin to your need by changing every single sequence. + +4.6.1 Leader key *EasyMotion_leader_key* *easymotion-leader-key* + +The default leader key can be changed with the configuration option +|EasyMotion_leader_key|. + +Set this option to the key sequence to use as the prefix of the mappings +described in |easymotion-default-mappings|. + +Note: The default leader key has been changed to '' to +avoid conflicts with other plugins. You can revert to the original +leader by setting this option in your vimrc: > + + let g:EasyMotion_leader_key = '' +< +Default: '' + +4.6.2 Custom Keys *easymotion-custom-keys* + +All custom mappings follow the same variable format: > + + EasyMotion_mapping_{motion} = {mapping} +< +Example: > + + let g:EasyMotion_mapping_f = '_f' + let g:EasyMotion_mapping_T = '' +< +See |easymotion-default-mappings| for a table of motions that can be mapped +and their default values. + +Note: The leader key defined by |EasyMotion_leader_key| is not prepended to +your customized mappings! You have to provide full key sequences when setting +these options. + +============================================================================== +5. License *easymotion-license* + +Creative Commons Attribution-ShareAlike 3.0 Unported + +http://creativecommons.org/licenses/by-sa/3.0/ + +============================================================================== +6. Known bugs *easymotion-known-bugs* + +None. + +============================================================================== +7. Contributing *easymotion-contributing* + +If you experience any bugs or have feature requests, please open an issue on +GitHub. Fork the source repository on GitHub and send a pull request if you +have any code improvements. + +Author: Kim Silkebækken +Source repository: https://github.com/Lokaltog/vim-easymotion + +============================================================================== +8. Credits *easymotion-credits* + +- Ben Boeckel: ge and WORD motions +- Drew Neil: operator-pending mappings +- Rob O'Dwyer: customizable mappings without giving up all defaults +- Michel D'Hooge: customizable leader +- Maxime Bourget: search motion, improved JK motion behavior +- Kearn Holliday: fix jumplist issues +- Shougo Matsushita: fix CSApprox issue + +EasyMotion is based on Bartlomiej Podolak's great PreciseJump script, which +can be downloaded here: + +http://www.vim.org/scripts/script.php?script_id=3437 + +============================================================================== +vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-easymotion/plugin/EasyMotion.vim b/sources_non_forked/vim-easymotion/plugin/EasyMotion.vim new file mode 100644 index 00000000..fff29dca --- /dev/null +++ b/sources_non_forked/vim-easymotion/plugin/EasyMotion.vim @@ -0,0 +1,73 @@ +" EasyMotion - Vim motions on speed! +" +" Author: Kim Silkebækken +" Source repository: https://github.com/Lokaltog/vim-easymotion + +" Script initialization {{{ + if exists('g:EasyMotion_loaded') || &compatible || version < 702 + finish + endif + + let g:EasyMotion_loaded = 1 +" }}} +" Default configuration {{{ + " Default options {{{ + call EasyMotion#InitOptions({ + \ 'leader_key' : '' + \ , 'keys' : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + \ , 'do_shade' : 1 + \ , 'do_mapping' : 1 + \ , 'grouping' : 1 + \ + \ , 'hl_group_target' : 'EasyMotionTarget' + \ , 'hl_group_shade' : 'EasyMotionShade' + \ }) + " }}} + " Default highlighting {{{ + let s:target_hl_defaults = { + \ 'gui' : ['NONE', '#ff0000' , 'bold'] + \ , 'cterm256': ['NONE', '196' , 'bold'] + \ , 'cterm' : ['NONE', 'red' , 'bold'] + \ } + + let s:shade_hl_defaults = { + \ 'gui' : ['NONE', '#777777' , 'NONE'] + \ , 'cterm256': ['NONE', '242' , 'NONE'] + \ , 'cterm' : ['NONE', 'grey' , 'NONE'] + \ } + + call EasyMotion#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults) + call EasyMotion#InitHL(g:EasyMotion_hl_group_shade, s:shade_hl_defaults) + + " Reset highlighting after loading a new color scheme {{{ + augroup EasyMotionInitHL + autocmd! + + autocmd ColorScheme * call EasyMotion#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults) + autocmd ColorScheme * call EasyMotion#InitHL(g:EasyMotion_hl_group_shade, s:shade_hl_defaults) + augroup end + " }}} + " }}} + " Default key mapping {{{ + call EasyMotion#InitMappings({ + \ 'f' : { 'name': 'F' , 'dir': 0 } + \ , 'F' : { 'name': 'F' , 'dir': 1 } + \ , 't' : { 'name': 'T' , 'dir': 0 } + \ , 'T' : { 'name': 'T' , 'dir': 1 } + \ , 'w' : { 'name': 'WB' , 'dir': 0 } + \ , 'W' : { 'name': 'WBW', 'dir': 0 } + \ , 'b' : { 'name': 'WB' , 'dir': 1 } + \ , 'B' : { 'name': 'WBW', 'dir': 1 } + \ , 'e' : { 'name': 'E' , 'dir': 0 } + \ , 'E' : { 'name': 'EW' , 'dir': 0 } + \ , 'ge': { 'name': 'E' , 'dir': 1 } + \ , 'gE': { 'name': 'EW' , 'dir': 1 } + \ , 'j' : { 'name': 'JK' , 'dir': 0 } + \ , 'k' : { 'name': 'JK' , 'dir': 1 } + \ , 'n' : { 'name': 'Search' , 'dir': 0 } + \ , 'N' : { 'name': 'Search' , 'dir': 1 } + \ }) + " }}} +" }}} + +" vim: fdm=marker:noet:ts=4:sw=4:sts=4 diff --git a/sources_non_forked/vim-indent-object/doc/indent-object.txt b/sources_non_forked/vim-indent-object/doc/indent-object.txt index bcb02299..5b581020 100644 --- a/sources_non_forked/vim-indent-object/doc/indent-object.txt +++ b/sources_non_forked/vim-indent-object/doc/indent-object.txt @@ -1,120 +1,120 @@ -*indent-object.txt* Text objects based on indent levels. - - Copyright (c) 2010 Michael Smith - -Indent Text Objects - -INTRODUCTION |idntobj-introduction| -TEXT OBJECTS |idntobj-objects| -BLANK LINES |idntobj-blanklines| -ABOUT |idntobj-about| - - -============================================================================== -INTRODUCTION *idntobj-introduction* - -Vim text objects provide a convenient way to select and operate on various -types of objects. These objects include regions surrounded by various types of -brackets and various parts of language (ie sentences, paragraphs, etc). - -This plugin defines a new text object, based on indentation levels. This is -very useful in languages such as Python, in which the syntax defines scope in -terms of indentation. Using the objects defined in this plugin, an entire if -structure can be quickly selected, for example. - - -============================================================================== -TEXT OBJECTS *ai* *ii* *aI* *iI* *idntobj-objects* - -This plugin defines two new text objects. These are very similar - they differ -only in whether they include the line below the block or not. - - Key Mapping Description ~ -> - ai (A)n (I)ndentation level and line above. - ii (I)nner (I)ndentation level (no line above). - aI (A)n (I)ndentation level and lines above/below. - iI (I)nner (I)ndentation level (no lines above/below). -< - -Note that the iI mapping is mostly included simply for completeness, it is -effectively a synonym for ii. - -Just like regular text objects, these mappings can be used either with -operators expecting a motion, such as 'd' or 'c', as well as in visual mode. -In visual mode the mapping can be repeated, which has the effect of -iteratively increasing the scope of indentation block selected. Specifying a -count can be used to achieve the same effect. - -The difference between |ai| and |aI| is that |ai| includes the line -immediately above the indentation block, whereas aI includes not only that, -but also the line below. Which of these is most useful largely depends on the -structure of the language being edited. - -For example, when editing the Python code, |ai| is generally more useful, as -the line above the indentation block is usually related to it. For example, in -the following code (* is used to indicate the cursor position): -> - if foo > 3: - log("foo is big") * - foo = 3 - do_something_else() -< -the if clause is logically related to the code block, whereas the function -call below is not. It is unlikely we would want to select the line below when -we are interested in the if block. - -However, in other languages, such as Vim scripts, control structures are -usually terminated with something like 'endif'. Therefore, in this example: -> - if foo > 3 - echo "foo is big" * - let foo = 3 - endif - call do_something_else() -< -we would more likely want to include the endif when we select the if -structure. - - -============================================================================== -BLANK LINES *idntobj-blanklines* - -When scanning code blocks, the plugin usually ignores blank lines. There is an -exception to this, however, when the block being selected is not indented. In -this case if blank lines are ignored, then the entire file would be selected. -Instead when code at the top level is being indented blank lines are -considered to delimit the block. - - -============================================================================== -ABOUT *idntobj-about* - -vim-indent-object was written by Michael Smith . The -project repository is kept at: - -http://github.com/michaeljsmith/vim-indent-object - -Any feedback or criticism is welcome, and can be mailed to the author at the -above email address. Alternatively issues can be raised on the project -website. - -Licence: - -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. +*indent-object.txt* Text objects based on indent levels. + + Copyright (c) 2010 Michael Smith + +Indent Text Objects + +INTRODUCTION |idntobj-introduction| +TEXT OBJECTS |idntobj-objects| +BLANK LINES |idntobj-blanklines| +ABOUT |idntobj-about| + + +============================================================================== +INTRODUCTION *idntobj-introduction* + +Vim text objects provide a convenient way to select and operate on various +types of objects. These objects include regions surrounded by various types of +brackets and various parts of language (ie sentences, paragraphs, etc). + +This plugin defines a new text object, based on indentation levels. This is +very useful in languages such as Python, in which the syntax defines scope in +terms of indentation. Using the objects defined in this plugin, an entire if +structure can be quickly selected, for example. + + +============================================================================== +TEXT OBJECTS *ai* *ii* *aI* *iI* *idntobj-objects* + +This plugin defines two new text objects. These are very similar - they differ +only in whether they include the line below the block or not. + + Key Mapping Description ~ +> + ai (A)n (I)ndentation level and line above. + ii (I)nner (I)ndentation level (no line above). + aI (A)n (I)ndentation level and lines above/below. + iI (I)nner (I)ndentation level (no lines above/below). +< + +Note that the iI mapping is mostly included simply for completeness, it is +effectively a synonym for ii. + +Just like regular text objects, these mappings can be used either with +operators expecting a motion, such as 'd' or 'c', as well as in visual mode. +In visual mode the mapping can be repeated, which has the effect of +iteratively increasing the scope of indentation block selected. Specifying a +count can be used to achieve the same effect. + +The difference between |ai| and |aI| is that |ai| includes the line +immediately above the indentation block, whereas aI includes not only that, +but also the line below. Which of these is most useful largely depends on the +structure of the language being edited. + +For example, when editing the Python code, |ai| is generally more useful, as +the line above the indentation block is usually related to it. For example, in +the following code (* is used to indicate the cursor position): +> + if foo > 3: + log("foo is big") * + foo = 3 + do_something_else() +< +the if clause is logically related to the code block, whereas the function +call below is not. It is unlikely we would want to select the line below when +we are interested in the if block. + +However, in other languages, such as Vim scripts, control structures are +usually terminated with something like 'endif'. Therefore, in this example: +> + if foo > 3 + echo "foo is big" * + let foo = 3 + endif + call do_something_else() +< +we would more likely want to include the endif when we select the if +structure. + + +============================================================================== +BLANK LINES *idntobj-blanklines* + +When scanning code blocks, the plugin usually ignores blank lines. There is an +exception to this, however, when the block being selected is not indented. In +this case if blank lines are ignored, then the entire file would be selected. +Instead when code at the top level is being indented blank lines are +considered to delimit the block. + + +============================================================================== +ABOUT *idntobj-about* + +vim-indent-object was written by Michael Smith . The +project repository is kept at: + +http://github.com/michaeljsmith/vim-indent-object + +Any feedback or criticism is welcome, and can be mailed to the author at the +above email address. Alternatively issues can be raised on the project +website. + +Licence: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/sources_non_forked/vim-marked b/sources_non_forked/vim-marked new file mode 160000 index 00000000..a7c1cba2 --- /dev/null +++ b/sources_non_forked/vim-marked @@ -0,0 +1 @@ +Subproject commit a7c1cba232cabd96af800f82aad21cc180a09764 diff --git a/sources_non_forked/vim-misc b/sources_non_forked/vim-misc new file mode 160000 index 00000000..8551f2b9 --- /dev/null +++ b/sources_non_forked/vim-misc @@ -0,0 +1 @@ +Subproject commit 8551f2b9dec7fd17dd5c3476d7869957185d692d diff --git a/sources_non_forked/vim-notes b/sources_non_forked/vim-notes new file mode 160000 index 00000000..14838be7 --- /dev/null +++ b/sources_non_forked/vim-notes @@ -0,0 +1 @@ +Subproject commit 14838be7c5330592578346ef6e69d7a198b48dbe diff --git a/sources_non_forked/vim-ruby b/sources_non_forked/vim-ruby new file mode 160000 index 00000000..b60da6c6 --- /dev/null +++ b/sources_non_forked/vim-ruby @@ -0,0 +1 @@ +Subproject commit b60da6c63bba329aa0327a2859639f9a02afc3ed diff --git a/sources_non_forked/vim-trailing-whitespace b/sources_non_forked/vim-trailing-whitespace new file mode 160000 index 00000000..6bfea000 --- /dev/null +++ b/sources_non_forked/vim-trailing-whitespace @@ -0,0 +1 @@ +Subproject commit 6bfea0006a364c60e5e7e0daecb9a3899312cb58