1
0
mirror of https://github.com/amix/vimrc synced 2025-06-28 18:44:59 +08:00

Updated plugins and added vim-markdown

This commit is contained in:
Amir Salihefendic
2018-02-04 12:35:08 +01:00
parent 2514de5b22
commit 8eeefe86c2
111 changed files with 6623 additions and 923 deletions

View File

@ -69,8 +69,9 @@ MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl
NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity,
Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL,
Vim help, VimL, Vue.js, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models,
z80, Zope page templates, and Zsh. See the [manual][checkers] for details about
the corresponding supported checkers (`:help syntastic-checkers` in Vim).
YARA rules, z80, Zope page templates, and Zsh. See the [manual][checkers] for
details about the corresponding supported checkers (`:help syntastic-checkers`
in Vim).
A number of third-party Vim plugins also provide checkers for syntastic, for
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],

View File

@ -634,17 +634,27 @@ endfunction " }}}2
function! syntastic#preprocess#mypy(errors) abort " {{{2
let out = []
for e in a:errors
" new format
let parts = matchlist(e, '\v^(.{-1,}):(\d+): error: (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
" column numbers
let parts = matchlist(e, '\v^(.{-1,}):(\d+):(\d+): ([ew])%(rror|arning): (.+)')
if len(parts) > 5
let parts[3] += 1
call add(out, join(parts[1:5], ':'))
continue
endif
" old format
" no column numbers
let parts = matchlist(e, '\v^(.{-1,}):(\d+): ([ew])%(rror|arning): (.+)')
if len(parts) > 4
call add(out, join(parts[1:4], ':'))
continue
endif
" obsolete format
let parts = matchlist(e, '\v^(.{-1,}), line (\d+): (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
let parts[4] = parts[3]
let parts[3] = 'e'
call add(out, join(parts[1:4], ':'))
endif
endfor
return out

View File

@ -132,6 +132,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
YACC.....................................|syntastic-checkers-yacc|
YAML.....................................|syntastic-checkers-yaml|
YANG.....................................|syntastic-checkers-yang|
YARA.....................................|syntastic-checkers-yara|
Z80......................................|syntastic-checkers-z80|
Zope Page Templates......................|syntastic-checkers-zpt|
@ -1119,7 +1120,7 @@ one option per line (cf. |syntastic-config-files|).
Note~
By default you can set "ClangTidy" parameters in
'g:syntastic_ppc_clang_tidy_args', and compilation parameters (defines,
'g:syntastic_cpp_clang_tidy_args', and compilation parameters (defines,
optimisation flags, etc.) in the configuration file.
If you want "ClangTidy" to use compilation databases
@ -7629,6 +7630,36 @@ You probably also need a plugin to set |filetype| for YANG files, such as
https://github.com/nathanalderson/yang.vim
==============================================================================
SYNTAX CHECKERS FOR YARA *syntastic-checkers-yara*
The following checkers are available for YARA rule files (filetype "yara"):
1. yarac....................|syntastic-yara-yarac|
------------------------------------------------------------------------------
1. yarac *syntastic-yara-yarac*
Name: yarac
Maintainer: Albert Song <albb@teamt5.org>
"yarac" is the official compiler for YARA rule files. See the project's page
at GitHub for more information:
https://github.com/VirusTotal/yara
Checker options~
This checker is initialised using the "makeprgBuild()" function and thus it
accepts the standard options described at |syntastic-config-makeprg|.
Note~
You probably also need a plugin to set |filetype| for YARA rule files, such as
"vim-yara":
https://github.com/yaunj/vim-yara
==============================================================================
SYNTAX CHECKERS FOR Z80 *syntastic-checkers-z80*

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif
let g:_SYNTASTIC_VERSION = '3.8.0-97'
let g:_SYNTASTIC_VERSION = '3.8.0-101'
lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1

View File

@ -112,6 +112,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'yacc': ['bison'],
\ 'yaml': ['jsyaml'],
\ 'yang': ['pyang'],
\ 'yara': ['yarac'],
\ 'z80': ['z80syntaxchecker'],
\ 'zpt': ['zptlint'],
\ 'zsh': ['zsh'],

View File

@ -69,6 +69,7 @@ rebar_opts(RebarFile) ->
Dir = get_root(filename:dirname(RebarFile)),
case file:consult(RebarFile) of
{ok, Terms} ->
%% Add deps for a rebar (version < 3) project
RebarLibDirs = proplists:get_value(lib_dirs, Terms, []),
lists:foreach(
fun(LibDir) ->
@ -76,8 +77,14 @@ rebar_opts(RebarFile) ->
end, RebarLibDirs),
RebarDepsDir = proplists:get_value(deps_dir, Terms, "deps"),
code:add_pathsa(filelib:wildcard(RebarDepsDir ++ "/*/ebin")),
IncludeDeps = {i, filename:join(Dir, RebarDepsDir)},
proplists:get_value(erl_opts, Terms, []) ++ [IncludeDeps];
%% Add deps for rebar 3
code:add_pathsa(filelib:wildcard(Dir ++ "/_build/default/lib/*/ebin")),
%% Add include dependencies
IncludeDeps = [{i, IPath} || IPath <- filelib:wildcard(Dir ++ "/_build/default/lib/*")] ++
[{i, filename:join(Dir, RebarDepsDir)}, %% rebar 2 dependencies
{i, filename:join(Dir, "apps")}], %% rebar 3 multi-apps
proplists:get_value(erl_opts, Terms, []) ++ IncludeDeps;
{error, _} when RebarFile == "rebar.config" ->
fallback_opts();
{error, _} ->
@ -258,12 +265,19 @@ apps_dir_from_src(SrcFile) ->
SrcDir = filename:dirname(SrcFile),
filename:join(SrcDir, "../../ebin").
%% Find the root directory of the project
get_root(Dir) ->
Path = filename:split(filename:absname(Dir)),
filename:join(get_root(lists:reverse(Path), Path)).
get_root([], Path) ->
Path;
%% Strip off /apps/<appname>/src from the end of the path
%% (rebar 3 multi-app project)
get_root(["src", _Appname, "apps" | Tail], _Path) ->
lists:reverse(Tail);
%% Strip off /src or /test from the end of the path
%% (single-app project)
get_root(["src" | Tail], _Path) ->
lists:reverse(Tail);
get_root(["test" | Tail], _Path) ->

View File

@ -14,14 +14,21 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_mypy_GetLocList() dict
let makeprg = self.makeprgBuild({})
if !exists('s:mypy_new')
" creative versioning: version string has changed from v0.4.6 to v0.470
" XXX the test should be fine for now, since 470 > 4
let s:mypy_new = syntastic#util#versionIsAtLeast(self.getVersion(), [0, 4, 5])
endif
let errorformat = '%f:%l:%m'
let makeprg = self.makeprgBuild({ 'args_after': (s:mypy_new ? '--show-column-numbers' : '') })
let errorformat =
\ '%f:%l:%c:%t:%m,' .
\ '%f:%l:%t:%m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': { 'type': 'E' },
\ 'returns': [0, 1],
\ 'preprocess': 'mypy' })
endfunction

View File

@ -0,0 +1,41 @@
"============================================================================
"File: yara.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: Albert Song (albb@teamt5.org)
"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_yara_yarac_checker')
finish
endif
let g:loaded_syntastic_yara_yarac_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_yara_yarac_GetLocList() dict
let makeprg = self.makeprgBuild({ 'fname_after' : syntastic#util#DevNull() })
let errorformat =
\ '%f(%l): %trror: %m,' .
\ '%f(%l): %tarning: %m,' .
\ '%f(%l): %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'yara',
\ 'name': 'yarac'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker: