commit
f90bdd944d
176 changed files with 8745 additions and 2729 deletions
|
@ -58,6 +58,10 @@ This is useful to install on remote servers where you don't need many plugins an
|
|||
Use [msysgit](http://msysgit.github.com/) to checkout the repository and run the installation instructions above. No special instructions needed ;-)
|
||||
|
||||
|
||||
## How to install on Linux
|
||||
|
||||
If you have vim aliased as `vi` instead of `vim`, make sure to either alias it: `alias vi=vim`. Otherwise, `apt-get install vim`
|
||||
|
||||
## How to update to latest version?
|
||||
|
||||
Simply just do a git rebase!
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
" =============================================================================
|
||||
" File: autoload/ctrlp.vim
|
||||
" Description: Fuzzy file, buffer, mru, tag, etc finder.
|
||||
" Author: Kien Nguyen <github.com/kien>
|
||||
" Version: 1.79
|
||||
" Author: CtrlP Dev Team
|
||||
" Original: Kien Nguyen <github.com/kien>
|
||||
" Version: 1.80
|
||||
" =============================================================================
|
||||
|
||||
" ** Static variables {{{1
|
||||
|
@ -97,6 +98,8 @@ let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] =
|
|||
\ 'compare_lim': ['s:compare_lim', 3000],
|
||||
\ 'bufname_mod': ['s:bufname_mod', ':t'],
|
||||
\ 'bufpath_mod': ['s:bufpath_mod', ':~:.:h'],
|
||||
\ 'formatline_func': ['s:flfunc', 's:formatline(v:val)'],
|
||||
\ 'user_command_async': ['s:usrcmdasync', 0],
|
||||
\ }, {
|
||||
\ 'open_multiple_files': 's:opmul',
|
||||
\ 'regexp': 's:regexp',
|
||||
|
@ -203,11 +206,21 @@ let s:hlgrps = {
|
|||
\ }
|
||||
|
||||
" lname, sname of the basic(non-extension) modes
|
||||
let s:coretypes = [
|
||||
\ ['files', 'fil'],
|
||||
\ ['buffers', 'buf'],
|
||||
\ ['mru files', 'mru'],
|
||||
\ ]
|
||||
let s:types = ['fil', 'buf', 'mru']
|
||||
if !exists('g:ctrlp_types')
|
||||
let g:ctrlp_types = s:types
|
||||
el
|
||||
call filter(g:ctrlp_types, "index(['fil', 'buf', 'mru'], v:val)!=-1")
|
||||
en
|
||||
let g:ctrlp_builtins = len(g:ctrlp_types)-1
|
||||
|
||||
let s:coretype_names = {
|
||||
\ 'fil' : 'files',
|
||||
\ 'buf' : 'buffers',
|
||||
\ 'mru' : 'mru files',
|
||||
\ }
|
||||
|
||||
let s:coretypes = map(copy(g:ctrlp_types), '[s:coretype_names[v:val], v:val]')
|
||||
|
||||
" Get the options {{{2
|
||||
fu! s:opts(...)
|
||||
|
@ -317,11 +330,11 @@ fu! s:Open()
|
|||
cal s:setupblank()
|
||||
endf
|
||||
|
||||
fu! s:Close(exit)
|
||||
fu! s:Close()
|
||||
cal s:buffunc(0)
|
||||
if winnr('$') == 1
|
||||
bw!
|
||||
elsei a:exit
|
||||
el
|
||||
try | bun!
|
||||
cat | clo! | endt
|
||||
cal s:unmarksigns()
|
||||
|
@ -422,6 +435,11 @@ fu! s:GlobPath(dirs, depth)
|
|||
en
|
||||
endf
|
||||
|
||||
fu! ctrlp#addfile(ch, file)
|
||||
call add(g:ctrlp_allfiles, a:file)
|
||||
cal s:BuildPrompt(1)
|
||||
endf
|
||||
|
||||
fu! s:UserCmd(lscmd)
|
||||
let [path, lscmd] = [s:dyncwd, a:lscmd]
|
||||
let do_ign =
|
||||
|
@ -437,11 +455,17 @@ fu! s:UserCmd(lscmd)
|
|||
if (has('win32') || has('win64')) && match(&shell, 'sh') != -1
|
||||
let path = tr(path, '\', '/')
|
||||
en
|
||||
if has('patch-7.4-597') && !(has('win32') || has('win64'))
|
||||
if s:usrcmdasync && v:version >= 800 && exists('*job_start')
|
||||
if exists('s:job')
|
||||
call job_stop(s:job)
|
||||
en
|
||||
let g:ctrlp_allfiles = []
|
||||
let s:job = job_start([&shell, &shellcmdflag, printf(lscmd, path)], {'callback': 'ctrlp#addfile'})
|
||||
elsei has('patch-7.4-597') && !(has('win32') || has('win64'))
|
||||
let g:ctrlp_allfiles = systemlist(printf(lscmd, path))
|
||||
else
|
||||
el
|
||||
let g:ctrlp_allfiles = split(system(printf(lscmd, path)), "\n")
|
||||
end
|
||||
en
|
||||
if exists('+ssl') && exists('ssl')
|
||||
let &ssl = ssl
|
||||
cal map(g:ctrlp_allfiles, 'tr(v:val, "\\", "/")')
|
||||
|
@ -624,7 +648,7 @@ fu! s:Render(lines, pat)
|
|||
en
|
||||
if s:mw_order == 'btt' | cal reverse(lines) | en
|
||||
let s:lines = copy(lines)
|
||||
cal map(lines, 's:formatline(v:val)')
|
||||
cal map(lines, s:flfunc)
|
||||
cal setline(1, s:offset(lines, height))
|
||||
cal s:unmarksigns()
|
||||
cal s:remarksigns()
|
||||
|
@ -649,7 +673,7 @@ fu! s:Update(str)
|
|||
let pat = s:matcher == {} ? s:SplitPattern(str) : str
|
||||
let lines = s:nolim == 1 && empty(str) ? copy(g:ctrlp_lines)
|
||||
\ : s:MatchedItems(g:ctrlp_lines, pat, s:mw_res)
|
||||
if empty(str) | call clearmatches() | en
|
||||
if empty(str) | cal clearmatches() | en
|
||||
cal s:Render(lines, pat)
|
||||
return lines
|
||||
endf
|
||||
|
@ -719,7 +743,7 @@ fu! s:PrtBS()
|
|||
if empty(s:prompt[0]) && s:brfprt != 0
|
||||
cal s:PrtExit()
|
||||
retu
|
||||
endif
|
||||
en
|
||||
unl! s:hstgot
|
||||
let [s:prompt[0], s:matches] = [substitute(s:prompt[0], '.$', '', ''), 1]
|
||||
cal s:BuildPrompt(1)
|
||||
|
@ -877,12 +901,13 @@ fu! s:PrtFocusMap(char)
|
|||
endf
|
||||
|
||||
fu! s:PrtClearCache()
|
||||
if s:itemtype == 0
|
||||
let ct = s:curtype()
|
||||
if ct == 'fil'
|
||||
cal ctrlp#clr()
|
||||
elsei s:itemtype > 2
|
||||
elsei s:itemtype >= len(s:coretypes)
|
||||
cal ctrlp#clr(s:statypes[s:itemtype][1])
|
||||
en
|
||||
if s:itemtype == 2
|
||||
if ct == 'mru'
|
||||
let g:ctrlp_lines = ctrlp#mrufiles#refresh()
|
||||
el
|
||||
cal ctrlp#setlines()
|
||||
|
@ -893,9 +918,10 @@ fu! s:PrtClearCache()
|
|||
endf
|
||||
|
||||
fu! s:PrtDeleteEnt()
|
||||
if s:itemtype == 2
|
||||
let ct = s:curtype()
|
||||
if ct == 'mru'
|
||||
cal s:PrtDeleteMRU()
|
||||
elsei s:itemtype == 1
|
||||
elsei ct == 'buf'
|
||||
cal s:delbuf()
|
||||
elsei type(s:getextvar('wipe')) == 1
|
||||
cal s:delent(s:getextvar('wipe'))
|
||||
|
@ -903,16 +929,19 @@ fu! s:PrtDeleteEnt()
|
|||
endf
|
||||
|
||||
fu! s:PrtDeleteMRU()
|
||||
if s:itemtype == 2
|
||||
if s:curtype() == 'mru'
|
||||
cal s:delent('ctrlp#mrufiles#remove')
|
||||
en
|
||||
endf
|
||||
|
||||
fu! s:PrtExit()
|
||||
let bw = bufwinnr('%')
|
||||
exe bufwinnr(s:bufnr).'winc w'
|
||||
if bufnr('%') == s:bufnr && bufname('%') == 'ControlP'
|
||||
noa cal s:Close(1)
|
||||
noa cal s:Close()
|
||||
noa winc p
|
||||
els
|
||||
exe bw.'winc w'
|
||||
en
|
||||
endf
|
||||
|
||||
|
@ -1011,7 +1040,7 @@ fu! s:ToggleByFname()
|
|||
endf
|
||||
|
||||
fu! s:ToggleType(dir)
|
||||
let max = len(g:ctrlp_ext_vars) + 2
|
||||
let max = len(g:ctrlp_ext_vars) + len(s:coretypes) - 1
|
||||
let next = s:walker(max, s:itemtype, a:dir)
|
||||
cal ctrlp#setlines(next)
|
||||
cal ctrlp#syntax()
|
||||
|
@ -1151,7 +1180,7 @@ fu! s:AcceptSelection(action)
|
|||
if subm | if s:SpecInputs(str) | retu | en | en
|
||||
" Get the selected line
|
||||
let line = ctrlp#getcline()
|
||||
if !subm && !s:itemtype && line == '' && line('.') > s:offset
|
||||
if !subm && s:curtype() != 'fil' && line == '' && line('.') > s:offset
|
||||
\ && str !~ '\v^(\.\.([\/]\.\.)*[\/]?[.\/]*|/|\\|\?|\@.+)$'
|
||||
cal s:CreateNewFile(md) | retu
|
||||
en
|
||||
|
@ -1161,7 +1190,7 @@ fu! s:AcceptSelection(action)
|
|||
let actfunc = s:openfunc[s:ctype]
|
||||
let type = has_key(s:openfunc, 'arg_type') ? s:openfunc['arg_type'] : 'list'
|
||||
el
|
||||
if s:itemtype < 3
|
||||
if s:itemtype < len(s:coretypes)
|
||||
let [actfunc, type] = ['ctrlp#acceptfile', 'dict']
|
||||
el
|
||||
let [actfunc, exttype] = [s:getextvar('accept'), s:getextvar('act_farg')]
|
||||
|
@ -1206,15 +1235,16 @@ fu! s:CreateNewFile(...)
|
|||
endf
|
||||
" * OpenMulti() {{{1
|
||||
fu! s:MarkToOpen()
|
||||
let ct = s:curtype()
|
||||
if s:bufnr <= 0 || s:opmul == '0'
|
||||
\ || ( s:itemtype > 2 && s:getextvar('opmul') != 1 )
|
||||
\ || ( s:itemtype >= len(s:coretypes) && s:getextvar('opmul') != 1 )
|
||||
retu
|
||||
en
|
||||
let line = ctrlp#getcline()
|
||||
|
||||
" Do not allow to mark modified or current buffer
|
||||
let bufnr = s:bufnrfilpath(line)[0]
|
||||
if (s:itemtype == 1 && s:delbufcond(bufnr))
|
||||
if (ct == 'buf' && s:delbufcond(bufnr))
|
||||
retu
|
||||
en
|
||||
|
||||
|
@ -1247,7 +1277,7 @@ endf
|
|||
fu! s:OpenMulti(...)
|
||||
let has_marked = exists('s:marked')
|
||||
if ( !has_marked && a:0 ) || s:opmul == '0' || !s:ispath
|
||||
\ || ( s:itemtype > 2 && s:getextvar('opmul') != 1 )
|
||||
\ || ( s:itemtype >= len(s:coretypes) && s:getextvar('opmul') != 1 )
|
||||
retu -1
|
||||
en
|
||||
" Get the options
|
||||
|
@ -1442,7 +1472,8 @@ fu! s:shortest(lens)
|
|||
endf
|
||||
|
||||
fu! s:mixedsort(...)
|
||||
if s:itemtype == 1
|
||||
let ct = s:curtype()
|
||||
if ct == 'buf'
|
||||
let pat = '[\/]\?\[\d\+\*No Name\]$'
|
||||
if a:1 =~# pat && a:2 =~# pat | retu 0
|
||||
elsei a:1 =~# pat | retu 1
|
||||
|
@ -1453,10 +1484,10 @@ fu! s:mixedsort(...)
|
|||
let ms = []
|
||||
if s:res_count < 21
|
||||
let ms += [s:compfnlen(a:1, a:2)]
|
||||
if s:itemtype !~ '^[12]$' | let ms += [s:comptime(a:1, a:2)] | en
|
||||
if ct !~ '^\(buf\|mru\)$' | let ms += [s:comptime(a:1, a:2)] | en
|
||||
if !s:itemtype | let ms += [s:comparent(a:1, a:2)] | en
|
||||
en
|
||||
if s:itemtype =~ '^[12]$'
|
||||
if ct =~ '^\(buf\|mru\)$'
|
||||
let ms += [s:compmref(a:1, a:2)]
|
||||
let cln = cml ? cln : 0
|
||||
en
|
||||
|
@ -1540,7 +1571,8 @@ endf
|
|||
" Line formatting {{{3
|
||||
fu! s:formatline(str)
|
||||
let str = a:str
|
||||
if s:itemtype == 1
|
||||
let ct = s:curtype()
|
||||
if ct == 'buf'
|
||||
let bufnr = s:bufnrfilpath(str)[0]
|
||||
let parts = s:bufparts(bufnr)
|
||||
let str = printf('%'.s:bufnr_width.'s', bufnr)
|
||||
|
@ -1552,7 +1584,7 @@ fu! s:formatline(str)
|
|||
let str .= printf(' %s', '<bp>'.parts[3].'</bp>')
|
||||
en
|
||||
el
|
||||
let str .= printf(' %-5s %-30s %s',
|
||||
let str .= printf(' %-5s %-30s',
|
||||
\ parts[0],
|
||||
\ parts[2])
|
||||
if (!empty(s:bufpath_mod))
|
||||
|
@ -1560,7 +1592,7 @@ fu! s:formatline(str)
|
|||
en
|
||||
en
|
||||
en
|
||||
let cond = s:itemtype != 1 &&s:ispath && ( s:winw - 4 ) < s:strwidth(str)
|
||||
let cond = ct != 'buf' &&s:ispath && ( s:winw - 4 ) < s:strwidth(str)
|
||||
retu s:lineprefix.( cond ? s:pathshorten(str) : str )
|
||||
endf
|
||||
|
||||
|
@ -1615,7 +1647,7 @@ fu! s:lash(...)
|
|||
endf
|
||||
|
||||
fu! s:ispathitem()
|
||||
retu s:itemtype < 3 || ( s:itemtype > 2 && s:getextvar('type') == 'path' )
|
||||
retu s:itemtype < len(s:coretypes) || s:getextvar('type') == 'path'
|
||||
endf
|
||||
|
||||
fu! ctrlp#igncwd(cwd)
|
||||
|
@ -1649,11 +1681,11 @@ fu! ctrlp#dirnfile(entries)
|
|||
endf
|
||||
|
||||
fu! s:usrign(item, type)
|
||||
if s:igntype == 1 | retu a:item =~ s:usrign | end
|
||||
if s:igntype == 1 | retu a:item =~ s:usrign | en
|
||||
if s:igntype == 2
|
||||
if call(s:usrign, [a:item, a:type])
|
||||
retu 1
|
||||
end
|
||||
en
|
||||
elsei s:igntype == 4
|
||||
if has_key(s:usrign, a:type) && s:usrign[a:type] != ''
|
||||
\ && a:item =~ s:usrign[a:type]
|
||||
|
@ -1661,8 +1693,8 @@ fu! s:usrign(item, type)
|
|||
elsei has_key(s:usrign, 'func') && s:usrign['func'] != ''
|
||||
\ && call(s:usrign['func'], [a:item, a:type])
|
||||
retu 1
|
||||
end
|
||||
end
|
||||
en
|
||||
en
|
||||
retu 0
|
||||
endf
|
||||
|
||||
|
@ -1772,7 +1804,7 @@ fu! ctrlp#syntax()
|
|||
exe "sy match CtrlPLinePre '^".escape(get(g:, 'ctrlp_line_prefix', '>'),'^$.*~\')."'"
|
||||
en
|
||||
|
||||
if s:itemtype == 1 && s:has_conceal
|
||||
if s:curtype() == 'buf' && s:has_conceal
|
||||
sy region CtrlPBufferNr matchgroup=CtrlPLinePre start='^>\s\+' end='\s'
|
||||
sy region CtrlPBufferInd concealends matchgroup=Ignore start='<bi>' end='</bi>'
|
||||
sy region CtrlPBufferRegion concealends matchgroup=Ignore start='<bn>' end='</bn>'
|
||||
|
@ -1810,7 +1842,7 @@ fu! s:highlight(pat, grp)
|
|||
if s:byfname()
|
||||
" Make sure there are no slashes in our match
|
||||
let beginning = beginning.'\([^\/]*$\)\@='
|
||||
end
|
||||
en
|
||||
|
||||
for i in range(len(chars))
|
||||
" Surround our current target letter with \zs and \ze so it only
|
||||
|
@ -1822,14 +1854,14 @@ fu! s:highlight(pat, grp)
|
|||
if i == 0
|
||||
let charcopy[i] = '\zs'.charcopy[i].'\ze'
|
||||
let middle = join(charcopy, '.\{-}')
|
||||
else
|
||||
el
|
||||
let before = join(charcopy[0:i-1], '.\{-}')
|
||||
let after = join(charcopy[i+1:-1], '.\{-}')
|
||||
let c = charcopy[i]
|
||||
" for abc, match either ab.\{-}c or a.*b.\{-}c in that order
|
||||
let cpat = '\(\zs'.c.'\|'.'.*\zs'.c.'\)\ze.*'
|
||||
let middle = before.cpat.after
|
||||
endif
|
||||
en
|
||||
|
||||
" Now we matchadd for each letter, the basic form being:
|
||||
" ^.*\zsx\ze.*$, but with our pattern we built above for the letter,
|
||||
|
@ -1956,7 +1988,7 @@ fu! s:isabs(path)
|
|||
endf
|
||||
|
||||
fu! s:bufnrfilpath(line)
|
||||
if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/'
|
||||
if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/'
|
||||
let filpath = a:line
|
||||
el
|
||||
let filpath = s:dyncwd.s:lash().a:line
|
||||
|
@ -2026,7 +2058,7 @@ fu! s:checkbuf()
|
|||
endf
|
||||
|
||||
fu! s:iscmdwin()
|
||||
let ermsg = v:errmsg
|
||||
let [ermsg, v:errmsg] = [v:errmsg, '']
|
||||
sil! noa winc p
|
||||
sil! noa winc p
|
||||
let [v:errmsg, ermsg] = [ermsg, v:errmsg]
|
||||
|
@ -2140,12 +2172,13 @@ fu! s:modevar()
|
|||
endf
|
||||
|
||||
fu! s:nosort()
|
||||
retu s:matcher != {} || s:nolim == 1 || ( s:itemtype == 2 && s:mrudef )
|
||||
\ || ( s:itemtype =~ '\v^(1|2)$' && s:prompt == ['', '', ''] ) || !s:dosort
|
||||
let ct = s:curtype()
|
||||
retu s:matcher != {} || s:nolim == 1 || ( ct == 'mru' && s:mrudef )
|
||||
\ || ( ct =~ '^\(buf\|mru\)$' && s:prompt == ['', '', ''] ) || !s:dosort
|
||||
endf
|
||||
|
||||
fu! s:byfname()
|
||||
retu s:itemtype != 1 && s:ispath && s:byfname
|
||||
retu s:curtype() != 'buf' && s:ispath && s:byfname
|
||||
endf
|
||||
|
||||
fu! s:narrowable()
|
||||
|
@ -2374,13 +2407,17 @@ fu! s:buildpat(lst)
|
|||
retu pat
|
||||
endf
|
||||
|
||||
fu! s:curtype()
|
||||
return s:CurTypeName()[1]
|
||||
endf
|
||||
|
||||
fu! s:mfunc()
|
||||
let mfunc = 'match'
|
||||
if s:byfname()
|
||||
let mfunc = 's:matchfname'
|
||||
elsei s:itemtype == 1
|
||||
elsei s:curtype() == 'buf'
|
||||
let mfunc = 's:matchbuf'
|
||||
elsei s:itemtype > 2
|
||||
elsei s:itemtype >= len(s:coretypes)
|
||||
let matchtypes = { 'tabs': 's:matchtabs', 'tabe': 's:matchtabe' }
|
||||
if has_key(matchtypes, s:matchtype)
|
||||
let mfunc = matchtypes[s:matchtype]
|
||||
|
@ -2439,7 +2476,7 @@ fu! s:insertcache(str)
|
|||
endf
|
||||
" Extensions {{{2
|
||||
fu! s:mtype()
|
||||
retu s:itemtype > 2 ? s:getextvar('type') : 'path'
|
||||
retu s:itemtype >= len(s:coretypes) ? s:getextvar('type') : 'path'
|
||||
endf
|
||||
|
||||
fu! s:execextvar(key)
|
||||
|
@ -2450,8 +2487,8 @@ fu! s:execextvar(key)
|
|||
endf
|
||||
|
||||
fu! s:getextvar(key)
|
||||
if s:itemtype > 2
|
||||
let vars = g:ctrlp_ext_vars[s:itemtype - 3]
|
||||
if s:itemtype >= len(s:coretypes) && len(g:ctrlp_ext_vars) > 0
|
||||
let vars = g:ctrlp_ext_vars[s:itemtype - len(s:coretypes)]
|
||||
retu has_key(vars, a:key) ? vars[a:key] : -1
|
||||
en
|
||||
retu get(g:, 'ctrlp_' . s:matchtype . '_' . a:key, -1)
|
||||
|
@ -2505,7 +2542,8 @@ endf
|
|||
fu! ctrlp#setlines(...)
|
||||
if a:0 | let s:itemtype = a:1 | en
|
||||
cal s:modevar()
|
||||
let types = ['ctrlp#files()', 'ctrlp#buffers()', 'ctrlp#mrufiles#list()']
|
||||
let inits = {'fil': 'ctrlp#files()', 'buf': 'ctrlp#buffers()', 'mru': 'ctrlp#mrufiles#list()'}
|
||||
let types = map(copy(g:ctrlp_types), 'inits[v:val]')
|
||||
if !empty(g:ctrlp_ext_vars)
|
||||
cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])')
|
||||
en
|
||||
|
@ -2514,11 +2552,11 @@ endf
|
|||
|
||||
" Returns [lname, sname]
|
||||
fu! s:CurTypeName()
|
||||
if s:itemtype < 3
|
||||
return s:coretypes[s:itemtype]
|
||||
else
|
||||
if s:itemtype < len(s:coretypes)
|
||||
return filter(copy(s:coretypes), 'v:val[1]==g:ctrlp_types[s:itemtype]')[0]
|
||||
el
|
||||
return [s:getextvar("lname"), s:getextvar('sname')]
|
||||
endif
|
||||
en
|
||||
endfu
|
||||
|
||||
fu! s:ExitIfSingleCandidate()
|
||||
|
@ -2526,7 +2564,7 @@ fu! s:ExitIfSingleCandidate()
|
|||
call s:AcceptSelection('e')
|
||||
call ctrlp#exit()
|
||||
return 1
|
||||
endif
|
||||
en
|
||||
return 0
|
||||
endfu
|
||||
|
||||
|
@ -2539,14 +2577,27 @@ fu! ctrlp#init(type, ...)
|
|||
cal s:SetWD(a:0 ? a:1 : {})
|
||||
cal s:MapNorms()
|
||||
cal s:MapSpecs()
|
||||
cal ctrlp#setlines(s:settype(a:type))
|
||||
if empty(g:ctrlp_types) && empty(g:ctrlp_ext_vars)
|
||||
call ctrlp#exit()
|
||||
retu
|
||||
en
|
||||
if type(a:type) == 0
|
||||
let type = a:type
|
||||
el
|
||||
let type = index(g:ctrlp_types, a:type)
|
||||
if type == -1
|
||||
call ctrlp#exit()
|
||||
retu
|
||||
en
|
||||
en
|
||||
cal ctrlp#setlines(s:settype(type))
|
||||
cal ctrlp#syntax()
|
||||
cal s:SetDefTxt()
|
||||
let curName = s:CurTypeName()
|
||||
let shouldExitSingle = index(s:opensingle, curName[0])>=0 || index(s:opensingle, curName[1])>=0
|
||||
if shouldExitSingle && s:ExitIfSingleCandidate()
|
||||
return 0
|
||||
endif
|
||||
en
|
||||
cal s:BuildPrompt(1)
|
||||
if s:keyloop | cal s:KeyLoop() | en
|
||||
return 1
|
||||
|
@ -2556,7 +2607,7 @@ if has('autocmd')
|
|||
aug CtrlPAug
|
||||
au!
|
||||
au BufEnter ControlP cal s:checkbuf()
|
||||
au BufLeave ControlP noa cal s:Close(0)
|
||||
au BufLeave ControlP noa cal s:Close()
|
||||
au VimLeavePre * cal s:leavepre()
|
||||
aug END
|
||||
en
|
||||
|
|
|
@ -885,7 +885,8 @@ MRU mode options:~
|
|||
在匹配窗口和提示符面板之间切换焦点。
|
||||
|
||||
<esc>,
|
||||
<c-c>
|
||||
<c-c>,
|
||||
<c-g>
|
||||
退出CtrlP。
|
||||
|
||||
移动:~
|
||||
|
|
|
@ -68,6 +68,7 @@ Overview:~
|
|||
|ctrlp_open_single_match|.....Automatically accept when only one candidate.
|
||||
|ctrlp_brief_prompt|..........Exit CtrlP on empty prompt by <bs>.
|
||||
|ctrlp_match_current_file|....Include current file in match entries.
|
||||
|ctrlp_types|.................Names of builtin types.
|
||||
|
||||
MRU mode:
|
||||
|ctrlp_mruf_max|..............Max MRU entries to remember.
|
||||
|
@ -254,8 +255,9 @@ plugins look for .git/, .hg/,... some other plugins look for external *.exe
|
|||
tools on Windows). So be a little mindful of what you put in your |wildignore|.
|
||||
|
||||
*'g:ctrlp_custom_ignore'*
|
||||
In addition to |'wildignore'|, use this for files and directories you want only
|
||||
CtrlP to not show. Use regexp to specify the patterns: >
|
||||
In addition to |'wildignore'| and |g:ctrlp_show_hidden|, use this for files
|
||||
and directories you want only CtrlP to not show. Use regexp to specify the
|
||||
patterns: >
|
||||
let g:ctrlp_custom_ignore = ''
|
||||
<
|
||||
Examples: >
|
||||
|
@ -454,13 +456,19 @@ This option works well together with |g:ctrlp_open_single_match|
|
|||
|
||||
|
||||
*'g:ctrlp_match_current_file'*
|
||||
Includes the current file in the match entries:
|
||||
Includes the current file in the match entries: >
|
||||
let g:ctrlp_match_current_file = 1
|
||||
|
||||
By default, the current file is excluded from the list.
|
||||
|
||||
Note: does not apply when |g:ctrlp_match_func| is used.
|
||||
|
||||
*'g:ctrlp_types'*
|
||||
Set this to list of names to customize core types: >
|
||||
let g:ctrlp_types = ['mru', 'fil']
|
||||
|
||||
By default, the types are: >
|
||||
let g:ctrlp_types = ['fil', 'buf', 'mru'].
|
||||
|
||||
*'g:ctrlp_abbrev'*
|
||||
Define input abbreviations that can be expanded (either internally or visibly)
|
||||
|
@ -853,7 +861,8 @@ COMMANDS *ctrlp-commands*
|
|||
Open CtrlP in find file mode.
|
||||
|
||||
If no argument is given, the value of |g:ctrlp_working_path_mode| will be
|
||||
used to determine the starting directory.
|
||||
used to determine the starting directory. See |:CtrlPCurFile| and
|
||||
|:CtrlPCurWD| to temporarily override the setting.
|
||||
|
||||
You can use <tab> to auto-complete the [starting-directory] when typing it.
|
||||
|
||||
|
@ -861,6 +870,16 @@ COMMANDS *ctrlp-commands*
|
|||
:CtrlPBuffer
|
||||
Open CtrlP in find buffer mode.
|
||||
|
||||
*:CtrlPCurFile*
|
||||
:CtrlPCurFile
|
||||
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
|
||||
the variable's current value.
|
||||
|
||||
*:CtrlPCurWD*
|
||||
:CtrlPCurWD
|
||||
This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores
|
||||
the variable's current value.
|
||||
|
||||
*:CtrlPMRU*
|
||||
:CtrlPMRU
|
||||
Open CtrlP in find Most-Recently-Used file mode.
|
||||
|
@ -924,7 +943,8 @@ Once inside the prompt:~
|
|||
Toggle the focus between the match window and the prompt.
|
||||
|
||||
<esc>,
|
||||
<c-c>
|
||||
<c-c>,
|
||||
<c-g>
|
||||
Exit CtrlP.
|
||||
|
||||
Moving:~
|
||||
|
@ -1322,7 +1342,8 @@ Available extensions:~
|
|||
Buffer Tag mode options:~
|
||||
|
||||
*'g:ctrlp_buftag_ctags_bin'*
|
||||
If ctags isn't in your $PATH, use this to set its location: >
|
||||
If ctags isn't in your $PATH, or a ctags binary exists in either
|
||||
/opt/local/bin or /usr/local/bin, us this to set its location: >
|
||||
let g:ctrlp_buftag_ctags_bin = ''
|
||||
<
|
||||
|
||||
|
@ -1476,6 +1497,28 @@ Special thanks:~
|
|||
===============================================================================
|
||||
CHANGELOG *ctrlp-changelog*
|
||||
|
||||
Before 2016/11/28~
|
||||
|
||||
+ New command: |YankLine()| to yank current line.
|
||||
+ New option: |g:ctrlp_types| to select builtin modes.
|
||||
+ New feature: asynchronized spawn of |g:ctrlp_user_command|. This enable
|
||||
with set |g:user_command_async| to 1.
|
||||
+ Support buffertag for delphi, rust and golang.
|
||||
+ New option: |g:ctrlp_brief_prompt|,
|
||||
|g:match_current_file|,
|
||||
|g:ctrlp_compare_lim|.
|
||||
+ New feature: Auto-ignore extension.
|
||||
+ Support buffertag for ant, tex, dosbatch, matlab and vhdl.
|
||||
+ New option |g:ctrlp_line_prefix| for integrating third party plugins.
|
||||
+ New option |g:open_single_match| to open single file in matches.
|
||||
+ Add <plug>(ctrlp) for launch CtrlP.
|
||||
+ Accept bang for CtrlPBookmarkDirAdd to avoid confirm.
|
||||
+ Handle variable like "g:ctrlp_TYPE_MODE".
|
||||
ex: let g:ctrlp_path_sort
|
||||
+ New option: |g:ctrlp_custom_ancestors|
|
||||
|
||||
Before 2014/08/08~
|
||||
|
||||
+ New buffer explorer mode with highlighting (|+conceal| recommended)
|
||||
+ New options: |g:ctrlp_bufname_mod|,
|
||||
|g:ctrlp_bufpath_mod|
|
||||
|
|
|
@ -18,9 +18,9 @@ if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
|
|||
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
|
||||
|
||||
com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': <q-args> })
|
||||
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init(2, { 'dir': <q-args> })
|
||||
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init('mru', { 'dir': <q-args> })
|
||||
|
||||
com! -bar CtrlPBuffer cal ctrlp#init(1)
|
||||
com! -bar CtrlPBuffer cal ctrlp#init('buf')
|
||||
com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': <q-args> })
|
||||
|
||||
com! -bar CtrlPClearCache cal ctrlp#clr()
|
||||
|
@ -29,9 +29,9 @@ com! -bar CtrlPClearAllCaches cal ctrlp#clra()
|
|||
com! -bar ClearCtrlPCache cal ctrlp#clr()
|
||||
com! -bar ClearAllCtrlPCaches cal ctrlp#clra()
|
||||
|
||||
com! -bar CtrlPCurWD cal ctrlp#init(0, { 'mode': '' })
|
||||
com! -bar CtrlPCurFile cal ctrlp#init(0, { 'mode': 'c' })
|
||||
com! -bar CtrlPRoot cal ctrlp#init(0, { 'mode': 'r' })
|
||||
com! -bar CtrlPCurWD cal ctrlp#init('fil', { 'mode': '' })
|
||||
com! -bar CtrlPCurFile cal ctrlp#init('fil', { 'mode': 'c' })
|
||||
com! -bar CtrlPRoot cal ctrlp#init('fil', { 'mode': 'r' })
|
||||
|
||||
exe 'nn <silent> <plug>(ctrlp) :<c-u>'.g:ctrlp_cmd.'<cr>'
|
||||
|
||||
|
@ -55,10 +55,10 @@ com! -bar CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
|
|||
com! -bar CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
|
||||
|
||||
com! -n=? -com=buffer CtrlPLine
|
||||
\ cal ctrlp#init(ctrlp#line#cmd(1, <q-args>))
|
||||
\ cal ctrlp#init(ctrlp#line#cmd('buf', <q-args>))
|
||||
|
||||
com! -n=? -com=buffer CtrlPChange
|
||||
\ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
|
||||
\ cal ctrlp#init(ctrlp#changes#cmd('fil', <q-args>))
|
||||
|
||||
com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
|
||||
com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
|
||||
|
|
|
@ -64,6 +64,10 @@ Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 fi
|
|||
|
||||
If more than one mode is specified, they will be tried in order until a directory is located.
|
||||
|
||||
* If a file is already open, open it again in a new pane instead of switching to the existing pane
|
||||
|
||||
`let g:ctrlp_switch_buffer = 'et'`
|
||||
|
||||
* Exclude files and directories using Vim's `wildignore` and CtrlP's own `g:ctrlp_custom_ignore`. If a custom listing command is being used, exclusions are ignored:
|
||||
|
||||
```vim
|
||||
|
|
|
@ -272,7 +272,7 @@ set noshowmode
|
|||
```
|
||||
|
||||
|
||||
Now, let us get back to the tutorial (with the patched font for vim-powerline).
|
||||
Now, let's get back to the tutorial (with the patched font for vim-powerline).
|
||||
You look into a help file to find the marks annoying.
|
||||
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/6.png)
|
||||
|
@ -293,8 +293,8 @@ let g:lightline = {
|
|||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/7.png)
|
||||
|
||||
Huh? Weird!
|
||||
The components do not collapse even if they have no information!
|
||||
In order to avoid this situation, you set expressions to `g:lightline.component_visible_condition`, which should become 1 only when the corresponding components have information.
|
||||
The subseparators are visible even if the components are empty.
|
||||
In order to hide the subseparators, you can set expressions to `g:lightline.component_visible_condition`, which should be 1 only when the corresponding component is not empty.
|
||||
```vim
|
||||
let g:lightline = {
|
||||
\ 'colorscheme': 'wombat',
|
||||
|
@ -313,8 +313,8 @@ let g:lightline = {
|
|||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/8.png)
|
||||
|
||||
Okay. It works nice.
|
||||
|
||||
|
||||
The configuration `component_visible_condition` is used to control the visibility of the subseparators.
|
||||
You cannot use this variable to control the visibility of the components themselves.
|
||||
|
||||
How does lightline decide the components to show in the statusline?
|
||||
It's very simple.
|
||||
|
@ -340,16 +340,9 @@ let g:lightline = {
|
|||
\ }
|
||||
```
|
||||
If the plugin arranges all the components (in a situation you `set paste` and the file `.vimrc` is read-only, try to modify):
|
||||
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png)
|
||||
|
||||
The mode component, the paste component, read-only component, filename component and modified component in a row.
|
||||
Normally, the paste component does not show up.
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/10.png)
|
||||
|
||||
If the file is not read-only (more common cases), the read-only component does not show up.
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/11.png)
|
||||
|
||||
|
||||
Again look into `g:lightline.active.left`.
|
||||
```vim
|
||||
let g:lightline = {
|
||||
|
@ -357,8 +350,6 @@ let g:lightline = {
|
|||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'readonly', 'filename', 'modified' ] ] ...
|
||||
```
|
||||
And the screen shot of all the components.
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png)
|
||||
|
||||
The mode and paste component are displayed in the same group.
|
||||
The read-only, filename and modified component are in the second group.
|
||||
|
@ -369,11 +360,11 @@ You can configure the components in the statusline by the following four variabl
|
|||
+ `g:lightline.inactive.left`
|
||||
+ `g:lightline.inactive.right`
|
||||
|
||||
Of course, your settings in `.vimrc` have priority over the default settings in lightline.
|
||||
Of course, your configurations in `.vimrc` have priority over the default settings in lightline.
|
||||
|
||||
|
||||
|
||||
GitHub branch is important for us.
|
||||
Git branch is important for us.
|
||||
And it is a default component in [powerline](https://github.com/Lokaltog/powerline) and [vim-powerline](https://github.com/Lokaltog/vim-powerline).
|
||||
However, lightline does not provide the branch feature by default.
|
||||
|
||||
|
@ -424,15 +415,15 @@ let g:lightline = {
|
|||
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'readonly': 'LightLineReadonly',
|
||||
\ 'modified': 'LightLineModified'
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'modified': 'LightlineModified'
|
||||
\ },
|
||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
if &filetype == "help"
|
||||
return ""
|
||||
elseif &modified
|
||||
|
@ -444,7 +435,7 @@ function! LightLineModified()
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
if &filetype == "help"
|
||||
return ""
|
||||
elseif &readonly
|
||||
|
@ -454,7 +445,7 @@ function! LightLineReadonly()
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
return exists('*fugitive#head') ? fugitive#head() : ''
|
||||
endfunction
|
||||
```
|
||||
|
@ -473,16 +464,16 @@ let g:lightline = {
|
|||
\ [ 'fugitive', 'filename' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'readonly': 'LightLineReadonly',
|
||||
\ 'modified': 'LightLineModified',
|
||||
\ 'filename': 'LightLineFilename'
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'modified': 'LightlineModified',
|
||||
\ 'filename': 'LightlineFilename'
|
||||
\ },
|
||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
if &filetype == "help"
|
||||
return ""
|
||||
elseif &modified
|
||||
|
@ -494,7 +485,7 @@ function! LightLineModified()
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
if &filetype == "help"
|
||||
return ""
|
||||
elseif &readonly
|
||||
|
@ -504,21 +495,21 @@ function! LightLineReadonly()
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
return exists('*fugitive#head') ? fugitive#head() : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
function! LightlineFilename()
|
||||
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ ('' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
```
|
||||
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/14.png)
|
||||
|
||||
Oops! We forgot the cool mark for the branch component! (work with the patched font for vim-powerline)
|
||||
```vim
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if exists("*fugitive#head")
|
||||
let branch = fugitive#head()
|
||||
return branch !=# '' ? '⭠ '.branch : ''
|
||||
|
@ -537,7 +528,7 @@ let g:lightline = {
|
|||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'my_component' ] ] },
|
||||
\ 'component_function': {
|
||||
\ 'my_component': 'LightLineComponent', ...
|
||||
\ 'my_component': 'LightlineComponent', ...
|
||||
```
|
||||
|
||||
This is the end of the tutorial. For more information, see `:help lightline`. Good luck with your nice statuslines.
|
||||
|
@ -552,7 +543,7 @@ subseparator.left | '\|' | '' (\ue0b1) | '⮁' (\u2b81)
|
|||
subseparator.right | '\|' | '' (\ue0b3) | '⮃' (\u2b83)
|
||||
branch symbol | -- | '' (\ue0a0) | '⭠' (\u2b60)
|
||||
readonly symbol | -- | '' (\ue0a2) | '⭤' (\u2b64)
|
||||
linecolumn symbol | -- | '' (\ue0a1) | '⭡' (\u2b81)
|
||||
linecolumn symbol | -- | '' (\ue0a1) | '⭡' (\u2b61)
|
||||
|
||||
### My settings
|
||||
I show my settings. I use the patched font for vim-powerline.
|
||||
|
@ -564,37 +555,37 @@ let g:lightline = {
|
|||
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'modified': 'LightLineModified',
|
||||
\ 'readonly': 'LightLineReadonly',
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'filename': 'LightLineFilename',
|
||||
\ 'fileformat': 'LightLineFileformat',
|
||||
\ 'filetype': 'LightLineFiletype',
|
||||
\ 'fileencoding': 'LightLineFileencoding',
|
||||
\ 'mode': 'LightLineMode',
|
||||
\ 'modified': 'LightlineModified',
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'filename': 'LightlineFilename',
|
||||
\ 'fileformat': 'LightlineFileformat',
|
||||
\ 'filetype': 'LightlineFiletype',
|
||||
\ 'fileencoding': 'LightlineFileencoding',
|
||||
\ 'mode': 'LightlineMode',
|
||||
\ },
|
||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? '⭤' : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
function! LightlineFilename()
|
||||
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ &ft == 'vimshell' ? vimshell#get_status_string() :
|
||||
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
|
||||
let branch = fugitive#head()
|
||||
return branch !=# '' ? '⭠ '.branch : ''
|
||||
|
@ -602,19 +593,19 @@ function! LightLineFugitive()
|
|||
return ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileformat()
|
||||
function! LightlineFileformat()
|
||||
return winwidth(0) > 70 ? &fileformat : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
function! LightlineFiletype()
|
||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
function! LightlineFileencoding()
|
||||
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
function! LightlineMode()
|
||||
return winwidth(0) > 60 ? lightline#mode() : ''
|
||||
endfunction
|
||||
```
|
||||
|
@ -649,12 +640,12 @@ let g:lightline = {
|
|||
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'filename': 'LightLineFilename',
|
||||
\ 'fileformat': 'LightLineFileformat',
|
||||
\ 'filetype': 'LightLineFiletype',
|
||||
\ 'fileencoding': 'LightLineFileencoding',
|
||||
\ 'mode': 'LightLineMode',
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'filename': 'LightlineFilename',
|
||||
\ 'fileformat': 'LightlineFileformat',
|
||||
\ 'filetype': 'LightlineFiletype',
|
||||
\ 'fileencoding': 'LightlineFileencoding',
|
||||
\ 'mode': 'LightlineMode',
|
||||
\ 'ctrlpmark': 'CtrlPMark',
|
||||
\ },
|
||||
\ 'component_expand': {
|
||||
|
@ -666,15 +657,15 @@ let g:lightline = {
|
|||
\ 'subseparator': { 'left': '|', 'right': '|' }
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
function! LightlineFilename()
|
||||
let fname = expand('%:t')
|
||||
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
|
||||
\ fname == '__Tagbar__' ? g:lightline.fname :
|
||||
|
@ -682,12 +673,12 @@ function! LightLineFilename()
|
|||
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ &ft == 'vimshell' ? vimshell#get_status_string() :
|
||||
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
\ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ ('' != fname ? fname : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
try
|
||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||
let mark = '' " edit here for cool mark
|
||||
|
@ -699,19 +690,19 @@ function! LightLineFugitive()
|
|||
return ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileformat()
|
||||
function! LightlineFileformat()
|
||||
return winwidth(0) > 70 ? &fileformat : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
function! LightlineFiletype()
|
||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
function! LightlineFileencoding()
|
||||
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
function! LightlineMode()
|
||||
let fname = expand('%:t')
|
||||
return fname == '__Tagbar__' ? 'Tagbar' :
|
||||
\ fname == 'ControlP' ? 'CtrlP' :
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
" Filename: autoload/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2016/06/12 22:40:00.
|
||||
" Last Change: 2016/12/03 12:08:08.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -111,6 +111,7 @@ let s:_lightline = {
|
|||
\ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
|
||||
\ },
|
||||
\ 'component_function': {},
|
||||
\ 'component_function_visible_condition': {},
|
||||
\ 'component_expand': {
|
||||
\ 'tabs': 'lightline#tabs'
|
||||
\ },
|
||||
|
@ -155,7 +156,7 @@ function! lightline#init() abort
|
|||
endfor
|
||||
call extend(s:lightline.tabline_separator, s:lightline.separator, 'keep')
|
||||
call extend(s:lightline.tabline_subseparator, s:lightline.subseparator, 'keep')
|
||||
let s:lightline.tabline_configured = 0
|
||||
let s:lightline.tabline_configured = has_key(get(get(g:, 'lightline', {}), 'component_expand', {}), 'tabs')
|
||||
for components in deepcopy(s:lightline.tabline.left + s:lightline.tabline.right)
|
||||
if len(filter(components, 'v:val !=# "tabs" && v:val !=# "close"')) > 0
|
||||
let s:lightline.tabline_configured = 1
|
||||
|
@ -190,10 +191,6 @@ function! lightline#colorscheme() abort
|
|||
let s:lightline.colorscheme = 'default'
|
||||
let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
|
||||
finally
|
||||
let s:highlight = {}
|
||||
call lightline#highlight('normal')
|
||||
call lightline#link()
|
||||
let s:_ = 0
|
||||
if has('win32') && !has('gui_running') && &t_Co < 256
|
||||
for u in values(s:lightline.palette)
|
||||
for v in values(u)
|
||||
|
@ -203,6 +200,10 @@ function! lightline#colorscheme() abort
|
|||
endfor
|
||||
endfor
|
||||
endif
|
||||
let s:highlight = {}
|
||||
call lightline#highlight('normal')
|
||||
call lightline#link()
|
||||
let s:_ = 0
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
@ -228,16 +229,16 @@ function! lightline#link(...) abort
|
|||
for [p, l] in [['Left', len(s:lightline.active.left)], ['Right', len(s:lightline.active.right)]]
|
||||
for [i, t] in map(range(0, l), '[v:val, 0]') + types
|
||||
if i != l
|
||||
exec printf('hi link LightLine%s_active_%s LightLine%s_%s_%s', p, i, p, mode, i)
|
||||
exec printf('hi link Lightline%s_active_%s Lightline%s_%s_%s', p, i, p, mode, i)
|
||||
endif
|
||||
for [j, s] in map(range(0, l), '[v:val, 0]') + types
|
||||
if i + 1 == j || t || s && i != l
|
||||
exec printf('hi link LightLine%s_active_%s_%s LightLine%s_%s_%s_%s', p, i, j, p, mode, i, j)
|
||||
exec printf('hi link Lightline%s_active_%s_%s Lightline%s_%s_%s_%s', p, i, j, p, mode, i, j)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endfor
|
||||
exec printf('hi link LightLineMiddle_active LightLineMiddle_%s', mode)
|
||||
exec printf('hi link LightlineMiddle_active LightlineMiddle_%s', mode)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
@ -278,26 +279,26 @@ function! lightline#highlight(...) abort
|
|||
for [i, t] in map(range(0, l), '[v:val, 0]') + types
|
||||
if i < l || i < 1
|
||||
let r = t ? (has_key(get(c, d, []), i) ? c[d][i][0] : has_key(get(c, 'tabline', {}), i) ? c.tabline[i][0] : get(c.normal, i, zs)[0]) : get(zs, i, ms)
|
||||
exec printf('hi LightLine%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', p, mode, i, r[0], r[1], r[2], r[3], s:term(r))
|
||||
exec printf('hi Lightline%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', p, mode, i, r[0], r[1], r[2], r[3], s:term(r))
|
||||
endif
|
||||
for [j, s] in map(range(0, l), '[v:val, 0]') + types
|
||||
if i + 1 == j || t || s && i != l
|
||||
let q = s ? (has_key(get(c, d, []), j) ? c[d][j][0] : has_key(get(c, 'tabline', {}), j) ? c.tabline[j][0] : get(c.normal, j, zs)[0]) : (j != l ? get(zs, j, ms) :ms)
|
||||
exec printf('hi LightLine%s_%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s', p, mode, i, j, r[1], q[1], r[3], q[3])
|
||||
exec printf('hi Lightline%s_%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s', p, mode, i, j, r[1], q[1], r[3], q[3])
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endfor
|
||||
exec printf('hi LightLineMiddle_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', mode, ms[0], ms[1], ms[2], ms[3], s:term(ms))
|
||||
exec printf('hi LightlineMiddle_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', mode, ms[0], ms[1], ms[2], ms[3], s:term(ms))
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:subseparator(components, subseparator, expanded) abort
|
||||
let [a, c, f, v] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition ]
|
||||
let [a, c, f, v, u ] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition, s:lightline.component_function_visible_condition ]
|
||||
let xs = map(range(len(a:components)), 'a:expanded[v:val] ? "1" :
|
||||
\ has_key(f, a[v:val]) ? (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"" :
|
||||
\ has_key(v, a[v:val]) ? "(" . v[a[v:val]] . ")" : has_key(c, a[v:val]) ? "1" : "0"')
|
||||
return '%{' . (xs[0] ==# '1' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' ? '' : ')') . '?"' . a:subseparator . '":""}'
|
||||
\ has_key(f, a[v:val]) ? (has_key(u, a[v:val]) ? "(".u[a[v:val]].")" : (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"") :
|
||||
\ has_key(v, a[v:val]) ? "(".v[a[v:val]].")" : has_key(c, a[v:val]) ? "1" : "0"')
|
||||
return '%{' . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : ')') . '?"' . a:subseparator . '":""}'
|
||||
endfunction
|
||||
|
||||
function! lightline#concatenate(xs, right) abort
|
||||
|
@ -324,7 +325,7 @@ endfunction
|
|||
|
||||
function! s:evaluate_expand(component) abort
|
||||
try
|
||||
let result = call(a:component, [])
|
||||
let result = eval(a:component . '()')
|
||||
if type(result) == 1 && result ==# ''
|
||||
return []
|
||||
endif
|
||||
|
@ -399,7 +400,7 @@ function! s:line(tabline, inactive) abort
|
|||
let r_ = has_key(s:lightline, mode) ? s:lightline[mode].right : s:lightline.active.right
|
||||
let [rt, rc, rl] = s:expand(copy(r_))
|
||||
for i in range(len(lt))
|
||||
let _ .= '%#LightLineLeft_' . mode . '_' . ll[i] . '#'
|
||||
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '#'
|
||||
for j in range(len(lt[i]))
|
||||
let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
|
||||
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
|
||||
|
@ -407,14 +408,14 @@ function! s:line(tabline, inactive) abort
|
|||
let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
|
||||
endif
|
||||
endfor
|
||||
let _ .= '%#LightLineLeft_' . mode . '_' . ll[i] . '_' . ll[i + 1] . '#'
|
||||
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '_' . ll[i + 1] . '#'
|
||||
let _ .= i < l + len(lt) - len(l_) && ll[i] < l || ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : ''
|
||||
endfor
|
||||
let _ .= '%#LightLineMiddle_' . mode . '#%='
|
||||
let _ .= '%#LightlineMiddle_' . mode . '#%='
|
||||
for i in reverse(range(len(rt)))
|
||||
let _ .= '%#LightLineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
|
||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
|
||||
let _ .= i < r + len(rt) - len(r_) && rl[i] < r || rl[i] != rl[i + 1] ? p.right : len(rt[i]) ? s.right : ''
|
||||
let _ .= '%#LightLineRight_' . mode . '_' . rl[i] . '#'
|
||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
||||
for j in range(len(rt[i]))
|
||||
let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
|
||||
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/Dracula.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2016/11/06 01:08:03.
|
||||
" =============================================================================
|
||||
|
||||
let s:black = [ '#282a36', 235 ]
|
||||
let s:gray = [ '#44475a', 236 ]
|
||||
let s:white = [ '#f8f8f2', 231 ]
|
||||
let s:darkblue = [ '#6272a4', 61 ]
|
||||
let s:cyan = [ '#8be9fd', 117 ]
|
||||
let s:green = [ '#50fa7b', 84 ]
|
||||
let s:orange = [ '#ffb86c', 215 ]
|
||||
let s:purple = [ '#bd93f9', 141 ]
|
||||
let s:red = [ '#ff79c6', 212 ]
|
||||
let s:yellow = [ '#f1fa8c', 228 ]
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
let s:p.normal.left = [ [ s:black, s:purple ], [ s:cyan, s:gray ] ]
|
||||
let s:p.normal.right = [ [ s:black, s:purple ], [ s:white, s:darkblue ] ]
|
||||
let s:p.inactive.right = [ [ s:black, s:gray ], [ s:white, s:black ] ]
|
||||
let s:p.inactive.left = [ [ s:cyan, s:black ], [ s:white, s:black ] ]
|
||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:cyan, s:gray ] ]
|
||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:cyan, s:gray ] ]
|
||||
let s:p.visual.left = [ [ s:black, s:orange ], [ s:cyan, s:gray ] ]
|
||||
let s:p.normal.middle = [ [ s:white, s:gray ] ]
|
||||
let s:p.inactive.middle = [ [ s:white, s:gray ] ]
|
||||
let s:p.tabline.left = [ [ s:darkblue, s:gray ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:cyan, s:black ] ]
|
||||
let s:p.tabline.middle = [ [ s:darkblue, s:gray ] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
let s:p.normal.error = [ [ s:red, s:black ] ]
|
||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
||||
|
||||
let g:lightline#colorscheme#Dracula#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -0,0 +1,36 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/molokai.vim
|
||||
" Author: challsted
|
||||
" License: MIT License
|
||||
" Last Change: 2016/11/17 00:27:58.
|
||||
" =============================================================================
|
||||
"
|
||||
let s:black = [ '#232526', 233 ]
|
||||
let s:gray = [ '#808080', 244 ]
|
||||
let s:white = [ '#f8f8f2', 234 ]
|
||||
let s:cyan = [ '#66d9ef', 81 ]
|
||||
let s:green = [ '#a6e22e', 118 ]
|
||||
let s:orange = [ '#ef5939', 166 ]
|
||||
let s:pink = [ '#f92672', 161 ]
|
||||
let s:red = [ '#ff0000', 160 ]
|
||||
let s:yellow = [ '#e6db74', 229 ]
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
|
||||
let s:p.normal.left = [ [ s:black, s:cyan ], [ s:orange, s:black ] ]
|
||||
let s:p.normal.middle = [ [ s:orange, s:black ] ]
|
||||
let s:p.normal.right = [ [ s:pink, s:black ], [ s:black, s:pink ] ]
|
||||
let s:p.normal.error = [ [ s:pink, s:black ] ]
|
||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:green, s:black ] ]
|
||||
let s:p.visual.left = [ [ s:black, s:yellow ], [ s:yellow, s:black ] ]
|
||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:red, s:black ] ]
|
||||
let s:p.inactive.left = [ [ s:pink, s:black ], [ s:white, s:black ] ]
|
||||
let s:p.inactive.middle = [ [ s:gray, s:black ] ]
|
||||
let s:p.inactive.right = [ [ s:white, s:pink ], [ s:pink, s:black ] ]
|
||||
let s:p.tabline.left = [ [ s:pink, s:black ] ]
|
||||
let s:p.tabline.middle = [ [ s:pink, s:black] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
let s:p.tabline.tabsel = [ [ s:black, s:pink ] ]
|
||||
|
||||
let g:lightline#colorscheme#molokai#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -0,0 +1,63 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/one.vim
|
||||
" Author: Zoltan Dalmadi
|
||||
" License: MIT License
|
||||
" Last Change: 2016/11/2 17:34:27.
|
||||
" =============================================================================
|
||||
|
||||
" Common colors
|
||||
let s:fg = '#abb2bf'
|
||||
let s:blue = '#61afef'
|
||||
let s:green = '#98c379'
|
||||
let s:purple = '#c678dd'
|
||||
let s:red1 = '#e06c75'
|
||||
let s:red2 = '#be5046'
|
||||
let s:yellow = '#e5c07b'
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
|
||||
if &background ==# 'light'
|
||||
" Light variant
|
||||
let s:bg = '#fafafa'
|
||||
let s:gray1 = '#494b53'
|
||||
let s:gray2 = '#f0f0f0'
|
||||
let s:gray3 = '#d0d0d0'
|
||||
|
||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:gray1, s:gray3 ] ]
|
||||
let s:p.normal.middle = [ [ s:gray1, s:gray2 ] ]
|
||||
let s:p.inactive.left = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
||||
let s:p.inactive.middle = [ [ s:gray3, s:gray2 ] ]
|
||||
let s:p.inactive.right = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:gray1, s:gray3 ] ]
|
||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:gray1, s:gray3 ] ]
|
||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:gray1, s:gray3 ] ]
|
||||
else
|
||||
" Dark variant
|
||||
let s:bg = '#282c34'
|
||||
let s:gray1 = '#5c6370'
|
||||
let s:gray2 = '#2c323d'
|
||||
let s:gray3 = '#3e4452'
|
||||
|
||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:fg, s:gray3 ] ]
|
||||
let s:p.normal.middle = [ [ s:fg, s:gray2 ] ]
|
||||
let s:p.inactive.left = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
||||
let s:p.inactive.middle = [ [ s:gray1, s:gray2 ] ]
|
||||
let s:p.inactive.right = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:fg, s:gray3 ] ]
|
||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:fg, s:gray3 ] ]
|
||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:fg, s:gray3 ] ]
|
||||
endif
|
||||
|
||||
" Common
|
||||
let s:p.normal.right = [ [ s:bg, s:green, 'bold' ], [ s:bg, s:green, 'bold' ] ]
|
||||
let s:p.normal.error = [ [ s:red2, s:bg ] ]
|
||||
let s:p.normal.warning = [ [ s:yellow, s:bg ] ]
|
||||
let s:p.insert.right = [ [ s:bg, s:blue, 'bold' ], [ s:bg, s:blue, 'bold' ] ]
|
||||
let s:p.replace.right = [ [ s:bg, s:red1, 'bold' ], [ s:bg, s:red1, 'bold' ] ]
|
||||
let s:p.visual.right = [ [ s:bg, s:purple, 'bold' ], [ s:bg, s:purple, 'bold' ] ]
|
||||
let s:p.tabline.left = [ [ s:bg, s:gray3 ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:bg, s:purple, 'bold' ] ]
|
||||
let s:p.tabline.middle = [ [ s:gray3, s:gray2 ] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
|
||||
let g:lightline#colorscheme#one#palette = lightline#colorscheme#fill(s:p)
|
|
@ -2,10 +2,79 @@
|
|||
" Filename: autoload/lightline/colorscheme/solarized.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/27 10:24:28.
|
||||
" Last Change: 2016/08/08 10:31:00.
|
||||
" =============================================================================
|
||||
if &background ==# 'light'
|
||||
let g:lightline#colorscheme#solarized#palette = g:lightline#colorscheme#solarized_light#palette
|
||||
|
||||
let s:cuicolors = {
|
||||
\ 'base03': [ '8', '234', 'DarkGray' ],
|
||||
\ 'base02': [ '0', '235', 'Black' ],
|
||||
\ 'base01': [ '10', '239', 'LightGreen' ],
|
||||
\ 'base00': [ '11', '240', 'LightYellow' ],
|
||||
\ 'base0': [ '12', '244', 'LightBlue' ],
|
||||
\ 'base1': [ '14', '245', 'LightCyan' ],
|
||||
\ 'base2': [ '7', '187', 'LightGray' ],
|
||||
\ 'base3': [ '15', '230', 'White' ],
|
||||
\ 'yellow': [ '3', '136', 'DarkYellow' ],
|
||||
\ 'orange': [ '9', '166', 'LightRed' ],
|
||||
\ 'red': [ '1', '124', 'DarkRed' ],
|
||||
\ 'magenta': [ '5', '125', 'DarkMagenta' ],
|
||||
\ 'violet': [ '13', '61', 'LightMagenta' ],
|
||||
\ 'blue': [ '4', '33', 'DarkBlue' ],
|
||||
\ 'cyan': [ '6', '37', 'DarkCyan' ],
|
||||
\ 'green': [ '2', '64', 'DarkGreen' ],
|
||||
\ }
|
||||
|
||||
" The following condition only applies for the console and is the same
|
||||
" condition vim-colors-solarized uses to determine which set of colors
|
||||
" to use.
|
||||
let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
|
||||
if s:solarized_termcolors != 256 && &t_Co >= 16
|
||||
let s:cuiindex = 0
|
||||
elseif s:solarized_termcolors == 256
|
||||
let s:cuiindex = 1
|
||||
else
|
||||
let g:lightline#colorscheme#solarized#palette = g:lightline#colorscheme#solarized_dark#palette
|
||||
let s:cuiindex = 2
|
||||
endif
|
||||
|
||||
let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
|
||||
let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
|
||||
let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
|
||||
let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
|
||||
let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
|
||||
let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
|
||||
let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
|
||||
let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
|
||||
let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
|
||||
let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
|
||||
let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
|
||||
let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
|
||||
let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
|
||||
let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
|
||||
let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
|
||||
let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
|
||||
|
||||
if &background ==# 'light'
|
||||
let [ s:base03, s:base3 ] = [ s:base3, s:base03 ]
|
||||
let [ s:base02, s:base2 ] = [ s:base2, s:base02 ]
|
||||
let [ s:base01, s:base1 ] = [ s:base1, s:base01 ]
|
||||
let [ s:base00, s:base0 ] = [ s:base0, s:base00 ]
|
||||
endif
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
let s:p.normal.left = [ [ s:base03, s:blue ], [ s:base03, s:base00 ] ]
|
||||
let s:p.normal.right = [ [ s:base03, s:base1 ], [ s:base03, s:base00 ] ]
|
||||
let s:p.inactive.right = [ [ s:base03, s:base00 ], [ s:base0, s:base02 ] ]
|
||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base0, s:base02 ] ]
|
||||
let s:p.insert.left = [ [ s:base03, s:green ], [ s:base03, s:base00 ] ]
|
||||
let s:p.replace.left = [ [ s:base03, s:red ], [ s:base03, s:base00 ] ]
|
||||
let s:p.visual.left = [ [ s:base03, s:magenta ], [ s:base03, s:base00 ] ]
|
||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
||||
let s:p.inactive.middle = [ [ s:base01, s:base02 ] ]
|
||||
let s:p.tabline.left = [ [ s:base03, s:base00 ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:base03, s:base1 ] ]
|
||||
let s:p.tabline.middle = [ [ s:base0, s:base02 ] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
let s:p.normal.error = [ [ s:base03, s:red ] ]
|
||||
let s:p.normal.warning = [ [ s:base03, s:yellow ] ]
|
||||
|
||||
let g:lightline#colorscheme#solarized#palette = lightline#colorscheme#flatten(s:p)
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/solarized_dark.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2014/05/31 01:04:15.
|
||||
" =============================================================================
|
||||
|
||||
let s:cuicolors = {
|
||||
\ 'base03': [ '8', '234', 'DarkGray' ],
|
||||
\ 'base02': [ '0', '235', 'Black' ],
|
||||
\ 'base01': [ '10', '239', 'LightGreen' ],
|
||||
\ 'base00': [ '11', '240', 'LightYellow' ],
|
||||
\ 'base0': [ '12', '244', 'LightBlue' ],
|
||||
\ 'base1': [ '14', '245', 'LightCyan' ],
|
||||
\ 'base2': [ '7', '187', 'LightGray' ],
|
||||
\ 'base3': [ '15', '230', 'White' ],
|
||||
\ 'yellow': [ '3', '136', 'DarkYellow' ],
|
||||
\ 'orange': [ '9', '166', 'LightRed' ],
|
||||
\ 'red': [ '1', '124', 'DarkRed' ],
|
||||
\ 'magenta': [ '5', '125', 'DarkMagenta' ],
|
||||
\ 'violet': [ '13', '61', 'LightMagenta' ],
|
||||
\ 'blue': [ '4', '33', 'DarkBlue' ],
|
||||
\ 'cyan': [ '6', '37', 'DarkCyan' ],
|
||||
\ 'green': [ '2', '64', 'DarkGreen' ],
|
||||
\ }
|
||||
|
||||
" The following condition only applies for the console and is the same
|
||||
" condition vim-colors-solarized uses to determine which set of colors
|
||||
" to use.
|
||||
let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
|
||||
if s:solarized_termcolors != 256 && &t_Co >= 16
|
||||
let s:cuiindex = 0
|
||||
elseif s:solarized_termcolors == 256
|
||||
let s:cuiindex = 1
|
||||
else
|
||||
let s:cuiindex = 2
|
||||
endif
|
||||
|
||||
let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
|
||||
let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
|
||||
let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
|
||||
let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
|
||||
let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
|
||||
let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
|
||||
let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
|
||||
let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
|
||||
let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
|
||||
let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
|
||||
let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
|
||||
let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
|
||||
let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
|
||||
let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
|
||||
let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
|
||||
let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
||||
let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
|
||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
|
||||
let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
|
||||
let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
|
||||
let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
||||
let s:p.tabline.left = [ [ s:base1, s:base00 ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:base3, s:base0 ] ]
|
||||
let s:p.tabline.middle = [ [ s:base01, s:base02 ] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
let s:p.normal.error = [ [ s:base2, s:red ] ]
|
||||
let s:p.normal.warning = [ [ s:base02, s:yellow ] ]
|
||||
|
||||
let g:lightline#colorscheme#solarized_dark#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,80 +0,0 @@
|
|||
" =============================================================================
|
||||
" Filename: autoload/lightline/colorscheme/solarized_light.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2014/05/31 01:04:21.
|
||||
" =============================================================================
|
||||
|
||||
let s:cuicolors = {
|
||||
\ 'base03': [ '8', '234', 'DarkGray' ],
|
||||
\ 'base02': [ '0', '235', 'Black' ],
|
||||
\ 'base01': [ '10', '239', 'LightGreen' ],
|
||||
\ 'base00': [ '11', '240', 'LightYellow' ],
|
||||
\ 'base0': [ '12', '244', 'LightBlue' ],
|
||||
\ 'base1': [ '14', '245', 'LightCyan' ],
|
||||
\ 'base2': [ '7', '187', 'LightGray' ],
|
||||
\ 'base3': [ '15', '230', 'White' ],
|
||||
\ 'yellow': [ '3', '136', 'DarkYellow' ],
|
||||
\ 'orange': [ '9', '166', 'LightRed' ],
|
||||
\ 'red': [ '1', '124', 'DarkRed' ],
|
||||
\ 'magenta': [ '5', '125', 'DarkMagenta' ],
|
||||
\ 'violet': [ '13', '61', 'LightMagenta' ],
|
||||
\ 'blue': [ '4', '33', 'DarkBlue' ],
|
||||
\ 'cyan': [ '6', '37', 'DarkCyan' ],
|
||||
\ 'green': [ '2', '64', 'DarkGreen' ],
|
||||
\ }
|
||||
|
||||
" The following condition only applies for the console and is the same
|
||||
" condition vim-colors-solarized uses to determine which set of colors
|
||||
" to use.
|
||||
let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
|
||||
if s:solarized_termcolors != 256 && &t_Co >= 16
|
||||
let s:cuiindex = 0
|
||||
elseif s:solarized_termcolors == 256
|
||||
let s:cuiindex = 1
|
||||
else
|
||||
let s:cuiindex = 2
|
||||
endif
|
||||
|
||||
let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
|
||||
let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
|
||||
let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
|
||||
let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
|
||||
let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
|
||||
let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
|
||||
let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
|
||||
let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
|
||||
let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
|
||||
let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
|
||||
let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
|
||||
let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
|
||||
let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
|
||||
let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
|
||||
let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
|
||||
let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
|
||||
|
||||
let [s:base03, s:base3] = [s:base3, s:base03]
|
||||
let [s:base02, s:base2] = [s:base2, s:base02]
|
||||
let [s:base01, s:base1] = [s:base1, s:base01]
|
||||
let [s:base00, s:base0] = [s:base0, s:base00]
|
||||
|
||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
||||
let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
||||
let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
|
||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
|
||||
let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
|
||||
let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
|
||||
let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
|
||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
||||
let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
|
||||
let s:p.tabline.middle = [ [ s:base1, s:base02 ] ]
|
||||
let s:p.tabline.right = copy(s:p.normal.right)
|
||||
let s:p.normal.error = [ [ s:red, s:base01 ] ]
|
||||
let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
|
||||
let s:p.normal.error = [ [ s:base02, s:red ] ]
|
||||
let s:p.normal.warning = [ [ s:base2, s:yellow ] ]
|
||||
|
||||
let g:lightline#colorscheme#solarized_light#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,10 +1,10 @@
|
|||
*lightline.txt* A light and configurable statusline/tabline for Vim
|
||||
|
||||
Version: 0.0
|
||||
Version: 0.1
|
||||
Author: itchyny (https://github.com/itchyny)
|
||||
License: MIT License
|
||||
Repository: https://github.com/itchyny/lightline.vim
|
||||
Last Change: 2016/05/26 21:57:34.
|
||||
Last Change: 2016/10/24 08:12:28.
|
||||
|
||||
CONTENTS *lightline-contents*
|
||||
|
||||
|
@ -19,7 +19,6 @@ Examples |lightline-examples|
|
|||
Nice Examples |lightline-nice-examples|
|
||||
Powerful Example |lightline-powerful-example|
|
||||
Troubleshooting |lightline-troubleshooting|
|
||||
Changelog |lightline-changelog|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *lightline-introduction*
|
||||
|
@ -115,10 +114,13 @@ OPTIONS *lightline-option*
|
|||
\ 'column': '%c'
|
||||
\ 'close': '%999X X ' }
|
||||
<
|
||||
g:lightline.component_visible_condition *g:lightline.component_visible_condition*
|
||||
Dictionary of boolean expressions for the components.
|
||||
g:lightline.component_visible_condition
|
||||
*g:lightline.component_visible_condition*
|
||||
Dictionary to store the visible condition of the components.
|
||||
Each expression should correspond to the condition each
|
||||
component have non-zero length.
|
||||
component is not empty. This configuration is used to control
|
||||
the visibility of the subseparators. You cannot use this
|
||||
configuration to control the visibility of the components.
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.component_visible_condition = {
|
||||
|
@ -135,6 +137,11 @@ OPTIONS *lightline-option*
|
|||
because the user does not have to set both component and
|
||||
component_visible_condition. If a component set to both component and
|
||||
component_function, the setting of component_function has priority.
|
||||
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.component_function = {}
|
||||
<
|
||||
For example, if you want a component for read-only mark, which
|
||||
disappears in help windows:
|
||||
>
|
||||
|
@ -144,12 +151,25 @@ OPTIONS *lightline-option*
|
|||
\ [ 'myreadonly', 'filename', 'modified' ] ],
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'myreadonly': 'LightLineReadonly'
|
||||
\ 'myreadonly': 'LightlineReadonly'
|
||||
\ },
|
||||
\ }
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
<
|
||||
g:lightline.component_function_visible_condition
|
||||
*g:lightline.component_function_visible_condition*
|
||||
Dictionary to store the visible conditions of the function
|
||||
components. Each expression should correspond to the condition
|
||||
each component is not empty. This configuration is used to
|
||||
control the visibility of the subseparators. You can use this
|
||||
configuration to reduce the number of function calls for
|
||||
function components by setting the value 1 (to tell lightline
|
||||
that the component is always visible).
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.component_function_visible_condition = {}
|
||||
<
|
||||
g:lightline.component_expand *g:lightline.component_expand*
|
||||
Another dictionary for components. You can create a component
|
||||
|
@ -203,7 +223,7 @@ OPTIONS *lightline-option*
|
|||
The colorscheme for lightline.vim.
|
||||
Currently, wombat, solarized, powerline, jellybeans, Tomorrow,
|
||||
Tomorrow_Night, Tomorrow_Night_Blue, Tomorrow_Night_Eighties,
|
||||
PaperColor, seoul256, landscape and 16color are available.
|
||||
PaperColor, seoul256, landscape, one, Dracula, Molokai and 16color are available.
|
||||
The default value is:
|
||||
>
|
||||
let g:lightline.colorscheme = 'default'
|
||||
|
@ -279,16 +299,16 @@ nice.
|
|||
\ 'lineinfo': ' %3l:%-2v',
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'readonly': 'LightLineReadonly',
|
||||
\ 'fugitive': 'LightLineFugitive'
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'fugitive': 'LightlineFugitive'
|
||||
\ },
|
||||
\ 'separator': { 'left': '', 'right': '' },
|
||||
\ 'subseparator': { 'left': '', 'right': '' }
|
||||
\ }
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &readonly ? '' : ''
|
||||
endfunction
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if exists('*fugitive#head')
|
||||
let branch = fugitive#head()
|
||||
return branch !=# '' ? ''.branch : ''
|
||||
|
@ -304,16 +324,16 @@ look nice.
|
|||
\ 'lineinfo': '⭡ %3l:%-2v',
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'readonly': 'LightLineReadonly',
|
||||
\ 'fugitive': 'LightLineFugitive'
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'fugitive': 'LightlineFugitive'
|
||||
\ },
|
||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
||||
\ }
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &readonly ? '⭤' : ''
|
||||
endfunction
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if exists('*fugitive#head')
|
||||
let branch = fugitive#head()
|
||||
return branch !=# '' ? '⭠ '.branch : ''
|
||||
|
@ -616,6 +636,16 @@ compiled version of your colorscheme.
|
|||
<
|
||||
Then copy and paste the result to the colorscheme file.
|
||||
|
||||
If you want to contribute a new colorscheme that is not currently available
|
||||
please follow the following rules:
|
||||
*) All hex codes should be lowercase only
|
||||
*) Use 2 space soft tabs
|
||||
*) If your colorscheme has both light and dark variants, use a single file
|
||||
*) Normal Mode should default to Cyan
|
||||
*) Insert Mode should default to Green
|
||||
*) Visual Mode should default to Yellow
|
||||
*) Replace Mode should default to Red
|
||||
|
||||
==============================================================================
|
||||
EXAMPLES *lightline-examples*
|
||||
You can configure the appearance of statusline.
|
||||
|
@ -635,22 +665,22 @@ In order to define your own component:
|
|||
\ 'left': [ [ 'mode', 'paste' ], [ 'myfilename' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'myfilename': 'LightLineFilename',
|
||||
\ 'myreadonly': 'LightLineReadonly',
|
||||
\ 'mymodified': 'LightLineModified',
|
||||
\ 'myfilename': 'LightlineFilename',
|
||||
\ 'myreadonly': 'LightlineReadonly',
|
||||
\ 'mymodified': 'LightlineModified',
|
||||
\ }
|
||||
\ }
|
||||
function! LightLineFilename()
|
||||
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
function! LightlineFilename()
|
||||
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &modifiable && &modified ? '+' : ''
|
||||
endfunction
|
||||
<
|
||||
|
@ -690,25 +720,25 @@ A nice example for non-patched font users.
|
|||
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'filename': 'LightLineFilename'
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'filename': 'LightlineFilename'
|
||||
\ }
|
||||
\ }
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help\|vimfiler' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
function! LightLineFilename()
|
||||
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
function! LightlineFilename()
|
||||
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ &ft == 'vimshell' ? vimshell#get_status_string() :
|
||||
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||
return fugitive#head()
|
||||
endif
|
||||
|
@ -723,27 +753,27 @@ A nice example for |vim-powerline| font users:
|
|||
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'filename': 'LightLineFilename'
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'filename': 'LightlineFilename'
|
||||
\ },
|
||||
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
||||
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
||||
\ }
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help\|vimfiler' && &readonly ? '⭤' : ''
|
||||
endfunction
|
||||
function! LightLineFilename()
|
||||
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
function! LightlineFilename()
|
||||
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ &ft == 'vimshell' ? vimshell#get_status_string() :
|
||||
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||
let branch = fugitive#head()
|
||||
return branch !=# '' ? '⭠ '.branch : ''
|
||||
|
@ -764,12 +794,12 @@ For users who uses lots of plugins:
|
|||
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'filename': 'LightLineFilename',
|
||||
\ 'fileformat': 'LightLineFileformat',
|
||||
\ 'filetype': 'LightLineFiletype',
|
||||
\ 'fileencoding': 'LightLineFileencoding',
|
||||
\ 'mode': 'LightLineMode',
|
||||
\ 'fugitive': 'LightlineFugitive',
|
||||
\ 'filename': 'LightlineFilename',
|
||||
\ 'fileformat': 'LightlineFileformat',
|
||||
\ 'filetype': 'LightlineFiletype',
|
||||
\ 'fileencoding': 'LightlineFileencoding',
|
||||
\ 'mode': 'LightlineMode',
|
||||
\ 'ctrlpmark': 'CtrlPMark',
|
||||
\ },
|
||||
\ 'component_expand': {
|
||||
|
@ -781,15 +811,15 @@ For users who uses lots of plugins:
|
|||
\ 'subseparator': { 'left': '|', 'right': '|' }
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
function! LightlineReadonly()
|
||||
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
function! LightlineFilename()
|
||||
let fname = expand('%:t')
|
||||
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
|
||||
\ fname == '__Tagbar__' ? g:lightline.fname :
|
||||
|
@ -797,12 +827,12 @@ For users who uses lots of plugins:
|
|||
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ &ft == 'unite' ? unite#get_status_string() :
|
||||
\ &ft == 'vimshell' ? vimshell#get_status_string() :
|
||||
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
\ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
||||
\ ('' != fname ? fname : '[No Name]') .
|
||||
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
|
||||
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
function! LightlineFugitive()
|
||||
try
|
||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||
let mark = '' " edit here for cool mark
|
||||
|
@ -814,19 +844,19 @@ For users who uses lots of plugins:
|
|||
return ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileformat()
|
||||
function! LightlineFileformat()
|
||||
return winwidth(0) > 70 ? &fileformat : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
function! LightlineFiletype()
|
||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
function! LightlineFileencoding()
|
||||
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
function! LightlineMode()
|
||||
let fname = expand('%:t')
|
||||
return fname == '__Tagbar__' ? 'Tagbar' :
|
||||
\ fname == 'ControlP' ? 'CtrlP' :
|
||||
|
@ -1126,7 +1156,7 @@ Problem 9: *lightline-problem-9*
|
|||
subseparator.right '|' '' (\ue0b3) '⮃' (\u2b83)
|
||||
branch symbol -- '' (\ue0a0) '⭠' (\u2b60)
|
||||
readonly symbol -- '' (\ue0a2) '⭤' (\u2b64)
|
||||
linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b81)
|
||||
linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b61)
|
||||
|
||||
Problem 10: *lightline-problem-10*
|
||||
Cool statusline disappears on |unite|, |vimfiler| and |vimshell|
|
||||
|
@ -1169,10 +1199,10 @@ Problem 12: *lightline-problem-12*
|
|||
>
|
||||
let g:lightline = {
|
||||
\ 'component': {
|
||||
\ 'modified': '%#ModifiedColor#%{LightLineModified()}',
|
||||
\ 'modified': '%#ModifiedColor#%{LightlineModified()}',
|
||||
\ }
|
||||
\ }
|
||||
function! LightLineModified()
|
||||
function! LightlineModified()
|
||||
let map = { 'V': 'n', "\<C-v>": 'n', 's': 'n', 'v': 'n', "\<C-s>": 'n', 'c': 'n', 'R': 'n'}
|
||||
let mode = get(map, mode()[0], mode()[0])
|
||||
let bgcolor = {'n': [240, '#585858'], 'i': [31, '#0087af']}
|
||||
|
@ -1191,7 +1221,7 @@ Problem 13: *lightline-problem-13*
|
|||
|
||||
Add the following settings to your .vimrc(_vimrc).
|
||||
>
|
||||
augroup LightLineColorscheme
|
||||
augroup LightlineColorscheme
|
||||
autocmd!
|
||||
autocmd ColorScheme * call s:lightline_update()
|
||||
augroup END
|
||||
|
@ -1202,8 +1232,7 @@ Problem 13: *lightline-problem-13*
|
|||
try
|
||||
if g:colors_name =~# 'wombat\|solarized\|landscape\|jellybeans\|seoul256\|Tomorrow'
|
||||
let g:lightline.colorscheme =
|
||||
\ substitute(substitute(g:colors_name, '-', '_', 'g'), '256.*', '', '') .
|
||||
\ (g:colors_name ==# 'solarized' ? '_' . &background : '')
|
||||
\ substitute(substitute(g:colors_name, '-', '_', 'g'), '256.*', '', '')
|
||||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
call lightline#update()
|
||||
|
@ -1271,11 +1300,5 @@ Problem 17: *lightline-problem-17*
|
|||
Report/Request the issue/feature at
|
||||
https://github.com/itchyny/lightline.vim/issues.
|
||||
|
||||
==============================================================================
|
||||
CHANGELOG *lightline-changelog*
|
||||
|
||||
0.0 2013-08-21, ...
|
||||
- Initial commit and implementation
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:noet:
|
||||
|
|
|
@ -610,3 +610,15 @@ function! s:suite.duplicated_type_both_nil_right_most()
|
|||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']])
|
||||
delfunction Custom
|
||||
endfunction
|
||||
|
||||
function! s:suite.dictionary_function()
|
||||
let g:lightline = { 'component_expand': { 'custom': 'g:lightline.Custom' } }
|
||||
function! g:lightline.Custom()
|
||||
return [ ['left'], ['middle'], ['right'] ]
|
||||
endfunction
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
||||
endfunction
|
||||
|
|
|
@ -23,14 +23,14 @@ function! s:suite.highlight()
|
|||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
endfunction
|
||||
|
||||
function! s:suite.insert()
|
||||
|
@ -39,14 +39,14 @@ function! s:suite.insert()
|
|||
call lightline#colorscheme()
|
||||
call lightline#highlight('insert')
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_insert_0'), s:pattern(palette.insert.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_insert_1'), s:pattern(palette.insert.left[1]))
|
||||
call s:assert.match(s:hi('LightLineLeft_insert_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_insert_0'), s:pattern(palette.insert.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_insert_1'), s:pattern(palette.insert.right[1]))
|
||||
call s:assert.match(s:hi('LightLineRight_insert_2'), s:pattern(palette.insert.right[2]))
|
||||
call s:assert.match(s:hi('LightLineRight_insert_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_insert'), s:pattern(palette.insert.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_insert_0'), s:pattern(palette.insert.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_insert_1'), s:pattern(palette.insert.left[1]))
|
||||
call s:assert.match(s:hi('LightlineLeft_insert_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_insert_0'), s:pattern(palette.insert.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_insert_1'), s:pattern(palette.insert.right[1]))
|
||||
call s:assert.match(s:hi('LightlineRight_insert_2'), s:pattern(palette.insert.right[2]))
|
||||
call s:assert.match(s:hi('LightlineRight_insert_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_insert'), s:pattern(palette.insert.middle[0]))
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -56,14 +56,14 @@ function! s:suite.visual()
|
|||
call lightline#colorscheme()
|
||||
call lightline#highlight('visual')
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_visual_0'), s:pattern(palette.visual.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_visual_1'), s:pattern(palette.visual.left[1]))
|
||||
call s:assert.match(s:hi('LightLineLeft_visual_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_visual_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_visual_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightLineRight_visual_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightLineRight_visual_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_visual_0'), s:pattern(palette.visual.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_visual_1'), s:pattern(palette.visual.left[1]))
|
||||
call s:assert.match(s:hi('LightlineLeft_visual_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_visual_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_visual_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightlineRight_visual_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightlineRight_visual_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
endfunction
|
||||
|
||||
function! s:suite.replace()
|
||||
|
@ -72,14 +72,14 @@ function! s:suite.replace()
|
|||
call lightline#colorscheme()
|
||||
call lightline#highlight('replace')
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_replace_0'), s:pattern(palette.replace.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_replace_1'), s:pattern(palette.replace.left[1]))
|
||||
call s:assert.match(s:hi('LightLineLeft_replace_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_replace_0'), s:pattern(palette.replace.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_replace_1'), s:pattern(palette.replace.right[1]))
|
||||
call s:assert.match(s:hi('LightLineRight_replace_2'), s:pattern(palette.replace.right[2]))
|
||||
call s:assert.match(s:hi('LightLineRight_replace_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_replace'), s:pattern(palette.replace.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_replace_0'), s:pattern(palette.replace.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_replace_1'), s:pattern(palette.replace.left[1]))
|
||||
call s:assert.match(s:hi('LightlineLeft_replace_2'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_replace_0'), s:pattern(palette.replace.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_replace_1'), s:pattern(palette.replace.right[1]))
|
||||
call s:assert.match(s:hi('LightlineRight_replace_2'), s:pattern(palette.replace.right[2]))
|
||||
call s:assert.match(s:hi('LightlineRight_replace_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_replace'), s:pattern(palette.replace.middle[0]))
|
||||
endfunction
|
||||
|
||||
function! s:suite.left_right()
|
||||
|
@ -92,18 +92,18 @@ function! s:suite.left_right()
|
|||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_2'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_3'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_4'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_3'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_4'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_5'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_2'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_3'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_4'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_3'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_4'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_5'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
endfunction
|
||||
|
||||
function! s:suite.no_components()
|
||||
|
@ -120,11 +120,11 @@ function! s:suite.no_components()
|
|||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
let palette = lightline#palette()
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightLineLeft_normal_1'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightLineRight_normal_1'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
||||
call s:assert.match(s:hi('LightlineRight_normal_1'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator()
|
||||
|
@ -140,9 +140,9 @@ function! s:suite.subseparator()
|
|||
for i in range(4)
|
||||
for j in range(5)
|
||||
if i + 1 == j
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), s:pattern(get(palette.normal.left, i, palette.normal.middle[0]), get(palette.normal.left, j, palette.normal.middle[0])))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', i, j)), s:pattern(get(palette.normal.left, i, palette.normal.middle[0]), get(palette.normal.left, j, palette.normal.middle[0])))
|
||||
else
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', i, j)), 'E411: highlight group not found\|cleared')
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
@ -154,18 +154,18 @@ function! s:suite.component_type()
|
|||
call lightline#colorscheme()
|
||||
let palette = lightline#palette()
|
||||
for type in ['error', 'warning']
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s', type)), s:pattern(palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_0_%s', type)), s:pattern(palette.normal.left[0], palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_1_%s', type)), s:pattern(palette.normal.left[1], palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_2_%s', type)), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_0', type)), s:pattern(palette.normal[type][0], palette.normal.left[0]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_1', type)), s:pattern(palette.normal[type][0], palette.normal.left[1]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_2', type)), s:pattern(palette.normal[type][0], palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_3', type)), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s', type)), s:pattern(palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_0_%s', type)), s:pattern(palette.normal.left[0], palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_1_%s', type)), s:pattern(palette.normal.left[1], palette.normal[type][0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_2_%s', type)), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_0', type)), s:pattern(palette.normal[type][0], palette.normal.left[0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_1', type)), s:pattern(palette.normal[type][0], palette.normal.left[1]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_2', type)), s:pattern(palette.normal[type][0], palette.normal.middle[0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_3', type)), 'E411: highlight group not found\|cleared')
|
||||
endfor
|
||||
for type1 in ['error', 'warning']
|
||||
for type2 in ['error', 'warning']
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', type1, type2)), s:pattern(palette.normal[type1][0], palette.normal[type2][0]))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', type1, type2)), s:pattern(palette.normal[type1][0], palette.normal[type2][0]))
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
|
|
@ -17,50 +17,50 @@ endfunction
|
|||
|
||||
function! s:suite.link()
|
||||
call lightline#link()
|
||||
call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
|
||||
call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
|
||||
call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
|
||||
call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_normal_0')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_normal_1')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_normal_0')
|
||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_normal_1')
|
||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_normal_2')
|
||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
|
||||
endfunction
|
||||
|
||||
function! s:suite.insert()
|
||||
call lightline#link('i')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_insert_0')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_insert_1')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_insert_0')
|
||||
call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_insert_1')
|
||||
call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_insert_2')
|
||||
call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_insert')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_insert_0')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_insert_1')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_insert_0')
|
||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_insert_1')
|
||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_insert_2')
|
||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_insert')
|
||||
endfunction
|
||||
|
||||
function! s:suite.visual()
|
||||
call lightline#link('v')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_visual_0')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_visual_1')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_visual_0')
|
||||
call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_visual_1')
|
||||
call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_visual_2')
|
||||
call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_visual')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_visual_0')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_visual_1')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_visual_0')
|
||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_visual_1')
|
||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_visual_2')
|
||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_visual')
|
||||
endfunction
|
||||
|
||||
function! s:suite.replace()
|
||||
call lightline#link('R')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_replace_0')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_replace_1')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_replace_0')
|
||||
call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_replace_1')
|
||||
call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_replace_2')
|
||||
call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_replace')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_replace_0')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_replace_1')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_replace_0')
|
||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_replace_1')
|
||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_replace_2')
|
||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_replace')
|
||||
endfunction
|
||||
|
||||
function! s:suite.left_right()
|
||||
|
@ -73,18 +73,18 @@ function! s:suite.left_right()
|
|||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
call lightline#link()
|
||||
call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_2'), 'LightLineLeft_normal_2')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_3'), 'LightLineLeft_normal_3')
|
||||
call s:assert.match(s:hi('LightLineLeft_active_4'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
|
||||
call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
|
||||
call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
|
||||
call s:assert.match(s:hi('LightLineRight_active_3'), 'LightLineRight_normal_3')
|
||||
call s:assert.match(s:hi('LightLineRight_active_4'), 'LightLineRight_normal_4')
|
||||
call s:assert.match(s:hi('LightLineRight_active_5'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_normal_0')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_normal_1')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'LightlineLeft_normal_2')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_3'), 'LightlineLeft_normal_3')
|
||||
call s:assert.match(s:hi('LightlineLeft_active_4'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_normal_0')
|
||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_normal_1')
|
||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_normal_2')
|
||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'LightlineRight_normal_3')
|
||||
call s:assert.match(s:hi('LightlineRight_active_4'), 'LightlineRight_normal_4')
|
||||
call s:assert.match(s:hi('LightlineRight_active_5'), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator()
|
||||
|
@ -100,9 +100,9 @@ function! s:suite.subseparator()
|
|||
for i in range(4)
|
||||
for j in range(5)
|
||||
if i + 1 == j
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), printf('LightLineLeft_normal_%s_%s', i, j))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', i, j)), printf('LightlineLeft_normal_%s_%s', i, j))
|
||||
else
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', i, j)), 'E411: highlight group not found')
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
@ -114,18 +114,18 @@ function! s:suite.component_type()
|
|||
call lightline#colorscheme()
|
||||
call lightline#link()
|
||||
for type in ['error', 'warning']
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s', type)), printf('LightLineLeft_normal_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_0_%s', type)), printf('LightLineLeft_normal_0_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_1_%s', type)), printf('LightLineLeft_normal_1_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_2_%s', type)), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_0', type)), printf('LightLineLeft_normal_%s_0', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_1', type)), printf('LightLineLeft_normal_%s_1', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_2', type)), printf('LightLineLeft_normal_%s_2', type))
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_3', type)), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s', type)), printf('LightlineLeft_normal_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_0_%s', type)), printf('LightlineLeft_normal_0_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_1_%s', type)), printf('LightlineLeft_normal_1_%s', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_2_%s', type)), 'E411: highlight group not found')
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_0', type)), printf('LightlineLeft_normal_%s_0', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_1', type)), printf('LightlineLeft_normal_%s_1', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_2', type)), printf('LightlineLeft_normal_%s_2', type))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_3', type)), 'E411: highlight group not found')
|
||||
endfor
|
||||
for type1 in ['error', 'warning']
|
||||
for type2 in ['error', 'warning']
|
||||
call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', type1, type2)), printf('LightLineLeft_normal_%s_%s', type1, type2))
|
||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', type1, type2)), printf('LightlineLeft_normal_%s_%s', type1, type2))
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
|
|
@ -177,6 +177,111 @@ function! s:suite.subseparator_component_function_7()
|
|||
delfunction Custom3
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_1()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_2()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_3()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_4()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_5()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return ''
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_6()
|
||||
function! Custom1()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_7()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_expand()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
|
|
|
@ -1,4 +1,20 @@
|
|||
Next
|
||||
- Reuse/reopen existing window trees where possible #244
|
||||
- Remove NERDTree.previousBuf()
|
||||
- Change color of arrow (Leeiio) #630
|
||||
- Improved a tip in README.markdown (ggicci) #628
|
||||
- Shorten delete confimration of empty directory to 'y' (mikeperri) #530
|
||||
- Fix API call to open directory tree in window (devm33) #533
|
||||
- Change default arrows on non-Windows platforms (gwilk) #546
|
||||
- Update to README - combine cd and git clone (zwhitchcox) #584
|
||||
- Update to README - Tip: start NERDTree when vim starts (therealplato) #593
|
||||
- Escape filename when moving an open buffer (zacharyvoase) #595
|
||||
- Fixed incorrect :helptags command in README (curran) #619
|
||||
- Fixed incomplete escaping of folder arrows (adityanatraj) #548
|
||||
- Added NERDTreeCascadeSingleChildDir option (juanibiapina) #558
|
||||
- Replace strchars() with backward compatible workaround.
|
||||
- Add support for copy command in Windows (SkylerLipthay) #231
|
||||
- Fixed typo in README.markdown - :Helptags -> :helptags
|
||||
- Rename "primary" and "secondary" trees to "tab" and "window" trees.
|
||||
- Move a bunch of buffer level variables into the NERDTree and UI classes.
|
||||
- Display cascading dirs on one line to save vertical/horizontal space (@matt-gardner: brainstorming/testing)
|
||||
|
|
|
@ -57,10 +57,9 @@ Installation
|
|||
|
||||
####[pathogen.vim](https://github.com/tpope/vim-pathogen)
|
||||
|
||||
cd ~/.vim/bundle
|
||||
git clone https://github.com/scrooloose/nerdtree.git
|
||||
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
|
||||
|
||||
Then reload vim, run `:Helptags`, and check out `:help NERD_tree.txt`.
|
||||
Then reload vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERD_tree.txt`.
|
||||
|
||||
|
||||
####[apt-vim](https://github.com/egalpin/apt-vim)
|
||||
|
@ -101,6 +100,14 @@ Stick this in your vimrc:
|
|||
|
||||
Note: Now start vim with plain `vim`, not `vim .`
|
||||
|
||||
---
|
||||
> How can I open NERDTree automatically when vim starts up on opening a directory?
|
||||
|
||||
autocmd StdinReadPre * let s:std_in=1
|
||||
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
|
||||
|
||||
This window is tab-specific, meaning it's used by all windows in the tab. This trick also prevents NERDTree from hiding when first selecting a file.
|
||||
|
||||
---
|
||||
> How can I map a specific key or shortcut to open NERDTree?
|
||||
|
||||
|
|
|
@ -13,9 +13,37 @@ endfunction
|
|||
"FUNCTION: nerdtree#checkForBrowse(dir) {{{2
|
||||
"inits a window tree in the current buffer if appropriate
|
||||
function! nerdtree#checkForBrowse(dir)
|
||||
if a:dir != '' && isdirectory(a:dir)
|
||||
call g:NERDTreeCreator.CreateWindowTree(a:dir)
|
||||
if !isdirectory(a:dir)
|
||||
return
|
||||
endif
|
||||
|
||||
if s:reuseWin(a:dir)
|
||||
return
|
||||
endif
|
||||
|
||||
call g:NERDTreeCreator.CreateWindowTree(a:dir)
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:reuseWin(dir) {{{2
|
||||
"finds a NERDTree buffer with root of dir, and opens it.
|
||||
function! s:reuseWin(dir) abort
|
||||
let path = g:NERDTreePath.New(fnamemodify(a:dir, ":p"))
|
||||
|
||||
for i in range(1, bufnr("$"))
|
||||
unlet! nt
|
||||
let nt = getbufvar(i, "NERDTree")
|
||||
if empty(nt)
|
||||
continue
|
||||
endif
|
||||
|
||||
if nt.isWinTree() && nt.root.path.equals(path)
|
||||
call nt.setPreviousBuf(bufnr("#"))
|
||||
exec "buffer " . i
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nerdtree#completeBookmarks(A,L,P) {{{2
|
||||
|
|
|
@ -668,14 +668,18 @@ NERD tree. These options should be set in your vimrc.
|
|||
|'NERDTreeWinSize'| Sets the window size when the NERD tree is
|
||||
opened.
|
||||
|
||||
|'NERDTreeMinimalUI'| Disables display of the 'Bookmarks' label and
|
||||
|'NERDTreeMinimalUI'| Disables display of the 'Bookmarks' label and
|
||||
'Press ? for help' text.
|
||||
|
||||
|'NERDTreeCascadeSingleChildDir'|
|
||||
Collapses on the same line directories that
|
||||
have only one child directory.
|
||||
|
||||
|'NERDTreeCascadeOpenSingleChildDir'|
|
||||
Cascade open while selected directory has only
|
||||
one child that also is a directory.
|
||||
|
||||
|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove
|
||||
|'NERDTreeAutoDeleteBuffer'| Tells the NERD tree to automatically remove
|
||||
a buffer when a file is being deleted or renamed
|
||||
via a context menu command.
|
||||
|
||||
|
@ -987,7 +991,18 @@ of the following lines to set this option: >
|
|||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeCascadeOpenSingleChildDir'*
|
||||
*'NERDTreeCascadeSingleChildDir'*
|
||||
Values: 0 or 1
|
||||
Default: 1.
|
||||
|
||||
When displaying dir nodes, this option tells NERDTree to collapse dirs that
|
||||
have only one child. Use one of the follow lines to set this option: >
|
||||
let NERDTreeCascadeSingleChildDir=0
|
||||
let NERDTreeCascadeSingleChildDir=1
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeCascadeOpenSingleChildDir'*
|
||||
Values: 0 or 1
|
||||
Default: 1.
|
||||
|
||||
|
@ -1001,7 +1016,7 @@ useful for Java projects. Use one of the follow lines to set this option: >
|
|||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'NERDTreeAutoDeleteBuffer'*
|
||||
*'NERDTreeAutoDeleteBuffer'*
|
||||
Values: 0 or 1
|
||||
Default: 0.
|
||||
|
||||
|
|
|
@ -186,6 +186,10 @@ function! s:NERDTree.previousBuf()
|
|||
return self._previousBuf
|
||||
endfunction
|
||||
|
||||
function! s:NERDTree.setPreviousBuf(bnum)
|
||||
let self._previousBuf = a:bnum
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.render() {{{1
|
||||
"A convenience function - since this is called often
|
||||
function! s:NERDTree.render()
|
||||
|
|
|
@ -257,7 +257,7 @@ endfunction
|
|||
function! s:Opener._openDirectory(node)
|
||||
if self._nerdtree.isWinTree()
|
||||
call self._gotoTargetWin()
|
||||
call g:NERDTreeCreator.CreateWindow(a:node.path.str())
|
||||
call g:NERDTreeCreator.CreateWindowTree(a:node.path.str())
|
||||
else
|
||||
call self._gotoTargetWin()
|
||||
if empty(self._where)
|
||||
|
|
|
@ -174,11 +174,15 @@ function! s:Path.copy(dest)
|
|||
|
||||
call s:Path.createParentDirectories(a:dest)
|
||||
|
||||
let dest = s:Path.WinToUnixPath(a:dest)
|
||||
if exists('g:NERDTreeCopyCmd')
|
||||
let cmd_prefix = g:NERDTreeCopyCmd
|
||||
else
|
||||
let cmd_prefix = (self.isDirectory ? g:NERDTreeCopyDirCmd : g:NERDTreeCopyFileCmd)
|
||||
endif
|
||||
|
||||
let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), self._escChars()) . " " . escape(dest, self._escChars())
|
||||
let cmd = cmd_prefix . " " . escape(self.str(), self._escChars()) . " " . escape(a:dest, self._escChars())
|
||||
let success = system(cmd)
|
||||
if success != 0
|
||||
if v:shell_error != 0
|
||||
throw "NERDTree.CopyError: Could not copy ''". self.str() ."'' to: '" . a:dest . "'"
|
||||
endif
|
||||
endfunction
|
||||
|
@ -187,7 +191,7 @@ endfunction
|
|||
"
|
||||
"returns 1 if copying is supported for this OS
|
||||
function! s:Path.CopyingSupported()
|
||||
return exists('g:NERDTreeCopyCmd')
|
||||
return exists('g:NERDTreeCopyCmd') || (exists('g:NERDTreeCopyDirCmd') && exists('g:NERDTreeCopyFileCmd'))
|
||||
endfunction
|
||||
|
||||
"FUNCTION: Path.copyingWillOverwrite(dest) {{{1
|
||||
|
@ -213,7 +217,7 @@ endfunction
|
|||
"FUNCTION: Path.createParentDirectories(path) {{{1
|
||||
"
|
||||
"create parent directories for this path if needed
|
||||
"without throwing any errors is those directories already exist
|
||||
"without throwing any errors if those directories already exist
|
||||
"
|
||||
"Args:
|
||||
"path: full path of the node whose parent directories may need to be created
|
||||
|
@ -226,8 +230,7 @@ endfunction
|
|||
|
||||
"FUNCTION: Path.delete() {{{1
|
||||
"
|
||||
"Deletes the file represented by this path.
|
||||
"Deletion of directories is not supported
|
||||
"Deletes the file or directory represented by this path.
|
||||
"
|
||||
"Throws NERDTree.Path.Deletion exceptions
|
||||
function! s:Path.delete()
|
||||
|
|
|
@ -117,28 +117,14 @@ endfunction
|
|||
"FUNCTION: TreeDirNode.getCascade() {{{1
|
||||
"Return an array of dir nodes (starting from self) that can be cascade opened.
|
||||
function! s:TreeDirNode.getCascade()
|
||||
if !self.isCascadable()
|
||||
return [self]
|
||||
endif
|
||||
|
||||
let rv = [self]
|
||||
let node = self
|
||||
let vc = self.getVisibleChildren()
|
||||
let visChild = vc[0]
|
||||
|
||||
while 1
|
||||
let vc = node.getVisibleChildren()
|
||||
if len(vc) != 1
|
||||
break
|
||||
endif
|
||||
|
||||
let visChild = vc[0]
|
||||
|
||||
"TODO: optimize
|
||||
if !visChild.path.isDirectory
|
||||
break
|
||||
endif
|
||||
|
||||
call add(rv, visChild)
|
||||
let node = visChild
|
||||
endwhile
|
||||
|
||||
return rv
|
||||
return [self] + visChild.getCascade()
|
||||
endfunction
|
||||
|
||||
"FUNCTION: TreeDirNode.getChildCount() {{{1
|
||||
|
@ -264,6 +250,10 @@ endfunction
|
|||
"FUNCTION: TreeDirNode.isCascadable() {{{1
|
||||
"true if this dir has only one visible child - which is also a dir
|
||||
function! s:TreeDirNode.isCascadable()
|
||||
if g:NERDTreeCascadeSingleChildDir == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let c = self.getVisibleChildren()
|
||||
return len(c) == 1 && c[0].path.isDirectory
|
||||
endfunction
|
||||
|
@ -466,7 +456,7 @@ function! s:TreeDirNode.refresh()
|
|||
|
||||
" Regular expression is too expensive. Use simply string comparison
|
||||
" instead
|
||||
if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." &&
|
||||
if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." &&
|
||||
\ i[len(i)-2:1] != "." && i[len(i)-1] != "."
|
||||
try
|
||||
"create a new path and see if it exists in this nodes children
|
||||
|
|
|
@ -282,7 +282,8 @@ endfunction
|
|||
function! s:UI._indentLevelFor(line)
|
||||
"have to do this work around because match() returns bytes, not chars
|
||||
let numLeadBytes = match(a:line, '\M\[^ '.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']')
|
||||
let leadChars = strchars(a:line[0:numLeadBytes-1])
|
||||
" The next line is a backward-compatible workaround for strchars(a:line(0:numLeadBytes-1]). strchars() is in 7.3+
|
||||
let leadChars = len(split(a:line[0:numLeadBytes-1], '\zs'))
|
||||
|
||||
return leadChars / s:UI.IndentWid()
|
||||
endfunction
|
||||
|
|
|
@ -74,7 +74,7 @@ endfunction
|
|||
function! s:promptToRenameBuffer(bufnum, msg, newFileName)
|
||||
echo a:msg
|
||||
if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y'
|
||||
let quotedFileName = "'" . a:newFileName . "'"
|
||||
let quotedFileName = fnameescape(a:newFileName)
|
||||
" 1. ensure that a new buffer is loaded
|
||||
exec "badd " . quotedFileName
|
||||
" 2. ensure that all windows which display the just deleted filename
|
||||
|
@ -160,10 +160,10 @@ function! NERDTreeDeleteNode()
|
|||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let confirmed = 0
|
||||
|
||||
if currentNode.path.isDirectory
|
||||
if currentNode.path.isDirectory && currentNode.getChildCount() > 0
|
||||
let choice =input("Delete the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "STOP! To delete this entire directory, type 'yes'\n" .
|
||||
\ "STOP! Directory is not empty! To delete, type 'yes'\n" .
|
||||
\ "" . currentNode.path.str() . ": ")
|
||||
let confirmed = choice ==# 'yes'
|
||||
else
|
||||
|
|
|
@ -75,6 +75,7 @@ else
|
|||
call s:initVariable("g:NERDTreeDirArrowCollapsible", "~")
|
||||
endif
|
||||
call s:initVariable("g:NERDTreeCascadeOpenSingleChildDir", 1)
|
||||
call s:initVariable("g:NERDTreeCascadeSingleChildDir", 1)
|
||||
|
||||
if !exists("g:NERDTreeSortOrder")
|
||||
let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$']
|
||||
|
@ -103,6 +104,8 @@ call s:initVariable("g:NERDTreeWinSize", 31)
|
|||
"Note: the space after the command is important
|
||||
if nerdtree#runningWindows()
|
||||
call s:initVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ')
|
||||
call s:initVariable("g:NERDTreeCopyDirCmd", 'xcopy /s /e /i /y /q ')
|
||||
call s:initVariable("g:NERDTreeCopyFileCmd", 'copy /y ')
|
||||
else
|
||||
call s:initVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ')
|
||||
call s:initVariable("g:NERDTreeCopyCmd", 'cp -r ')
|
||||
|
|
|
@ -25,7 +25,7 @@ syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
|||
exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
||||
exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
||||
|
||||
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~')
|
||||
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-')
|
||||
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
||||
syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark
|
||||
exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile'
|
||||
|
@ -72,8 +72,8 @@ hi def link NERDTreeDir Directory
|
|||
hi def link NERDTreeUp Directory
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeCWD Statement
|
||||
hi def link NERDTreeOpenable Title
|
||||
hi def link NERDTreeClosable Title
|
||||
hi def link NERDTreeOpenable Directory
|
||||
hi def link NERDTreeClosable Directory
|
||||
hi def link NERDTreeIgnore ignore
|
||||
hi def link NERDTreeRO WarningMsg
|
||||
hi def link NERDTreeBookmark Statement
|
||||
|
|
|
@ -97,9 +97,9 @@ let errorformat =
|
|||
\ '%-G%.%#'
|
||||
```
|
||||
|
||||
[bug_tracker]: https://github.com/scrooloose/syntastic/issues
|
||||
[manual]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[github]: https://github.com/scrooloose/syntastic
|
||||
[bug_tracker]: https://github.com/vim-syntastic/syntastic/issues
|
||||
[manual]: https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic.txt
|
||||
[github]: https://github.com/vim-syntastic/syntastic
|
||||
[branches]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
|
||||
[variables]: http://www.refactoring.com/catalog/extractVariable.html
|
||||
[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[guide]: https://github.com/vim-syntastic/syntastic/wiki/Syntax-Checker-Guide
|
||||
|
|
|
@ -25,21 +25,22 @@
|
|||
3. [Recommended settings](#settings)
|
||||
4. [FAQ](#faq)
|
||||
4.1. [I installed syntastic but it isn't reporting any errors...](#faqinfo)
|
||||
4.2. [How can I check scripts written for different versions of Python?](#faqpython)
|
||||
4.3. [How can I check scripts written for different versions of Ruby?](#faqruby)
|
||||
4.4. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5)
|
||||
4.5. [The `perl` checker has stopped working...](#faqperl)
|
||||
4.6. [What happened to the `rustc` checker?](#faqrust)
|
||||
4.7. [What happened to the `xcrun` checker?](#faqxcrun)
|
||||
4.8. [I run a checker and the location list is not updated...](#faqloclist)
|
||||
4.8. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist)
|
||||
4.9. [How can I pass additional arguments to a checker?](#faqargs)
|
||||
4.10. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers)
|
||||
4.11. [What is the difference between syntax checkers and style checkers?](#faqstyle)
|
||||
4.12. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate)
|
||||
4.13. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext)
|
||||
4.14. [My favourite checker needs to load a configuration file from the project's root rather than the current directory...](#faqconfig)
|
||||
4.15. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete)
|
||||
4.2. [Syntastic supports several checkers for my filetype, how do I tell it which one(s) to use?](#faqcheckers)
|
||||
4.3. [How can I run checkers for "foreign" filetypes against the current file?](#faqforeign)
|
||||
4.4. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate)
|
||||
4.5. [How can I pass additional arguments to a checker?](#faqargs)
|
||||
4.6. [I run a checker and the location list is not updated...](#faqloclist)
|
||||
4.6. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist)
|
||||
4.7. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext)
|
||||
4.8. [The error window is closed automatically when I `:quit` the current buffer but not when I `:bdelete` it?](#faqbdelete)
|
||||
4.9. [My favourite checker needs to load a configuration file from the project's root rather than the current directory...](#faqconfig)
|
||||
4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle)
|
||||
4.11. [How can I check scripts written for different versions of Python?](#faqpython)
|
||||
4.12. [How can I check scripts written for different versions of Ruby?](#faqruby)
|
||||
4.13. [The `perl` checker has stopped working...](#faqperl)
|
||||
4.14. [What happened to the `rustc` checker?](#faqrust)
|
||||
4.15. [What happened to the `tsc` checker?](#faqtsc)
|
||||
4.16. [What happened to the `xcrun` checker?](#faqxcrun)
|
||||
5. [Resources](#otherresources)
|
||||
|
||||
- - -
|
||||
|
@ -48,32 +49,33 @@
|
|||
|
||||
## 1\. Introduction
|
||||
|
||||
Syntastic is a syntax checking plugin for [Vim][vim] 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.
|
||||
Syntastic is a syntax checking plugin for [Vim][vim] created by
|
||||
[Martin Grenfell][scrooloose]. It 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, syntastic has checking plugins for ActionScript,
|
||||
Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, Assembly
|
||||
languages, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript,
|
||||
Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir,
|
||||
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
|
||||
Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
|
||||
LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix,
|
||||
Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable
|
||||
Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python,
|
||||
QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec,
|
||||
Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo,
|
||||
Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery,
|
||||
YACC, YAML, 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).
|
||||
At the time of this writing, syntastic has checking plugins for ACPI
|
||||
Source Language, ActionScript, Ada, Ansible configurations, API Blueprint,
|
||||
AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C,
|
||||
C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart,
|
||||
DocBook, Dockerfile, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata,
|
||||
GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON,
|
||||
JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown,
|
||||
MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl
|
||||
POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug (formerly
|
||||
Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax 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, 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).
|
||||
|
||||
A number of third-party Vim plugins also provide checkers for syntastic,
|
||||
for example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
|
||||
[syntastic-extras][myint], [syntastic-more][roktas], [vim-crystal][crystal],
|
||||
[vim-eastwood][eastwood], and [vim-swift][swift].
|
||||
A number of third-party Vim plugins also provide checkers for syntastic, for
|
||||
example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
|
||||
[syntastic-extras][myint], [syntastic-more][roktas], [tsuquyomi][tsuquyomi],
|
||||
[vim-crystal][crystal], [vim-eastwood][eastwood], and [vim-swift][swift].
|
||||
|
||||
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
|
||||
|
@ -105,9 +107,9 @@ version 7 or later with the "normal", "big", or "huge" feature sets should be
|
|||
fine.
|
||||
|
||||
Syntastic should work with any modern plugin managers for Vim, such as
|
||||
[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], [Vim-Plug][plug], or
|
||||
[Vundle][vundle]. Instructions for installing syntastic with [Pathogen][pathogen] are
|
||||
included below for completeness.
|
||||
[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam],
|
||||
[Vim-Plug][plug], or [Vundle][vundle]. Instructions for installing syntastic
|
||||
with [Pathogen][pathogen] are included below for completeness.
|
||||
|
||||
Starting with Vim version 7.4.1486 you can also load syntastic using the
|
||||
standard mechanism of packages, without the help of third-party plugin managers
|
||||
|
@ -152,7 +154,7 @@ You now have pathogen installed and can put syntastic into `~/.vim/bundle` like
|
|||
this:
|
||||
```sh
|
||||
cd ~/.vim/bundle && \
|
||||
git clone --depth=1 https://github.com/scrooloose/syntastic.git
|
||||
git clone --depth=1 https://github.com/vim-syntastic/syntastic.git
|
||||
```
|
||||
Quit vim and start it back up to reload it, then type:
|
||||
```vim
|
||||
|
@ -229,9 +231,194 @@ 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 post an [issue][bug_tracker] - or better yet, create a pull request.
|
||||
|
||||
<a name="faqcheckers"></a>
|
||||
|
||||
__4.2. Q. Syntastic supports several checkers for my filetype, how do I tell it
|
||||
which one(s) to use?__
|
||||
|
||||
A. Add a line like this to your `vimrc`:
|
||||
```vim
|
||||
let g:syntastic_<filetype>_checkers = ['<checker-name>']
|
||||
```
|
||||
|
||||
To see the list of supported checkers for your filetype read the
|
||||
[manual][checkers] (`:help syntastic-checkers` in Vim).
|
||||
|
||||
For example, Python has the following checkers, among others: `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']
|
||||
```
|
||||
|
||||
Checkers 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`.
|
||||
|
||||
You can also run checkers explicitly by calling `:SyntasticCheck <checker>`.
|
||||
For example to run `phpcs` and `phpmd`:
|
||||
```vim
|
||||
:SyntasticCheck phpcs phpmd
|
||||
```
|
||||
|
||||
This works for any checkers available for the current filetype, even if they
|
||||
aren't listed in `g:syntastic_<filetype>_checkers`.
|
||||
|
||||
<a name="faqforeign"></a>
|
||||
|
||||
__4.3. Q. How can I run checkers for "foreign" filetypes against the current
|
||||
file?__
|
||||
|
||||
A. You need to qualify the name of the "foreign" checker with the name
|
||||
of its filetype. For example to check `tex` files with the checker
|
||||
`language_check` (which normally acts only on files of type `text`), you can
|
||||
add `text/language_check` to the list fo checkers for `tex`:
|
||||
```vim
|
||||
let g:syntastic_tex_checkers = ['lacheck', 'text/language_check']
|
||||
```
|
||||
|
||||
This also works with `:SyntasticCheck`, e.g. the following command runs
|
||||
`text/language_check` against the current file regardless of the current
|
||||
filetype:
|
||||
```vim
|
||||
:SyntasticCheck text/language_check
|
||||
```
|
||||
|
||||
Of course, the checkers specified this way need to be known to syntastic, and
|
||||
they need to be shown as available when you run `:SyntasticInfo`. You can't
|
||||
just make up a combination of a filetype and a program name and expect it to
|
||||
work as a checker.
|
||||
|
||||
<a name="faqaggregate"></a>
|
||||
|
||||
__4.4. Q. I have enabled multiple checkers for the current filetype. How can I
|
||||
display all errors from all checkers together?__
|
||||
|
||||
A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`:
|
||||
```vim
|
||||
let g:syntastic_aggregate_errors = 1
|
||||
```
|
||||
|
||||
See `:help syntastic-aggregating-errors` for more details.
|
||||
|
||||
<a name="faqargs"></a>
|
||||
|
||||
__4.5. Q. How can I pass additional arguments to a checker?__
|
||||
|
||||
A. In most cases a command line is constructed using an internal function
|
||||
named `makeprgBuild()`, which provides a number of options that allow you to
|
||||
customise every part of the command that gets run. You can set these options
|
||||
using global variables.
|
||||
|
||||
The general form of the global `args` variable is
|
||||
`syntastic_<filetype>_<checker>_args`. Thus 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.
|
||||
|
||||
A number of checkers don't use the `makeprgBuild()` function mentioned above,
|
||||
or have additional options that can be configured. For these checkers the exact
|
||||
list of options should be included in the [manual][checkers]
|
||||
(`:help syntastic-checkers` in Vim).
|
||||
|
||||
<a name="faqloclist"></a>
|
||||
|
||||
__4.6. Q. I run a checker and the location list is not updated...__
|
||||
__4.6. Q. I run`:lopen` or `:lwindow` and the error window is empty...__
|
||||
|
||||
A. By default the location list is changed only when you run the `:Errors`
|
||||
command, in order to minimise conflicts with other plugins. If you want the
|
||||
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
|
||||
```
|
||||
|
||||
<a name="faqlnext"></a>
|
||||
|
||||
__4.7. 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 :lprevious`.
|
||||
|
||||
If you use these commands a lot then you may want to add shortcut mappings to
|
||||
your `vimrc`, or install something like [unimpaired][unimpaired], which provides such
|
||||
mappings (among other things).
|
||||
|
||||
<a name="faqbdelete"></a>
|
||||
|
||||
__4.8. 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 <silent> <C-d> :lclose<CR>:bdelete<CR>
|
||||
cabbrev <silent> bd <C-r>=(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd')<CR>
|
||||
```
|
||||
|
||||
<a name="faqconfig"></a>
|
||||
|
||||
__4.9. My favourite checker needs to load a configuration file from the
|
||||
project's root rather than the current directory...__
|
||||
|
||||
A. You can set up an `autocmd` to search for the configuration file in the
|
||||
current directory and upwards, and add it to the checker's options when found.
|
||||
For example for `jscs`:
|
||||
|
||||
```vim
|
||||
function! FindConfig(prefix, what, where)
|
||||
let cfg = findfile(a:what, escape(a:where, ' ') . ';')
|
||||
return cfg !=# '' ? ' ' . a:prefix . ' ' . shellescape(cfg) : ''
|
||||
endfunction
|
||||
|
||||
autocmd FileType javascript let b:syntastic_javascript_jscs_args =
|
||||
\ get(g:, 'syntastic_javascript_jscs_args', '') .
|
||||
\ FindConfig('-c', '.jscsrc', expand('<afile>:p:h', 1))
|
||||
```
|
||||
|
||||
<a name="faqstyle"></a>
|
||||
|
||||
__4.10. Q. What is the difference between syntax checkers and style checkers?__
|
||||
|
||||
A. The errors and warnings they produce are highlighted differently and can
|
||||
be filtered by different rules, but otherwise the distinction is pretty much
|
||||
arbitrary. There is an ongoing effort to keep things consistent, so you can
|
||||
_generally_ expect messages produced by syntax checkers to be _mostly_ related
|
||||
to syntax, and messages produced by style checkers to be _mostly_ about style.
|
||||
But there can be no formal guarantee that, say, a style checker that runs into
|
||||
a syntax error wouldn't die with a fatal message, nor that a syntax checker
|
||||
wouldn't give you warnings against using some constructs as being bad practice.
|
||||
There is also no guarantee that messages marked as `style` are less severe than
|
||||
the ones marked as `syntax` (whatever that might mean). And there are even a
|
||||
few Frankenstein checkers (for example `flake8` and `pylama`) that, by their
|
||||
nature, produce both kinds of messages. Syntastic is not smart enough to be
|
||||
able to sort out these things by itself.
|
||||
|
||||
Generally it's more useful to look at this from the perspective of filtering
|
||||
unwanted messages, rather than as an indicator of severity levels. The
|
||||
distinction between syntax and style is orthogonal to the distinction between
|
||||
errors and warnings, and thus you can turn off messages based on level, on
|
||||
type, or both.
|
||||
|
||||
e.g. To disable all style messages:
|
||||
```vim
|
||||
let g:syntastic_quiet_messages = { "type": "style" }
|
||||
```
|
||||
See `:help syntastic_quiet_messages` for more information.
|
||||
|
||||
<a name="faqpython"></a>
|
||||
|
||||
__4.2. Q. How can I check scripts written for different versions of Python?__
|
||||
__4.11. Q. How can I check scripts written for different versions of Python?__
|
||||
|
||||
A. Install a Python version manager such as [virtualenv][virtualenv]
|
||||
or [pyenv][pyenv], activate the environment for the relevant version
|
||||
|
@ -247,7 +434,7 @@ scripts.
|
|||
|
||||
<a name="faqruby"></a>
|
||||
|
||||
__4.3. Q. How can I check scripts written for different versions of Ruby?__
|
||||
__4.12. Q. How can I check scripts written for different versions of Ruby?__
|
||||
|
||||
A. Install a Ruby version manager such as [rvm][rvm] or [rbenv][rbenv],
|
||||
activate the environment for the relevant version of Ruby, and install in it
|
||||
|
@ -260,29 +447,9 @@ virtual environment before running the actual checks. Then you'll need to
|
|||
point the relevant `g:syntastic_ruby_<checker>_exec` variables to the wrapper
|
||||
scripts.
|
||||
|
||||
<a name="faqhtml5"></a>
|
||||
|
||||
__4.4. Q. Are there any local checkers for HTML5 that I can use with syntastic?__
|
||||
|
||||
[HTML Tidy][tidy_old] has a fork named [HTML Tidy for HTML5][tidy]. It's a drop
|
||||
in replacement, and syntastic can use it without changes. Just install it
|
||||
somewhere and point `g:syntastic_html_tidy_exec` to its executable:
|
||||
```vim
|
||||
let g:syntastic_html_tidy_exec = 'tidy5'
|
||||
```
|
||||
Alternatively, you can install [vnu.jar][vnu_jar] from the [validator.nu][vnu]
|
||||
project and run it as a [HTTP server][vnu_server]:
|
||||
```sh
|
||||
$ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888
|
||||
```
|
||||
Then you can configure syntastic to use it:
|
||||
```vim
|
||||
let g:syntastic_html_validator_api = 'http://localhost:8888/'
|
||||
```
|
||||
|
||||
<a name="faqperl"></a>
|
||||
|
||||
__4.5. Q. The `perl` checker has stopped working...__
|
||||
__4.13. Q. The `perl` checker has stopped working...__
|
||||
|
||||
A. The `perl` checker runs `perl -c` against your file, which in turn
|
||||
__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use`
|
||||
|
@ -298,175 +465,27 @@ let g:syntastic_enable_perl_checker = 1
|
|||
|
||||
<a name="faqrust"></a>
|
||||
|
||||
__4.6. Q. What happened to the `rustc` checker?__
|
||||
__4.14. Q. What happened to the `rustc` checker?__
|
||||
|
||||
A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the
|
||||
checker should be picked up automatically by syntastic.
|
||||
|
||||
<a name="faqtsc"></a>
|
||||
|
||||
__4.15. Q. What happened to the `tsc` checker?__
|
||||
|
||||
A. It didn't meet people's expectations and it has been removed. The plugin
|
||||
[tsuquyomi][tsuquyomi] comes packaged with a checker for TypeScript. If you
|
||||
install this plugin the checker should be picked up automatically by syntastic.
|
||||
|
||||
<a name="faqxcrun"></a>
|
||||
|
||||
__4.7. Q. What happened to the `xcrun` checker?__
|
||||
__4.16. Q. What happened to the `xcrun` checker?__
|
||||
|
||||
A. The `xcrun` checker used to have a security problem and it has been removed.
|
||||
A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you
|
||||
install this plugin the checker should be picked up automatically by syntastic.
|
||||
|
||||
<a name="faqloclist"></a>
|
||||
|
||||
__4.8. Q. I run a checker and the location list is not updated...__
|
||||
__4.8. Q. I run`:lopen` or `:lwindow` and the error window is empty...__
|
||||
|
||||
A. By default the location list is changed only when you run the `:Errors`
|
||||
command, in order to minimise conflicts with other plugins. If you want the
|
||||
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
|
||||
```
|
||||
|
||||
<a name="faqargs"></a>
|
||||
|
||||
__4.9. Q. How can I pass additional arguments to a checker?__
|
||||
|
||||
A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers
|
||||
that do can be configured using global variables. The general form of the
|
||||
global `args` variables is `syntastic_<filetype>_<checker>_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.
|
||||
|
||||
<a name="faqcheckers"></a>
|
||||
|
||||
__4.10. 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_<filetype>_checkers = ['<checker-name>']
|
||||
```
|
||||
|
||||
To see the list of supported checkers for your filetype read the
|
||||
[manual][checkers] (`:help syntastic-checkers` in Vim).
|
||||
|
||||
e.g. Python has the following checkers, among others: `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']
|
||||
```
|
||||
|
||||
Checkers 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`.
|
||||
|
||||
You can also run checkers explicitly by calling `:SyntasticCheck <checker>`.
|
||||
|
||||
e.g. to run `phpcs` and `phpmd`:
|
||||
```vim
|
||||
:SyntasticCheck phpcs phpmd
|
||||
```
|
||||
|
||||
This works for any checkers available for the current filetype, even if they
|
||||
aren't listed in `g:syntastic_<filetype>_checkers`. You can't run checkers for
|
||||
"foreign" filetypes though (e.g. you can't run, say, a Python checker if the
|
||||
filetype of the current file is `php`).
|
||||
|
||||
<a name="faqstyle"></a>
|
||||
|
||||
__4.11. Q. What is the difference between syntax checkers and style checkers?__
|
||||
|
||||
A. The errors and warnings they produce are highlighted differently and can
|
||||
be filtered by different rules, but otherwise the distinction is pretty much
|
||||
arbitrary. There is an ongoing effort to keep things consistent, so you can
|
||||
_generally_ expect messages produced by syntax checkers to be _mostly_ related
|
||||
to syntax, and messages produced by style checkers to be _mostly_ about style.
|
||||
But there can be no formal guarantee that, say, a style checker that runs into
|
||||
a syntax error wouldn't die with a fatal message, nor that a syntax checker
|
||||
wouldn't give you warnings against using some constructs as being bad practice.
|
||||
There is also no guarantee that messages marked as "style" are less severe than
|
||||
the ones marked as "syntax" (whatever that might mean). And there are even a
|
||||
few Frankenstein checkers (for example `flake8` and `pylama`) that, by their
|
||||
nature, produce both kinds of messages. Syntastic is not smart enough to be
|
||||
able to sort out these things by itself.
|
||||
|
||||
In fact it's more useful to look at this from the perspective of filtering
|
||||
unwanted messages, rather than as an indicator of severity levels. The
|
||||
distinction between syntax and style is orthogonal to the distinction between
|
||||
errors and warnings, and thus you can turn off messages based on level, on
|
||||
type, or both.
|
||||
|
||||
e.g. To disable all style messages:
|
||||
```vim
|
||||
let g:syntastic_quiet_messages = { "type": "style" }
|
||||
```
|
||||
See `:help syntastic_quiet_messages` for details.
|
||||
|
||||
<a name="faqaggregate"></a>
|
||||
|
||||
__4.12. Q. I have enabled multiple checkers for the current filetype. How can I
|
||||
display all errors from all checkers together?__
|
||||
|
||||
A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`:
|
||||
```vim
|
||||
let g:syntastic_aggregate_errors = 1
|
||||
```
|
||||
|
||||
See `:help syntastic-aggregating-errors` for more details.
|
||||
|
||||
<a name="faqlnext"></a>
|
||||
|
||||
__4.13. 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 :lprevious`.
|
||||
|
||||
If you use these commands a lot then you may want to add shortcut mappings to
|
||||
your `vimrc`, or install something like [unimpaired][unimpaired], which provides such
|
||||
mappings (among other things).
|
||||
|
||||
<a name="faqconfig"></a>
|
||||
|
||||
__4.14. My favourite checker needs to load a configuration file from the
|
||||
project's root rather than the current directory...__
|
||||
|
||||
A. You can set up an `autocmd` to search for the configuration file in the
|
||||
current directory and upwards, and add it to the checker's options when found.
|
||||
For example for `jscs`:
|
||||
|
||||
```vim
|
||||
function! FindConfig(prefix, what, where)
|
||||
let cfg = findfile(a:what, escape(a:where, ' ') . ';')
|
||||
return cfg !=# '' ? ' ' . a:prefix . ' ' . cfg : ''
|
||||
endfunction
|
||||
|
||||
autocmd FileType javascript let b:syntastic_javascript_jscs_args =
|
||||
\ get(g:, 'syntastic_javascript_jscs_args', '') .
|
||||
\ FindConfig('-c', '.jscsrc', expand('<amatch>:p:h', 1))
|
||||
```
|
||||
<a name="faqbdelete"></a>
|
||||
|
||||
__4.15. 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 <silent> <C-d> :lclose<CR>:bdelete<CR>
|
||||
cabbrev <silent> bd <C-r>=(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd')<CR>
|
||||
```
|
||||
|
||||
<a name="otherresources"></a>
|
||||
|
||||
## 5\. Resources
|
||||
|
@ -483,15 +502,16 @@ plugins that provide more functionality than syntastic. You might want to take
|
|||
a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [vim-go][vimgo], or
|
||||
[YouCompleteMe][ycm].
|
||||
|
||||
[screenshot]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png
|
||||
[scrooloose]: https://github.com/scrooloose
|
||||
[screenshot]: https://github.com/vim-syntastic/syntastic/raw/master/_assets/screenshot_1.png
|
||||
|
||||
[bug_tracker]: https://github.com/scrooloose/syntastic/issues
|
||||
[checkers]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic-checkers.txt
|
||||
[bug_tracker]: https://github.com/vim-syntastic/syntastic/issues
|
||||
[checkers]: https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt
|
||||
[crystal]: https://github.com/rhysd/vim-crystal
|
||||
[eastwood]: https://github.com/venantius/vim-eastwood
|
||||
[ghcmod]: https://github.com/eagletmt/ghcmod-vim
|
||||
[google_group]: https://groups.google.com/group/vim-syntastic
|
||||
[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[guide]: https://github.com/vim-syntastic/syntastic/wiki/Syntax-Checker-Guide
|
||||
[jedi]: https://github.com/davidhalter/jedi-vim
|
||||
[merlin]: https://github.com/the-lambda-church/merlin
|
||||
[myint]: https://github.com/myint/syntastic-extras
|
||||
|
@ -508,8 +528,7 @@ a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [v
|
|||
[rvm]: https://rvm.io/
|
||||
[stack_overflow]: http://stackoverflow.com/questions/tagged/syntastic
|
||||
[swift]: https://github.com/kballard/vim-swift
|
||||
[tidy]: http://www.htacg.org/tidy-html5/
|
||||
[tidy_old]: http://tidy.sourceforge.net/
|
||||
[tsuquyomi]: https://github.com/Quramy/tsuquyomi/
|
||||
[unimpaired]: https://github.com/tpope/vim-unimpaired
|
||||
[vam]: https://github.com/MarcWeber/vim-addon-manager
|
||||
[vim]: http://www.vim.org/
|
||||
|
|
|
@ -21,7 +21,7 @@ function! syntastic#log#warn(msg) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! syntastic#log#error(msg) abort " {{{2
|
||||
execute "normal \<Esc>"
|
||||
execute 'normal! \<Esc>'
|
||||
echohl ErrorMsg
|
||||
echomsg 'syntastic: error: ' . a:msg
|
||||
echohl None
|
||||
|
@ -68,7 +68,7 @@ function! syntastic#log#debug(level, msg, ...) abort " {{{2
|
|||
let leader = s:_log_timestamp()
|
||||
call s:_logRedirect(1)
|
||||
|
||||
if a:0 > 0
|
||||
if a:0
|
||||
" filter out dictionary functions
|
||||
echomsg leader . a:msg . ' ' .
|
||||
\ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?
|
||||
|
|
|
@ -89,11 +89,11 @@ function! syntastic#preprocess#dockerfile_lint(errors) abort " {{{2
|
|||
call add(out, msg)
|
||||
endfor
|
||||
catch /\m^Vim\%((\a\+)\)\=:E716/
|
||||
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
|
||||
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format (crashed checker?)')
|
||||
let out = []
|
||||
endtry
|
||||
else
|
||||
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
|
||||
call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
@ -132,18 +132,18 @@ function! syntastic#preprocess#flow(errors) abort " {{{2
|
|||
|
||||
call add(out, msg)
|
||||
catch /\m^Vim\%((\a\+)\)\=:E716/
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format (crashed checker?)')
|
||||
let out = []
|
||||
break
|
||||
endtry
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format (crashed checker?)')
|
||||
let out = []
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/flow: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
|
||||
return out
|
||||
|
@ -178,11 +178,11 @@ function! syntastic#preprocess#jscs(errors) abort " {{{2
|
|||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/jscs: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/jscs: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
@ -238,7 +238,7 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2
|
|||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker python/prospector: unrecognized error format')
|
||||
call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -311,11 +311,11 @@ function! syntastic#preprocess#scss_lint(errors) abort " {{{2
|
|||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
|
||||
call syntastic#log#warn('checker scss/scss_lint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
@ -351,7 +351,7 @@ function! syntastic#preprocess#stylelint(errors) abort " {{{2
|
|||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker css/stylelint: unrecognized error format')
|
||||
call syntastic#log#warn('checker css/stylelint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
endif
|
||||
return out
|
||||
|
@ -398,7 +398,7 @@ echomsg string(json)
|
|||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/tern_lint: unrecognized error format')
|
||||
call syntastic#log#warn('checker javascript/tern_lint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
|
||||
echomsg string(out)
|
||||
|
@ -453,7 +453,7 @@ function! syntastic#preprocess#vint(errors) abort " {{{2
|
|||
endif
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker vim/vint: unrecognized error format')
|
||||
call syntastic#log#warn('checker vim/vint: unrecognized error format (crashed checker?)')
|
||||
endif
|
||||
|
||||
return out
|
||||
|
|
|
@ -37,8 +37,24 @@ function! syntastic#util#system(command) abort " {{{2
|
|||
let $LC_MESSAGES = 'C'
|
||||
let $LC_ALL = ''
|
||||
|
||||
let crashed = 0
|
||||
let cmd_start = reltime()
|
||||
let out = system(a:command)
|
||||
try
|
||||
let out = system(a:command)
|
||||
catch
|
||||
let crashed = 1
|
||||
call syntastic#log#error('exception running system(' . string(a:command) . '): ' . v:exception)
|
||||
if syntastic#util#isRunningWindows()
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TMP = ' . string($TMP) . ', $TEMP = ' . string($TEMP))
|
||||
else
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TERM = ' . string($TERM))
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TMPDIR = ' . string($TMPDIR))
|
||||
endif
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, '$PATH = ' . string($PATH))
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . string(getcwd()))
|
||||
call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, g:_SYNTASTIC_SHELL_OPTIONS)
|
||||
let out = ''
|
||||
endtry
|
||||
let cmd_time = split(reltimestr(reltime(cmd_start)))[0]
|
||||
|
||||
let $LC_ALL = old_lc_all
|
||||
|
@ -46,7 +62,7 @@ function! syntastic#util#system(command) abort " {{{2
|
|||
|
||||
let &shell = old_shell
|
||||
|
||||
if exists('g:_SYNTASTIC_DEBUG_TRACE')
|
||||
if !crashed && exists('g:_SYNTASTIC_DEBUG_TRACE')
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'system: command run in ' . cmd_time . 's')
|
||||
endif
|
||||
|
||||
|
@ -102,6 +118,10 @@ function! syntastic#util#rmrf(what) abort " {{{2
|
|||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#util#getbufvar(buf, name, ...) abort " {{{2
|
||||
return a:0 ? s:_getbufvar(a:buf, a:name, a:1) : getbufvar(a:buf, a:name)
|
||||
endfunction " }}}2
|
||||
|
||||
" Search the first 5 lines of the file for a magic number and return a map
|
||||
" containing the args and the executable
|
||||
"
|
||||
|
@ -126,9 +146,19 @@ function! syntastic#util#parseShebang() abort " {{{2
|
|||
return { 'exe': '', 'args': [] }
|
||||
endfunction " }}}2
|
||||
|
||||
" Get the value of a Vim variable. Allow buffer variables to override global ones.
|
||||
function! syntastic#util#bufRawVar(buf, name, ...) abort " {{{2
|
||||
return s:_getbufvar(a:buf, a:name, get(g:, a:name, a:0 ? a:1 : ''))
|
||||
endfunction "}}}2
|
||||
|
||||
" Get the value of a syntastic variable. Allow buffer variables to override global ones.
|
||||
function! syntastic#util#bufVar(buf, name, ...) abort " {{{2
|
||||
return call('syntastic#util#bufRawVar', [a:buf, 'syntastic_' . a:name] + a:000)
|
||||
endfunction "}}}2
|
||||
|
||||
" Get the value of a Vim variable. Allow local variables to override global ones.
|
||||
function! syntastic#util#rawVar(name, ...) abort " {{{2
|
||||
return get(b:, a:name, get(g:, a:name, a:0 > 0 ? a:1 : ''))
|
||||
return get(b:, a:name, get(g:, a:name, a:0 ? a:1 : ''))
|
||||
endfunction " }}}2
|
||||
|
||||
" Get the value of a syntastic variable. Allow local variables to override global ones.
|
||||
|
@ -165,11 +195,6 @@ function! syntastic#util#compareLexi(a, b) abort " {{{2
|
|||
return 0
|
||||
endfunction " }}}2
|
||||
|
||||
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
|
||||
" and hope for the best :)
|
||||
let s:_width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
|
||||
lockvar s:_width
|
||||
|
||||
function! syntastic#util#screenWidth(str, tabstop) abort " {{{2
|
||||
let chunks = split(a:str, "\t", 1)
|
||||
let width = s:_width(chunks[-1])
|
||||
|
@ -271,6 +296,36 @@ function! syntastic#util#findGlobInParent(what, where) abort " {{{2
|
|||
return ''
|
||||
endfunction " }}}2
|
||||
|
||||
" Returns the buffer number of a filename
|
||||
" @vimlint(EVL104, 1, l:old_shellslash)
|
||||
function! syntastic#util#fname2buf(fname) abort " {{{2
|
||||
if exists('+shellslash')
|
||||
" bufnr() can't cope with backslashes
|
||||
let old_shellslash = &shellslash
|
||||
let &shellslash = 1
|
||||
endif
|
||||
|
||||
" this is a best-effort attempt to escape file patterns (cf. :h file-pattern)
|
||||
" XXX it fails for filenames containing something like \{2,3}
|
||||
for md in [':~:.', ':~', ':p']
|
||||
let buf = bufnr('^' . escape(fnamemodify(a:fname, md), '\*?,{}[') . '$')
|
||||
if buf != -1
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if buf == -1
|
||||
" XXX definitely wrong, but hope is the last thing to die :)
|
||||
let buf = bufnr(fnamemodify(a:fname, ':p'))
|
||||
endif
|
||||
|
||||
if exists('+shellslash')
|
||||
let &shellslash = old_shellslash
|
||||
endif
|
||||
|
||||
return buf
|
||||
endfunction " }}}2
|
||||
" @vimlint(EVL104, 0, l:old_shellslash)
|
||||
|
||||
" Returns unique elements in a list
|
||||
function! syntastic#util#unique(list) abort " {{{2
|
||||
let seen = {}
|
||||
|
@ -342,10 +397,8 @@ function! syntastic#util#stamp() abort " {{{2
|
|||
return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' )
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#util#setChangedtick() abort " {{{2
|
||||
unlockvar! b:syntastic_changedtick
|
||||
let b:syntastic_changedtick = b:changedtick
|
||||
lockvar! b:syntastic_changedtick
|
||||
function! syntastic#util#setLastTick(buf) abort " {{{2
|
||||
call setbufvar(a:buf, 'syntastic_lasttick', getbufvar(a:buf, 'changedtick'))
|
||||
endfunction " }}}2
|
||||
|
||||
let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
|
||||
|
@ -363,9 +416,6 @@ function! syntastic#util#setWids() abort " {{{2
|
|||
endfor
|
||||
endfunction " }}}2
|
||||
|
||||
let s:_str2float = function(exists('*str2float') ? 'str2float' : 'str2nr')
|
||||
lockvar s:_str2float
|
||||
|
||||
function! syntastic#util#str2float(val) abort " {{{2
|
||||
return s:_str2float(a:val)
|
||||
endfunction " }}}2
|
||||
|
@ -487,6 +537,11 @@ function! s:_translateElement(key, term) abort " {{{2
|
|||
return ret
|
||||
endfunction " }}}2
|
||||
|
||||
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
|
||||
" and hope for the best :)
|
||||
let s:_width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
|
||||
lockvar s:_width
|
||||
|
||||
" @vimlint(EVL103, 1, a:flags)
|
||||
function! s:_delete_dumb(what, flags) abort " {{{2
|
||||
if !exists('s:rmrf')
|
||||
|
@ -533,6 +588,9 @@ function! s:_rmrf(what) abort " {{{2
|
|||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
let s:_str2float = function(exists('*str2float') ? 'str2float' : 'str2nr')
|
||||
lockvar s:_str2float
|
||||
|
||||
function! s:_float2str_smart(val) abort " {{{2
|
||||
return printf('%.1f', a:val)
|
||||
endfunction " }}}2
|
||||
|
@ -544,6 +602,18 @@ endfunction " }}}2
|
|||
let s:_float2str = function(has('float') ? 's:_float2str_smart' : 's:_float2str_dumb')
|
||||
lockvar s:_float2str
|
||||
|
||||
function! s:_getbufvar_dumb(buf, name, ...) abort " {{{2
|
||||
let ret = getbufvar(a:buf, a:name)
|
||||
if a:0 && type(ret) == type('') && ret ==# ''
|
||||
unlet! ret
|
||||
let ret = a:1
|
||||
endif
|
||||
return ret
|
||||
endfunction "}}}2
|
||||
|
||||
let s:_getbufvar = function(v:version > 703 || (v:version == 703 && has('patch831')) ? 'getbufvar' : 's:_getbufvar_dumb')
|
||||
lockvar s:_getbufvar
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
|
|
@ -6,6 +6,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
|
|||
|
||||
|syntastic| comes with checkers for the following languages:
|
||||
|
||||
ACPI Source Language.....................|syntastic-checkers-asl|
|
||||
ActionScript.............................|syntastic-checkers-actionscript|
|
||||
Ada......................................|syntastic-checkers-ada|
|
||||
Ansible..................................|syntastic-checkers-ansible|
|
||||
|
@ -100,6 +101,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
|
|||
Sh.......................................|syntastic-checkers-sh|
|
||||
Slim.....................................|syntastic-checkers-slim|
|
||||
SML......................................|syntastic-checkers-sml|
|
||||
Solidity.................................|syntastic-checkers-solidity|
|
||||
SQL......................................|syntastic-checkers-sql|
|
||||
Stylus...................................|syntastic-checkers-stylus|
|
||||
|
||||
|
@ -115,6 +117,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
|
|||
Vala.....................................|syntastic-checkers-vala|
|
||||
Verilog..................................|syntastic-checkers-verilog|
|
||||
VHDL.....................................|syntastic-checkers-vhdl|
|
||||
Vim help.................................|syntastic-checkers-help|
|
||||
VimL.....................................|syntastic-checkers-vim|
|
||||
|
||||
xHTML....................................|syntastic-checkers-xhtml|
|
||||
|
@ -132,6 +135,37 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
|
|||
|
||||
Third-party checkers are available for additional languages.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR ACPI SOURCE LANGUAGE *syntastic-checkers-asl*
|
||||
|
||||
The following checkers are available for the ACPI Source Language (filetype
|
||||
"asl"):
|
||||
|
||||
1. iasl.....................|syntastic-asl-iasl|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. iasl *syntastic-asl-iasl*
|
||||
|
||||
Name: iasl
|
||||
Maintainer: Peter Wu <peter@lekensteyn.nl>
|
||||
|
||||
"iasl" is a compiler/decompiler for ACPI Source Language (ASL) and ACPI
|
||||
Machine Language (AML). See the project's page for details:
|
||||
|
||||
https://acpica.org/
|
||||
|
||||
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 ASL files, such as
|
||||
"vim-acpi-asl":
|
||||
|
||||
https://github.com/martinlroth/vim-acpi-asl
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR ACTIONSCRIPT *syntastic-checkers-actionscript*
|
||||
|
||||
|
@ -320,6 +354,7 @@ SYNTAX CHECKERS FOR ASCIIDOC *syntastic-checkers-asciidoc*
|
|||
The following checkers are available for AsciiDoc (filetype "asciidoc"):
|
||||
|
||||
1. Asciidoc.................|syntastic-asciidoc-asciidoc|
|
||||
2. proselint................|syntastic-asciidoc-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. Asciidoc *syntastic-asciidoc-asciidoc*
|
||||
|
@ -341,10 +376,31 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. proselint *syntastic-asciidoc-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-help-proselint|, |syntastic-html-proselint|,
|
||||
|syntastic-markdown-proselint|, |syntastic-nroff-proselint|,
|
||||
|syntastic-pod-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR ASSEMBLY LANGUAGES *syntastic-checkers-asm*
|
||||
|
||||
The following checkers are available for asembly languages (filetype "asm"):
|
||||
The following checkers are available for assembly languages (filetype "asm"):
|
||||
|
||||
1. GCC......................|syntastic-asm-gcc|
|
||||
|
||||
|
@ -432,7 +488,7 @@ The following checkers are available for BEMHTML (filetype "bemhtml"):
|
|||
Name: bemhtmllint
|
||||
Maintainer: Sergej Tatarincev
|
||||
|
||||
BEMHTML is a template engine intended for using with BEM methodology
|
||||
BEMHTML is a template engine intended for using with the BEM methodology
|
||||
(http://bem.info/method/). See the project's page at GitHub for details:
|
||||
|
||||
https://github.com/SevInf/bemhtml-lint
|
||||
|
@ -492,9 +548,9 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
Aditionally:
|
||||
Additionally:
|
||||
|
||||
*g:syntastic_avrgcc_config_file*
|
||||
*'g:syntastic_avrgcc_config_file'*
|
||||
Type: string
|
||||
Default: ".syntastic_avrgcc_config"
|
||||
File containing compilation flags (such as defines or include directories),
|
||||
|
@ -895,17 +951,39 @@ SYNTAX CHECKERS FOR C++ *syntastic-checkers-cpp*
|
|||
|
||||
The following checkers are available for C++ (filetype "cpp"):
|
||||
|
||||
1. ClangCheck...............|syntastic-cpp-clang_check|
|
||||
2. Clang-Tidy...............|syntastic-cpp-clang_tidy|
|
||||
3. Cppcheck.................|syntastic-cpp-cppcheck|
|
||||
4. Cpplint..................|syntastic-cpp-cpplint|
|
||||
5. GCC......................|syntastic-cpp-gcc|
|
||||
6. OClint...................|syntastic-cpp-oclint|
|
||||
7. PC-Lint..................|syntastic-cpp-pc_lint|
|
||||
8. Vera++...................|syntastic-cpp-verapp|
|
||||
1. AVR-GCC..................|syntastic-cpp-avrgcc|
|
||||
2. ClangCheck...............|syntastic-cpp-clang_check|
|
||||
3. Clang-Tidy...............|syntastic-cpp-clang_tidy|
|
||||
4. Cppcheck.................|syntastic-cpp-cppcheck|
|
||||
5. Cpplint..................|syntastic-cpp-cpplint|
|
||||
6. GCC......................|syntastic-cpp-gcc|
|
||||
7. OClint...................|syntastic-cpp-oclint|
|
||||
8. PC-Lint..................|syntastic-cpp-pc_lint|
|
||||
9. Vera++...................|syntastic-cpp-verapp|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. ClangCheck *syntastic-cpp-clang_check*
|
||||
1. AVR-GCC *syntastic-cpp-avrgcc*
|
||||
|
||||
Name: avrgcc
|
||||
Maintainer: Sławek Piotrowski <sentinel@atteo.com>
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
Additionally:
|
||||
|
||||
'g:syntastic_avrgcc_config_file'
|
||||
Type: string
|
||||
Default: ".syntastic_avrgcc_config"
|
||||
File containing compilation flags (such as defines or include directories),
|
||||
one option per line (cf. |syntastic-config-files|).
|
||||
|
||||
See also: |syntastic-c-avrgcc|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. ClangCheck *syntastic-cpp-clang_check*
|
||||
|
||||
Name: clang_check
|
||||
Maintainer: Benjamin Bannier <bbannier@gmail.com>
|
||||
|
@ -948,7 +1026,7 @@ then ignored.
|
|||
See also: |syntastic-c-clang_check|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. Clang-Tidy *syntastic-cpp-clang_tidy*
|
||||
3. Clang-Tidy *syntastic-cpp-clang_tidy*
|
||||
|
||||
Name: clang_tidy
|
||||
Maintainer: Benjamin Bannier <bbannier@gmail.com>
|
||||
|
@ -999,7 +1077,7 @@ then ignored.
|
|||
See also: |syntastic-c-clang_tidy|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. Cppcheck *syntastic-cpp-cppcheck*
|
||||
4. Cppcheck *syntastic-cpp-cppcheck*
|
||||
|
||||
Name: cppcheck
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -1025,7 +1103,7 @@ one option per line (cf. |syntastic-config-files|).
|
|||
See also: |syntastic-c-cppcheck|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
4. Cpplint *syntastic-cpp-cpplint*
|
||||
5. Cpplint *syntastic-cpp-cpplint*
|
||||
|
||||
Name: cpplint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -1061,7 +1139,7 @@ However, if your "cpplint" was installed with "pip", the script's name is
|
|||
let g:syntastic_cpp_cpplint_exec = "cpplint"
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
5. GCC *syntastic-cpp-gcc*
|
||||
6. GCC *syntastic-cpp-gcc*
|
||||
|
||||
Name: gcc
|
||||
Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
|
||||
|
@ -1158,7 +1236,7 @@ executable.
|
|||
See also: |syntastic-c-gcc|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6. OClint *syntastic-cpp-oclint*
|
||||
7. OClint *syntastic-cpp-oclint*
|
||||
|
||||
Name: oclint
|
||||
Maintainer: "UnCO" Lin <undercooled@lavabit.com>
|
||||
|
@ -1198,7 +1276,7 @@ Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored.
|
|||
See also: |syntastic-c-oclint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7. PC-Lint *syntastic-cpp-pc_lint*
|
||||
8. PC-Lint *syntastic-cpp-pc_lint*
|
||||
|
||||
Name: pc_lint
|
||||
Maintainer: Steve Bragg <steve@empresseffects.com>
|
||||
|
@ -1225,7 +1303,7 @@ current directory and in parent directories; first such file found is used.
|
|||
See also: |syntastic-c-pc_lint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
8. Vera++ *syntastic-cpp-verapp*
|
||||
9. Vera++ *syntastic-cpp-verapp*
|
||||
|
||||
Name: verapp
|
||||
Maintainer: Lucas Verney <phyks@phyks.me>
|
||||
|
@ -1450,7 +1528,7 @@ The following checkers are available for Coq (filetype "coq"):
|
|||
Name: coqtop
|
||||
Maintainer: Matvey Aksenov <matvey.aksenov@gmail.com>
|
||||
|
||||
"Coqtop" is the top level intrface for Coq. See the project's page for
|
||||
"Coqtop" is the top level interface for Coq. See the project's page for
|
||||
details:
|
||||
|
||||
http://coq.inria.fr/
|
||||
|
@ -1931,7 +2009,7 @@ Security~
|
|||
|
||||
This checker executes the code in the files it checks:
|
||||
|
||||
https://github.com/scrooloose/syntastic/issues/1141
|
||||
https://github.com/vim-syntastic/syntastic/issues/1141
|
||||
|
||||
This is probably fine if you wrote the files yourself, but it can be a problem
|
||||
if you're trying to check third party files. If you are 100% willing to let
|
||||
|
@ -1989,8 +2067,8 @@ Name: syntaxerl
|
|||
Maintainer: locojay
|
||||
|
||||
"SyntaxErl" is a syntax checker for Erlang. It uses "rebar"
|
||||
(https://github.com/basho/rebar) to determine correct deps and libs paths.
|
||||
See the project's page for more information:
|
||||
(https://github.com/basho/rebar) to determine correct dependencies and library
|
||||
paths. See the project's page for more information:
|
||||
|
||||
https://github.com/ten0s/syntaxerl
|
||||
|
||||
|
@ -2191,7 +2269,7 @@ If the magic comment does not exist, then the dictionary
|
|||
'g:syntastic_glsl_extensions' is used to infer the appropriate profile from
|
||||
the current file's extension. If this dictionary does not exist either, a
|
||||
default dictionary is used instead. Finally, if the current file's extension
|
||||
cannott be found in these dictionaries, the checker assumes a vertex shader
|
||||
cannot be found in these dictionaries, the checker assumes a vertex shader
|
||||
profile.
|
||||
|
||||
*'g:syntastic_glsl_options'*
|
||||
|
@ -2199,6 +2277,13 @@ Type: string
|
|||
Default: unset
|
||||
Additional arguments to pass to "cgc".
|
||||
|
||||
Note~
|
||||
|
||||
You probably also need a plugin to set |filetype| for OpenGL files, such as
|
||||
"vim-glsl":
|
||||
|
||||
https://github.com/tikhomirov/vim-glsl
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR GO *syntastic-checkers-go*
|
||||
|
||||
|
@ -2307,7 +2392,7 @@ Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
|
|||
|
||||
See the tool's documentation for details:
|
||||
|
||||
https://godoc.org/golang.org/x/tools/cmd/vet
|
||||
https://godoc.org/cmd/vet
|
||||
|
||||
Note~
|
||||
|
||||
|
@ -2531,10 +2616,12 @@ The following checkers are available for HTML (filetype "html"):
|
|||
1. ESLint...................|syntastic-html-eslint|
|
||||
2. gjslint..................|syntastic-html-gjslint|
|
||||
3. HTML tidy................|syntastic-html-tidy|
|
||||
4. JSHint...................|syntastic-html-jshint|
|
||||
5. textlint.................|syntastic-html-textlint|
|
||||
6. Validator................|syntastic-html-validator|
|
||||
7. W3.......................|syntastic-html-w3|
|
||||
4. HTMLHint.................|syntastic-html-htmlhint|
|
||||
5. JSHint...................|syntastic-html-jshint|
|
||||
6. proselint................|syntastic-html-proselint|
|
||||
7. textlint.................|syntastic-html-textlint|
|
||||
8. Validator................|syntastic-html-validator|
|
||||
9. W3.......................|syntastic-html-w3|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. ESLint *syntastic-html-eslint*
|
||||
|
@ -2624,7 +2711,25 @@ List of additional empty tags, to be added to "--new-empty-tags".
|
|||
See also: |syntastic-xhtml-tidy|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
4. jshint *syntastic-html-jshint*
|
||||
4. HTMLHint *syntastic-html-htmlhint*
|
||||
|
||||
Name: HTMLHint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"JSHint" is a static code analysis tool for HTML. See the project's page for
|
||||
details:
|
||||
|
||||
http://htmlhint.com/
|
||||
|
||||
Syntastic requires "HTMLHint" version 0.9.13 or later.
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5. jshint *syntastic-html-jshint*
|
||||
|
||||
Name: JSHint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -2670,7 +2775,28 @@ in "JSHint". If that is undesirable, your only other option is to leave
|
|||
See also: |syntastic-javascript-jshint|, |syntastic-xhtml-jshint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5. textlint *syntastic-html-textlint*
|
||||
6. proselint *syntastic-html-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-markdown-proselint|, |syntastic-nroff-proselint|,
|
||||
|syntastic-pod-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7. textlint *syntastic-html-textlint*
|
||||
|
||||
Name: textlint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -2695,7 +2821,7 @@ work:
|
|||
See also: |syntastic-markdown-textlint|, |syntastic-text-textlint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6. Validator *syntastic-html-validator*
|
||||
8. Validator *syntastic-html-validator*
|
||||
|
||||
Name: validator
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -2768,7 +2894,7 @@ You can lookup the meaning of these codes in cURL's manual:
|
|||
http://curl.haxx.se/docs/manpage.html#EXIT
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7. W3 *syntastic-html-w3*
|
||||
9. W3 *syntastic-html-w3*
|
||||
|
||||
Name: w3
|
||||
Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
|
||||
|
@ -2879,7 +3005,7 @@ point |'g:syntastic_java_checkstyle_classpath'| to it:
|
|||
http://iweb.dl.sourceforge.net/project/checkstyle/checkstyle/
|
||||
http://checkstyle.sourceforge.net/cmdline.html#Usage_by_Classpath_update
|
||||
|
||||
Current builds at Maven Central do not package "checkstyles" with its
|
||||
Current builds at Maven Central do not package "checkstyle" with its
|
||||
dependencies:
|
||||
|
||||
http://search.maven.org/#search|gav|1|g%3A%22com.puppycrawl.tools%22%20AND%20a%3A%22checkstyle%22
|
||||
|
@ -2894,6 +3020,14 @@ Name: javac
|
|||
Maintainers: Jochen Keil <jochen.keil@gmail.com>
|
||||
Dmitry Geurkov <d.geurkov@gmail.com>
|
||||
|
||||
Note~
|
||||
|
||||
This checker is not suitable for use with large Java projects. The design
|
||||
of "javac" makes this checker prone to running into various limitations of
|
||||
your shell, Vim, and your Java compiler. You are strongly advised to use
|
||||
something like Eclim (http://eclim.org/) instead of syntastic for projects of
|
||||
any substantial size or complexity.
|
||||
|
||||
Commands~
|
||||
|
||||
The following commands are available:
|
||||
|
@ -3092,13 +3226,13 @@ accepts the standard options described at |syntastic-config-makeprg|.
|
|||
|
||||
Notes~
|
||||
|
||||
Syntastic requires "Flow" version 0.6 or later.
|
||||
Syntastic requires "Flow" version 0.18.1 or later.
|
||||
|
||||
To use "Flow" with your projects, you must:
|
||||
|
||||
a. Install it:
|
||||
|
||||
https://github.com/sindresorhus/flow-bin
|
||||
https://github.com/flowtype/flow-bin
|
||||
|
||||
b. Configure your project:
|
||||
>
|
||||
|
@ -3629,7 +3763,8 @@ SYNTAX CHECKERS FOR MARKDOWN *syntastic-checkers-markdown*
|
|||
The following checkers are available for Markdown (filetype "markdown"):
|
||||
|
||||
1. Markdown lint tool.......|syntastic-markdown-mdl|
|
||||
2. textlint.................|syntastic-markdown-textlint|
|
||||
2. proselint................|syntastic-markdown-proselint|
|
||||
3. textlint.................|syntastic-markdown-textlint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. Markdown lint tool *syntastic-markdown-mdl*
|
||||
|
@ -3666,7 +3801,28 @@ to a set of valid "markdownlint-cli" options): >
|
|||
let g:syntastic_markdown_mdl_args = ""
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
2. textlint *syntastic-markdown-textlint*
|
||||
2. proselint *syntastic-markdown-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-nroff-proselint|,
|
||||
|syntastic-pod-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. textlint *syntastic-markdown-textlint*
|
||||
|
||||
Name: textlint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -3781,6 +3937,7 @@ The following checkers are available for nroff (filetype "nroff"):
|
|||
|
||||
1. Igor.....................|syntastic-nroff-igor|
|
||||
2. mandoc...................|syntastic-nroff-mandoc|
|
||||
3. proselint................|syntastic-nroff-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. Igor *syntastic-nroff-igor*
|
||||
|
@ -3820,6 +3977,27 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. proselint *syntastic-nroff-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-pod-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR OBJECTIVE-C *syntastic-checkers-objc*
|
||||
|
||||
|
@ -4307,6 +4485,7 @@ SYNTAX CHECKERS FOR POD *syntastic-checkers-pod*
|
|||
The following checkers are available for POD (filetype "pod"):
|
||||
|
||||
1. Pod::Checker.............|syntastic-pod-podchecker|
|
||||
2. proselint................|syntastic-pod-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. Pod::Checker *syntastic-pod-podchecker*
|
||||
|
@ -4326,6 +4505,27 @@ accepts the standard options described at |syntastic-config-makeprg|.
|
|||
|
||||
See also: |syntastic-perl-podchecker|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. proselint *syntastic-pod-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR PUG (FORMERLY JADE) *syntastic-checkers-pug*
|
||||
|
||||
|
@ -4637,7 +4837,7 @@ Please note that transforming a file like this affects line numbers and
|
|||
column numbers, and syntastic has no way to make the necessary adjustments.
|
||||
Consequently, errors might appear on surprising lines if you enable this
|
||||
feature and the transformed file has code on different lines than the raw
|
||||
file. For this reason the use of these transformations should be limitted
|
||||
file. For this reason the use of these transformations should be limited
|
||||
to codecs that preserve line numbers, such as the "spec" codec provided by
|
||||
"NoseOfYeti":
|
||||
|
||||
|
@ -4741,7 +4941,7 @@ setting of "lint.style".
|
|||
Name: lintr
|
||||
Maintainer: Jim Hester <james.f.hester@gmail.com>
|
||||
|
||||
"lintr" is a static code analysys tool for R files. See the project's page at
|
||||
"lintr" is a static code analysis tool for R files. See the project's page at
|
||||
GitHub for details:
|
||||
|
||||
https://github.com/jimhester/lintr
|
||||
|
@ -4794,7 +4994,7 @@ This is a checker for R files, using the R package "svTools":
|
|||
http://cran.r-project.org/web/packages/svTools/
|
||||
|
||||
In turn, this package delegates most of the work to the "checkUsage()"
|
||||
function in the codetools package:
|
||||
function in the "codetools" package:
|
||||
|
||||
http://cran.r-project.org/web/packages/codetools/
|
||||
|
||||
|
@ -4851,7 +5051,7 @@ The following checkers are available for R Markdown (filetype "rmd"):
|
|||
Name: lintr
|
||||
Maintainer: Jim Hester <james.f.hester@gmail.com>
|
||||
|
||||
"lintr" is a static code analysys tool for R files. See the project's page at
|
||||
"lintr" is a static code analysis tool for R files. See the project's page at
|
||||
GitHub for details:
|
||||
|
||||
https://github.com/jimhester/lintr
|
||||
|
@ -4930,7 +5130,7 @@ Security~
|
|||
|
||||
This checker executes the code in the files it checks:
|
||||
|
||||
https://github.com/scrooloose/syntastic/issues/1773
|
||||
https://github.com/vim-syntastic/syntastic/issues/1773
|
||||
|
||||
This is probably fine if you wrote the files yourself, but it can be a problem
|
||||
if you're trying to check third party files. If you are 100% willing to let
|
||||
|
@ -4979,12 +5179,34 @@ SYNTAX CHECKERS FOR RESTRUCTUREDTEXT *syntastic-checkers-rst*
|
|||
|
||||
The following checkers are available for reStructuredText (filetype "rst"):
|
||||
|
||||
1. rst2pseudoxml............|syntastic-rst-rst2pseudoxml|
|
||||
2. rstcheck.................|syntastic-rst-rstcheck|
|
||||
3. Sphinx...................|syntastic-rst-sphinx|
|
||||
1. proselint................|syntastic-rst-proselint|
|
||||
2. rst2pseudoxml............|syntastic-rst-rst2pseudoxml|
|
||||
3. rstcheck.................|syntastic-rst-rstcheck|
|
||||
4. Sphinx...................|syntastic-rst-sphinx|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. rst2pseudoxml *syntastic-rst-rst2pseudoxml*
|
||||
1. proselint *syntastic-rst-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-pod-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. rst2pseudoxml *syntastic-rst-rst2pseudoxml*
|
||||
|
||||
Name: rst2pseudoxml
|
||||
Maintainer: James Rowe <jnrowe@gmail.com>
|
||||
|
@ -5002,7 +5224,7 @@ This checker is initialised using the "makeprgBuild()" function and thus it
|
|||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. rstcheck *syntastic-rst-rstcheck*
|
||||
3. rstcheck *syntastic-rst-rstcheck*
|
||||
|
||||
Name: rstcheck
|
||||
Maintainer: Steven Myint <git@stevenmyint.com>
|
||||
|
@ -5018,7 +5240,7 @@ This checker is initialised using the "makeprgBuild()" function and thus it
|
|||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. Sphinx *syntastic-rst-sphinx*
|
||||
4. Sphinx *syntastic-rst-sphinx*
|
||||
|
||||
Name: sphinx
|
||||
Maintainer: Buck Evan <buck@yelp.com>
|
||||
|
@ -5060,7 +5282,7 @@ directory, or if you want to override the autodetected paths, options
|
|||
|'g:syntastic_rst_sphinx_source_dir'| and |'g:syntastic_rst_sphinx_config_dir'|
|
||||
take precedence over the detected values.
|
||||
|
||||
Please not also that the checker creates output files in a temporary directory
|
||||
Please note also that the checker creates output files in a temporary directory
|
||||
that is created upon the first run in the current session, and is removed when
|
||||
Vim exits. If you need to change the location of this directory you can do
|
||||
so by exporting the environment variables "TMPDIR" or "TMP" (on UNIX and Mac
|
||||
|
@ -5081,7 +5303,7 @@ The following checkers are available for Linux RPM packages (filetype "spec"):
|
|||
Name: rpmlint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"rpmlint" is a trool for checking Linux RPM packages. See the project's page
|
||||
"rpmlint" is a tool for checking Linux RPM packages. See the project's page
|
||||
for details:
|
||||
|
||||
http://sourceforge.net/projects/rpmlint/
|
||||
|
@ -5165,7 +5387,7 @@ Name: macruby
|
|||
Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
|
||||
|
||||
"MacRuby" is an implementation of Ruby for Mac OS X. See the project's
|
||||
pagefor details:
|
||||
page for details:
|
||||
|
||||
http://www.macruby.org/
|
||||
|
||||
|
@ -5725,6 +5947,37 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR SOLIDITY *syntastic-checkers-solidity*
|
||||
|
||||
The following checkers are available for Solidity (filetype "solidity"):
|
||||
|
||||
1. solc.....................|syntastic-solidity-solc|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. solc *syntastic-solidity-solc*
|
||||
|
||||
Name: solc
|
||||
Maintainer: Jacob Cholewa <jacob@cholewa.dk>
|
||||
|
||||
"solc" is a compiler for Ethereum's smart-contract language "Solidity"
|
||||
(https://solidity.readthedocs.io/). See the project's page for details:
|
||||
|
||||
https://github.com/ethereum/solidity
|
||||
|
||||
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 Solidity files, such as
|
||||
"vim-solidity":
|
||||
|
||||
https://github.com/tomlion/vim-solidity
|
||||
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR SQL *syntastic-checkers-sql*
|
||||
|
||||
|
@ -5764,7 +6017,7 @@ Maintainer: LCD 47 <lcd047@gmail.com>
|
|||
"Stylint" is a linter for Stylus (http://learnboost.github.io/stylus). See
|
||||
the project's page at GitHub for details:
|
||||
|
||||
https://github.com/rossPatton/stylint
|
||||
https://github.com/SimenB/stylint
|
||||
|
||||
Checker options~
|
||||
|
||||
|
@ -5806,6 +6059,7 @@ The following checkers are available for TeX (filetype "tex"):
|
|||
|
||||
1. ChkTeX...................|syntastic-tex-chktex|
|
||||
2. lacheck..................|syntastic-tex-lacheck|
|
||||
3. proselint................|syntastic-tex-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. ChkTeX *syntastic-tex-chktex*
|
||||
|
@ -5851,12 +6105,34 @@ Limitations~
|
|||
At the time of this writing "lacheck" can't expand "\def" commands. As a
|
||||
result, most "\input" commands using macros are signaled as errors.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. proselint *syntastic-tex-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-pod-proselint|,
|
||||
|syntastic-rst-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR TEXINFO *syntastic-checkers-texinfo*
|
||||
|
||||
The following checkers are available for Texinfo (filetype "texinfo"):
|
||||
|
||||
1. Makeinfo.................|syntastic-texinfo-makeinfo|
|
||||
2. proselint................|syntastic-texinfo-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. Makeinfo *syntastic-texinfo-makeinfo*
|
||||
|
@ -5864,7 +6140,7 @@ The following checkers are available for Texinfo (filetype "texinfo"):
|
|||
Name: makeinfo
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"Makeinfo" is a convertor for Texinfo files. It is distributed together with
|
||||
"Makeinfo" is a converter for Texinfo files. It is distributed together with
|
||||
the GNU package "texinfo":
|
||||
|
||||
http://www.gnu.org/software/texinfo/
|
||||
|
@ -5874,6 +6150,27 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. proselint *syntastic-texinfo-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-pod-proselint|,
|
||||
|syntastic-rst-proselint|, |syntastic-tex-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR TEXT *syntastic-checkers-text*
|
||||
|
||||
|
@ -5882,7 +6179,8 @@ The following checkers are available for plain text (filetype "text"):
|
|||
1. atdtool..................|syntastic-text-atdtool|
|
||||
2. Igor.....................|syntastic-text-igor|
|
||||
3. language-check...........|syntastic-text-language_check|
|
||||
4. textlint.................|syntastic-text-textlint|
|
||||
4. proselint................|syntastic-text-proselint|
|
||||
5. textlint.................|syntastic-text-textlint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. atdtool *syntastic-text-atdtool*
|
||||
|
@ -5945,7 +6243,28 @@ This checker is initialised using the "makeprgBuild()" function and thus it
|
|||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
4. textlint *syntastic-text-textlint*
|
||||
4. proselint *syntastic-text-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-pod-proselint|,
|
||||
|syntastic-rst-proselint|, |syntastic-tex-proselint|,
|
||||
|syntastic-texinfo-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5. textlint *syntastic-text-textlint*
|
||||
|
||||
Name: textlint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
@ -6087,8 +6406,7 @@ SYNTAX CHECKERS FOR TYPESCRIPT *syntastic-checkers-typescript*
|
|||
The following checkers are available for TypeScript (filetype "typescript"):
|
||||
|
||||
1. ESLint...................|syntastic-typescript-eslint|
|
||||
2. tsc......................|syntastic-typescript-tsc|
|
||||
3. TSLint...................|syntastic-typescript-tslint|
|
||||
2. TSLint...................|syntastic-typescript-tslint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. ESLint *syntastic-typescript-eslint*
|
||||
|
@ -6098,7 +6416,7 @@ Maintainer: LCD 47 <lcd047@gmail.com>
|
|||
|
||||
"ESLint" is a tool for identifying and reporting on patterns found
|
||||
in ECMAScript/JavaScript code. With the "babel-eslint" plugin
|
||||
(https://github.com/babel/babel-eslint) "ESLint" can also can also be
|
||||
(https://github.com/babel/babel-eslint) "ESLint" can also be
|
||||
used to check TypeScript files. See the project's page for details:
|
||||
|
||||
https://github.com/nzakas/eslint
|
||||
|
@ -6118,29 +6436,7 @@ as "typescript-vim":
|
|||
See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2. tsc *syntastic-typescript-tsc*
|
||||
|
||||
Name: tsc
|
||||
Maintainer: Bill Casarin <bill@casarin.ca>
|
||||
|
||||
"tsc" is a compiler for TypeScript. See the project's page for details:
|
||||
|
||||
http://www.typescriptlang.org/
|
||||
|
||||
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 TypeScript files, such
|
||||
as "typescript-vim":
|
||||
|
||||
https://github.com/leafgarland/typescript-vim
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. TSLint *syntastic-typescript-tslint*
|
||||
2. TSLint *syntastic-typescript-tslint*
|
||||
|
||||
Name: tslint
|
||||
Maintainer: Seon-Wook Park <seon.wook@swook.net>
|
||||
|
@ -6331,6 +6627,34 @@ Checker options~
|
|||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR VIM HELP *syntastic-checkers-help*
|
||||
|
||||
The following checkers are available for Vim help (filetype "help"):
|
||||
|
||||
1. proselint................|syntastic-help-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. proselint *syntastic-help-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-html-proselint|,
|
||||
|syntastic-markdown-proselint|, |syntastic-nroff-proselint|,
|
||||
|syntastic-pod-proselint|, |syntastic-rst-proselint|,
|
||||
|syntastic-tex-proselint|, |syntastic-texinfo-proselint|,
|
||||
|syntastic-text-proselint|, |syntastic-xhtml-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR VIML *syntastic-checkers-vim*
|
||||
|
||||
|
@ -6416,6 +6740,7 @@ The following checkers are available for xHTML (filetype "xhtml"):
|
|||
|
||||
1. HTML Tidy................|syntastic-xhtml-tidy|
|
||||
2. jshint...................|syntastic-xhtml-jshint|
|
||||
3. proselint................|syntastic-xhtml-proselint|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1. HTML tidy *syntastic-xhtml-tidy*
|
||||
|
@ -6490,6 +6815,27 @@ in "JSHint". If that is undesirable, your only other option is to leave
|
|||
<
|
||||
See also: |syntastic-html-jshint|, |syntastic-javascript-jshint|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3. proselint *syntastic-xhtml-proselint*
|
||||
|
||||
Name: proselint
|
||||
Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
|
||||
"proselint" is a linter for prose. See the page for details:
|
||||
|
||||
http://proselint.com/
|
||||
|
||||
Checker options~
|
||||
|
||||
This checker is initialised using the "makeprgBuild()" function and thus it
|
||||
accepts the standard options described at |syntastic-config-makeprg|.
|
||||
|
||||
See also: |syntastic-asciidoc-proselint|, |syntastic-help-proselint|,
|
||||
|syntastic-html-proselint|, |syntastic-markdown-proselint|,
|
||||
|syntastic-nroff-proselint|, |syntastic-pod-proselint|,
|
||||
|syntastic-rst-proselint|, |syntastic-tex-proselint|,
|
||||
|syntastic-texinfo-proselint|, |syntastic-text-proselint|.
|
||||
|
||||
==============================================================================
|
||||
SYNTAX CHECKERS FOR XML *syntastic-checkers-xml*
|
||||
|
||||
|
@ -6861,6 +7207,7 @@ syntastic-specific configuration files:
|
|||
OpenCOBOL (|syntastic-cobol-cobc|)
|
||||
|
||||
C++~
|
||||
AVR-GCC (|syntastic-cpp-avrgcc|)
|
||||
ClangCheck (|syntastic-cpp-clang_check|)
|
||||
Clang-Tidy (|syntastic-cpp-clang_tidy|)
|
||||
Cppcheck (|syntastic-cpp-cppcheck|)
|
||||
|
|
|
@ -46,19 +46,22 @@ CONTENTS *syntastic-contents*
|
|||
6.4.Saving Vim sessions....................|syntastic-sessions|
|
||||
6.5.The location list callback.............|syntastic-loclist-callback|
|
||||
7.Compatibility with other software............|syntastic-compatibility|
|
||||
7.1.The csh and tcsh shells................|syntastic-csh|
|
||||
7.2.Eclim..................................|syntastic-eclim|
|
||||
7.3.The fish shell.........................|syntastic-fish|
|
||||
7.4.The fizsh shell........................|syntastic-fizsh|
|
||||
7.5.flagship...............................|syntastic-flagship|
|
||||
7.6.powerline..............................|syntastic-powerline|
|
||||
7.7.The PowerShell shell...................|syntastic-powershell|
|
||||
7.8.python-mode............................|syntastic-pymode|
|
||||
7.9.vim-auto-save..........................|syntastic-vim-auto-save|
|
||||
7.10.vim-go................................|syntastic-vim-go|
|
||||
7.11.vim-virtualenv........................|syntastic-vim-virtualenv|
|
||||
7.12.YouCompleteMe.........................|syntastic-ycm|
|
||||
7.13.The zsh shell and MacVim..............|syntastic-zsh|
|
||||
7.1.airline................................|syntastic-airline|
|
||||
7.2.The csh and tcsh shells................|syntastic-csh|
|
||||
7.3.EasyGrep...............................|syntastic-easygrep|
|
||||
7.4.Eclim..................................|syntastic-eclim|
|
||||
7.5.ferret.................................|syntastic-ferret|
|
||||
7.6.The fish shell.........................|syntastic-fish|
|
||||
7.7.The fizsh shell........................|syntastic-fizsh|
|
||||
7.8.flagship...............................|syntastic-flagship|
|
||||
7.9.powerline..............................|syntastic-powerline|
|
||||
7.10.The PowerShell shell..................|syntastic-powershell|
|
||||
7.11.python-mode...........................|syntastic-pymode|
|
||||
7.12.vim-auto-save.........................|syntastic-vim-auto-save|
|
||||
7.13.vim-go................................|syntastic-vim-go|
|
||||
7.14.vim-virtualenv........................|syntastic-vim-virtualenv|
|
||||
7.15.YouCompleteMe.........................|syntastic-ycm|
|
||||
7.16.The zsh shell and MacVim..............|syntastic-zsh|
|
||||
8.About........................................|syntastic-about|
|
||||
9.License......................................|syntastic-license|
|
||||
|
||||
|
@ -82,7 +85,7 @@ Take a look at the list of supported filetypes and checkers: |syntastic-checkers
|
|||
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
|
||||
https://github.com/vim-syntastic/syntastic/wiki/Syntax-Checker-Guide
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1.1. Quick start *syntastic-quickstart*
|
||||
|
@ -158,12 +161,17 @@ Something like this could be more useful: >
|
|||
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.
|
||||
is derived from the |'syntastic_stl_format'| option.
|
||||
|
||||
Please note that these settings might conflict with other Vim plugins that
|
||||
change the way statusline works. Refer to these plugins' documentation for
|
||||
possible solutions. See also |syntastic-powerline| below if you're using the
|
||||
"powerline" Vim plugin (https://github.com/powerline/powerline).
|
||||
change the way statusline works. Refer to the |syntastic-compatibility| notes
|
||||
below and to the respective plugins' documentation for possible solutions.
|
||||
|
||||
In particular see |syntastic-airline| below if you're using the "airline" Vim
|
||||
plugin (https://github.com/vim-airline/vim-airline). See |syntastic-flagship|
|
||||
if you're using "flagship" (https://github.com/tpope/vim-flagship). See also
|
||||
|syntastic-powerline| if you're using the "powerline" Vim plugin
|
||||
(https://github.com/powerline/powerline).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2.2. Error signs *syntastic-error-signs*
|
||||
|
@ -195,6 +203,10 @@ following highlight groups:
|
|||
Example: >
|
||||
highlight SyntasticErrorLine guibg=#2f0000
|
||||
<
|
||||
With Vim 8.0 or later you can ask Vim not to turn off the sign column when no
|
||||
errors are found, by setting 'signcolumn' to "yes": >
|
||||
set signcolumn=yes
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
2.3. The error window *syntastic-error-window*
|
||||
|
||||
|
@ -248,7 +260,7 @@ grouped together, and sorting within each group is decided by the variables
|
|||
|'syntastic_<filetype>_<checker>_sort'|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2.6 Filtering errors *syntastic-filtering-errors*
|
||||
2.6. Filtering errors *syntastic-filtering-errors*
|
||||
|
||||
You can selectively disable some of the errors found by checkers either
|
||||
using |'syntastic_quiet_messages'|, or by specifying a list of patterns in
|
||||
|
@ -290,12 +302,22 @@ the order specified. The set by |'syntastic_aggregate_errors'| still apply.
|
|||
Example: >
|
||||
:SyntasticCheck flake8 pylint
|
||||
<
|
||||
You can also run checkers for filetypes different from the current filetype
|
||||
by qualifying their names with their respective filetypes, like this:
|
||||
"<filetype>/<checker>".
|
||||
|
||||
Example: >
|
||||
:SyntasticCheck lacheck text/language_check
|
||||
<
|
||||
:SyntasticInfo *:SyntasticInfo*
|
||||
|
||||
The command takes an optional argument, and outputs information about the
|
||||
checkers available for the filetype named by said argument, or for the current
|
||||
filetype if no argument was provided.
|
||||
|
||||
Example: >
|
||||
:SyntasticInfo python
|
||||
<
|
||||
:SyntasticReset *:SyntasticReset*
|
||||
|
||||
Resets the list of errors and turns off all error notifiers.
|
||||
|
@ -732,7 +754,7 @@ filetypes.
|
|||
5. Checker Options *syntastic-checker-options*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.1 Choosing which checkers to use *syntastic-filetype-checkers*
|
||||
5.1. Choosing which checkers to use *syntastic-filetype-checkers*
|
||||
|
||||
*'g:syntastic_<filetype>_checkers'*
|
||||
You can tell syntastic which checkers to run for a given filetype by setting a
|
||||
|
@ -750,13 +772,17 @@ If neither |'g:syntastic_<filetype>_checkers'| nor |'b:syntastic_checkers'|
|
|||
is set, a default list of checker is used. Beware however that this list
|
||||
deliberately kept minimal, for performance reasons.
|
||||
|
||||
You can specify checkers for other filetypes anywhere in these lists, by
|
||||
qualifying their names with their respective filetypes: >
|
||||
let g:syntastic_tex_checkers = ["lacheck", "text/language_check"]
|
||||
<
|
||||
Take a look elsewhere in this manual to find out what checkers and filetypes
|
||||
are supported by syntastic: |syntastic-checkers|.
|
||||
|
||||
Use `:SyntasticInfo` to see which checkers are available for a given filetype.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.2 Choosing the executable *syntastic-config-exec*
|
||||
5.2. Choosing the executable *syntastic-config-exec*
|
||||
|
||||
*'syntastic_<filetype>_<checker>_exec'*
|
||||
The executable run by a checker is normally defined automatically, when the
|
||||
|
@ -773,7 +799,7 @@ takes precedence over both 'b:syntastic_<filetype>_<checker>_exec' and
|
|||
'g:syntastic_<filetype>_<checker>_exec' in the buffers where it is defined.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.3 Configuring specific checkers *syntastic-config-makeprg*
|
||||
5.3. Configuring specific checkers *syntastic-config-makeprg*
|
||||
|
||||
Checkers are run by constructing a command line and by passing it to a shell
|
||||
(see |'shell'| and |'syntastic_shell'|). In most cases this command line is
|
||||
|
@ -797,7 +823,7 @@ The result is a command line of the form: >
|
|||
All fields above are optional, and can be overridden by setting global
|
||||
variables 'g:syntastic_<filetype>_<checker-name>_<option-name>' - even
|
||||
parameters not specified in the call to "makeprgBuild()". For example to
|
||||
override the argguments and the tail: >
|
||||
override the arguments and the tail: >
|
||||
let g:syntastic_c_pc_lint_args = "-w5 -Iz:/usr/include/linux"
|
||||
let g:syntastic_c_pc_lint_tail = "2>/dev/null"
|
||||
<
|
||||
|
@ -843,13 +869,12 @@ omitting the filename from the command line: >
|
|||
let g:syntastic_sml_smlnj_fname = ""
|
||||
<
|
||||
*syntastic-config-no-makeprgbuild*
|
||||
For checkers that do not use the "makeprgBuild()" function you will have to
|
||||
look at the source code of the checker in question. If there are specific
|
||||
options that can be set they are normally documented in this manual (see
|
||||
For checkers that do not use the "makeprgBuild()" function any specific
|
||||
options that can be set should be documented in this manual (see
|
||||
|syntastic-checkers|).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.4 Sorting errors *syntastic-config-sort*
|
||||
5.4. Sorting errors *syntastic-config-sort*
|
||||
|
||||
*'syntastic_<filetype>_<checker>_sort'*
|
||||
Syntastic may decide to group the errors produced by some checkers by file,
|
||||
|
@ -868,7 +893,7 @@ For aggregated lists (see |syntastic-aggregating-errors|) these variables are
|
|||
ignored if |'syntastic_sort_aggregated_errors'| is set (which is the default).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.5 Filtering errors *syntastic-config-filtering*
|
||||
5.5. Filtering errors *syntastic-config-filtering*
|
||||
|
||||
*'syntastic_<filetype>_<checker>_quiet_messages'*
|
||||
Finally, variables 'g:syntastic_<filetype>_<checker-name>_quiet_messages' can
|
||||
|
@ -882,7 +907,7 @@ from the corresponding checkers are filtered. Example: >
|
|||
The syntax is of course identical to that of |syntastic_quiet_messages|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.6 Debugging *syntastic-config-debug*
|
||||
5.6. Debugging *syntastic-config-debug*
|
||||
*syntastic-debug*
|
||||
|
||||
Syntastic can log a trace of its working to Vim's |message-history|. To verify
|
||||
|
@ -902,7 +927,7 @@ Debug logs can be saved to a file; see |'syntastic_debug_file'| for details.
|
|||
Setting |'syntastic_debug'| to 0 turns off logging.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.7 Profiling *syntastic-profiling*
|
||||
5.7. Profiling *syntastic-profiling*
|
||||
|
||||
A very useful tool for debugging performance problems is Vim's built-in
|
||||
|profiler|. In order to enable profiling for syntastic you need to add two lines
|
||||
|
@ -932,7 +957,7 @@ composite filetypes to simple ones using |'syntastic_filetype_map'|, e.g.: >
|
|||
let g:syntastic_filetype_map = { "handlebars.html": "handlebars" }
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
6.2 Editing files over network *syntastic-netrw*
|
||||
6.2. Editing files over network *syntastic-netrw*
|
||||
|
||||
The standard plugin |netrw| allows Vim to transparently edit files over
|
||||
network and inside archives. Currently syntastic doesn't support this mode
|
||||
|
@ -940,7 +965,7 @@ of operation. It can only check files that can be accessed directly by local
|
|||
checkers, without any translation or conversion.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6.3 The 'shellslash' option *syntastic-shellslash*
|
||||
6.3. The 'shellslash' option *syntastic-shellslash*
|
||||
|
||||
The 'shellslash' option is relevant only on Windows systems. This option
|
||||
determines (among other things) the rules for quoting command lines, and there
|
||||
|
@ -951,7 +976,7 @@ shell. It should be turned off if your 'shell' (or |'syntastic_shell'|) is
|
|||
value.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6.4 Saving Vim sessions *syntastic-sessions*
|
||||
6.4. Saving Vim sessions *syntastic-sessions*
|
||||
|
||||
If you use `:mksession` to save Vim sessions you should probably make sure to
|
||||
remove option "blank" from 'sessionoptions': >
|
||||
|
@ -961,7 +986,7 @@ This will prevent `:mksession` from saving |syntastic-error-window| as empty
|
|||
quickfix windows.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6.5 The location list callback *syntastic-loclist-callback*
|
||||
6.5. The location list callback *syntastic-loclist-callback*
|
||||
|
||||
*SyntasticCheckHook()*
|
||||
Syntastic also gives you direct access to the list of errors. A function
|
||||
|
@ -987,7 +1012,17 @@ also affect window sizes.)
|
|||
7. Compatibility with other software *syntastic-compatibility*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.1 The csh and tcsh shells *syntastic-csh*
|
||||
7.1. airline *syntastic-airline*
|
||||
|
||||
The "airline" Vim plugin (https://github.com/vim-airline/vim-airline) comes
|
||||
packaged with a mechanism of showing flags on the |'statusline'| according
|
||||
to your |'syntastic_stl_format'|. When using this plugin you do NOT need to
|
||||
follow the recommendation outlined in the |syntastic-statusline-flag| section
|
||||
above to modify your |'statusline'|; "airline" will make all necessary changes
|
||||
automatically.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.2. The csh and tcsh shells *syntastic-csh*
|
||||
|
||||
The "csh" and "tcsh" shells are mostly compatible with syntastic. However,
|
||||
some checkers assume Bourne shell syntax for redirecting "stderr". For this
|
||||
|
@ -996,7 +1031,16 @@ such as "zsh", "bash", "ksh", or even the original Bourne "sh": >
|
|||
let g:syntastic_shell = "/bin/sh"
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.2. Eclim *syntastic-eclim*
|
||||
7.3. EasyGrep *syntastic-easygrep*
|
||||
|
||||
The "EasyGrep" Vim plugin (https://github.com/dkprice/vim-easygrep) can use
|
||||
either |quickfix| lists, or location lists (see |location-list|). Syntastic can
|
||||
be run along with "EasyGrep" provided that the latter is configured to use
|
||||
|quickfix| lists (which is the default at the time of this writing): >
|
||||
let g:EasyGrepWindow = 0
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.4. Eclim *syntastic-eclim*
|
||||
|
||||
Syntastic can be used together with "Eclim" (see http://eclim.org/). However,
|
||||
by default Eclim disables syntastic's checks for the filetypes it supports, in
|
||||
|
@ -1009,7 +1053,15 @@ run Eclim's validation for others. Please consult Eclim's documentation for
|
|||
details.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.3 The fish shell *syntastic-fish*
|
||||
7.5. ferret *syntastic-ferret*
|
||||
|
||||
At the time of this writing syntastic conflicts with the "ferret" Vim plugin
|
||||
(https://github.com/wincent/ferret). The "ferret" plugin assumes control over
|
||||
loclist windows even when configured to use |quickfix| lists. This interferes
|
||||
with syntastic's functioning.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.6. The fish shell *syntastic-fish*
|
||||
|
||||
At the time of this writing the "fish" shell (see http://fishshell.com/)
|
||||
doesn't support the standard UNIX syntax for file redirections, and thus it
|
||||
|
@ -1019,7 +1071,7 @@ original Bourne "sh": >
|
|||
let g:syntastic_shell = "/bin/sh"
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.4. The fizsh shell *syntastic-fizsh*
|
||||
7.7. The fizsh shell *syntastic-fizsh*
|
||||
|
||||
Using syntastic with the "fizsh" shell (see https://github.com/zsh-users/fizsh)
|
||||
is possible, but potentially problematic. In order to do it you'll need to set
|
||||
|
@ -1032,7 +1084,7 @@ interactive features of "fizsh". Using a more traditional shell such as "zsh",
|
|||
let g:syntastic_shell = "/bin/sh"
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.5 flagship *syntastic-flagship*
|
||||
7.8. flagship *syntastic-flagship*
|
||||
|
||||
The "flagship" Vim plugin (https://github.com/tpope/vim-flagship) has its
|
||||
own mechanism of showing flags on the |'statusline'|. To allow "flagship"
|
||||
|
@ -1042,7 +1094,7 @@ described in the |syntastic-statusline-flag| section above: >
|
|||
autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag")
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.6. powerline *syntastic-powerline*
|
||||
7.9. powerline *syntastic-powerline*
|
||||
|
||||
The "powerline" Vim plugin (https://github.com/powerline/powerline) comes
|
||||
packaged with a syntastic segment. To customize this segment create a file
|
||||
|
@ -1059,16 +1111,18 @@ packaged with a syntastic segment. To customize this segment create a file
|
|||
}
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.7. The PowerShell shell *syntastic-powershell*
|
||||
7.10. The PowerShell shell *syntastic-powershell*
|
||||
|
||||
At the time of this writing, syntastic is not compatible with using "Windows
|
||||
PowerShell" (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
|
||||
'shell'. You may still run Vim from 'PowerShell', but you do have to point
|
||||
Vim's 'shell' to a more traditional program, such as "cmd.exe": >
|
||||
set shell=cmd.exe
|
||||
At the time of this writing syntastic is not compatible with using
|
||||
"PowerShell" (https://msdn.microsoft.com/en-us/powershell) as Vim's 'shell'.
|
||||
You may still run Vim from "PowerShell", but you do have to point Vim's
|
||||
'shell' to a more traditional program, such as "cmd.exe" on Windows, or
|
||||
"/bin/sh" on UNIX: >
|
||||
set shell=c:\Windows\system32\cmd.exe
|
||||
set shell=/bin/sh
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.8 python-mode *syntastic-pymode*
|
||||
7.11. python-mode *syntastic-pymode*
|
||||
|
||||
Syntastic can be used along with the "python-mode" Vim plugin (see
|
||||
https://github.com/klen/python-mode). However, they both run syntax checks by
|
||||
|
@ -1079,14 +1133,14 @@ for python in syntastic (see |'syntastic_mode_map'|), or disable lint checks in
|
|||
let g:pymode_lint_on_write = 0
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.9. vim-auto-save *syntastic-vim-auto-save*
|
||||
7.12. vim-auto-save *syntastic-vim-auto-save*
|
||||
|
||||
Syntastic can be used together with the "vim-auto-save" Vim plugin (see
|
||||
https://github.com/907th/vim-auto-save). However, syntastic checks in active
|
||||
mode only work with "vim-auto-save" version 0.1.7 or later.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.10. vim-go *syntastic-vim-go*
|
||||
7.13. vim-go *syntastic-vim-go*
|
||||
|
||||
Syntastic can be used along with the "vim-go" Vim plugin (see
|
||||
https://github.com/fatih/vim-go). However, both "vim-go" and syntastic run
|
||||
|
@ -1103,7 +1157,7 @@ stick with |quickfix| lists: >
|
|||
let g:go_list_type = "quickfix"
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.11. vim-virtualenv *syntastic-vim-virtualenv*
|
||||
7.14. vim-virtualenv *syntastic-vim-virtualenv*
|
||||
|
||||
At the time of this writing, syntastic can't run checkers installed
|
||||
in Python virtual environments activated by "vim-virtualenv" (see
|
||||
|
@ -1111,7 +1165,7 @@ https://github.com/jmcantrell/vim-virtualenv). This is a limitation of
|
|||
"vim-virtualenv".
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
7.12 YouCompleteMe *syntastic-ycm*
|
||||
7.15. YouCompleteMe *syntastic-ycm*
|
||||
|
||||
Syntastic can be used together with the "YouCompleteMe" Vim plugin (see
|
||||
http://valloric.github.io/YouCompleteMe/). However, by default "YouCompleteMe"
|
||||
|
@ -1122,7 +1176,7 @@ have to set |g:ycm_show_diagnostics_ui| to 0. E.g.: >
|
|||
let g:ycm_show_diagnostics_ui = 0
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
7.13 The zsh shell and MacVim *syntastic-zsh*
|
||||
7.16. The zsh shell and MacVim *syntastic-zsh*
|
||||
|
||||
If you're running MacVim together with the "zsh" shell (http://www.zsh.org/)
|
||||
you need to be aware that MacVim does not source your .zshrc file, but will
|
||||
|
@ -1142,7 +1196,7 @@ The core maintainers of syntastic are:
|
|||
|
||||
Find the latest version of syntastic at:
|
||||
|
||||
http://github.com/scrooloose/syntastic
|
||||
http://github.com/vim-syntastic/syntastic
|
||||
|
||||
==============================================================================
|
||||
9. License *syntastic-license*
|
||||
|
|
|
@ -19,7 +19,7 @@ if has('reltime')
|
|||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-162'
|
||||
let g:_SYNTASTIC_VERSION = '3.8.0-10'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -57,7 +57,7 @@ elseif executable('uname')
|
|||
try
|
||||
let g:_SYNTASTIC_UNAME = split(syntastic#util#system('uname'), "\n")[0]
|
||||
catch /\m^Vim\%((\a\+)\)\=:E484/
|
||||
call syntastic#log#error("your shell " . syntastic#util#var('shell') . " can't handle traditional UNIX syntax for redirections")
|
||||
call syntastic#log#error("can't run external programs (misconfigured shell options?)")
|
||||
finish
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
let g:_SYNTASTIC_UNAME = 'Unknown'
|
||||
|
@ -126,20 +126,26 @@ endif
|
|||
|
||||
" Debug {{{1
|
||||
|
||||
let s:_DEBUG_DUMP_OPTIONS = [
|
||||
let g:_SYNTASTIC_SHELL_OPTIONS = [
|
||||
\ 'shell',
|
||||
\ 'shellcmdflag',
|
||||
\ 'shellpipe',
|
||||
\ 'shellquote',
|
||||
\ 'shellredir',
|
||||
\ 'shellslash',
|
||||
\ 'shelltemp',
|
||||
\ 'shellxquote'
|
||||
\ ]
|
||||
if exists('+shellxescape')
|
||||
call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape')
|
||||
endif
|
||||
lockvar! s:_DEBUG_DUMP_OPTIONS
|
||||
for s:feature in [
|
||||
\ 'autochdir',
|
||||
\ 'shellslash',
|
||||
\ 'shellxescape',
|
||||
\ ]
|
||||
|
||||
if exists('+' . s:feature)
|
||||
call add(g:_SYNTASTIC_SHELL_OPTIONS, s:feature)
|
||||
endif
|
||||
endfor
|
||||
lockvar! g:_SYNTASTIC_SHELL_OPTIONS
|
||||
|
||||
" debug constants
|
||||
let g:_SYNTASTIC_DEBUG_TRACE = 1
|
||||
|
@ -163,6 +169,7 @@ let s:registry = g:SyntasticRegistry.Instance()
|
|||
let s:notifiers = g:SyntasticNotifiers.Instance()
|
||||
let s:modemap = g:SyntasticModeMap.Instance()
|
||||
|
||||
let s:_check_stack = []
|
||||
let s:_quit_pre = []
|
||||
|
||||
" Commands {{{1
|
||||
|
@ -171,11 +178,20 @@ let s:_quit_pre = []
|
|||
" @vimlint(EVL103, 1, a:cmdLine)
|
||||
" @vimlint(EVL103, 1, a:argLead)
|
||||
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) abort " {{{2
|
||||
let checker_names = []
|
||||
for ft in s:_resolve_filetypes([])
|
||||
call extend(checker_names, s:registry.getNamesOfAvailableCheckers(ft))
|
||||
endfor
|
||||
return join(checker_names, "\n")
|
||||
let names = []
|
||||
|
||||
let sep_idx = stridx(a:argLead, '/')
|
||||
if sep_idx >= 1
|
||||
let ft = a:argLead[: sep_idx-1]
|
||||
call extend(names, map( s:registry.getNamesOfAvailableCheckers(ft), 'ft . "/" . v:val' ))
|
||||
else
|
||||
for ft in s:registry.resolveFiletypes(&filetype)
|
||||
call extend(names, s:registry.getNamesOfAvailableCheckers(ft))
|
||||
endfor
|
||||
call extend(names, map( copy(s:registry.getKnownFiletypes()), 'v:val . "/"' ))
|
||||
endif
|
||||
|
||||
return join(names, "\n")
|
||||
endfunction " }}}2
|
||||
" @vimlint(EVL103, 0, a:cursorPos)
|
||||
" @vimlint(EVL103, 0, a:cmdLine)
|
||||
|
@ -207,14 +223,16 @@ command! SyntasticJavacEditConfig runtime! syntax_checkers/java/*.vim | Synta
|
|||
" Public API {{{1
|
||||
|
||||
function! SyntasticCheck(...) abort " {{{2
|
||||
call s:UpdateErrors(0, a:000)
|
||||
call s:UpdateErrors(bufnr(''), 0, a:000)
|
||||
call syntastic#util#redraw(g:syntastic_full_redraws)
|
||||
endfunction " }}}2
|
||||
|
||||
function! SyntasticInfo(...) abort " {{{2
|
||||
call s:modemap.modeInfo(a:000)
|
||||
call s:registry.echoInfoFor(s:_resolve_filetypes(a:000))
|
||||
call s:registry.echoInfoFor(a:000)
|
||||
call s:_explain_skip(a:000)
|
||||
call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, g:_SYNTASTIC_SHELL_OPTIONS)
|
||||
call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES)
|
||||
endfunction " }}}2
|
||||
|
||||
function! SyntasticErrors() abort " {{{2
|
||||
|
@ -222,19 +240,19 @@ function! SyntasticErrors() abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! SyntasticReset() abort " {{{2
|
||||
call s:ClearCache()
|
||||
call s:ClearCache(bufnr(''))
|
||||
call s:notifiers.refresh(g:SyntasticLoclist.New([]))
|
||||
endfunction " }}}2
|
||||
|
||||
function! SyntasticToggleMode() abort " {{{2
|
||||
call s:modemap.toggleMode()
|
||||
call s:ClearCache()
|
||||
call s:ClearCache(bufnr(''))
|
||||
call s:notifiers.refresh(g:SyntasticLoclist.New([]))
|
||||
call s:modemap.echoMode()
|
||||
endfunction " }}}2
|
||||
|
||||
function! SyntasticSetLoclist() abort " {{{2
|
||||
call g:SyntasticLoclist.current().setloclist()
|
||||
call g:SyntasticLoclist.current().setloclist(0)
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
@ -243,54 +261,68 @@ endfunction " }}}2
|
|||
|
||||
augroup syntastic
|
||||
autocmd!
|
||||
autocmd BufEnter * call s:BufEnterHook()
|
||||
autocmd VimEnter * call s:VimEnterHook()
|
||||
autocmd BufEnter * call s:BufEnterHook(expand('<afile>', 1))
|
||||
autocmd BufWinEnter * call s:BufWinEnterHook(expand('<afile>', 1))
|
||||
augroup END
|
||||
|
||||
if g:syntastic_nested_autocommands
|
||||
augroup syntastic
|
||||
autocmd BufReadPost * nested call s:BufReadPostHook()
|
||||
autocmd BufWritePost * nested call s:BufWritePostHook()
|
||||
autocmd BufReadPost * nested call s:BufReadPostHook(expand('<afile>', 1))
|
||||
autocmd BufWritePost * nested call s:BufWritePostHook(expand('<afile>', 1))
|
||||
augroup END
|
||||
else
|
||||
augroup syntastic
|
||||
autocmd BufReadPost * call s:BufReadPostHook()
|
||||
autocmd BufWritePost * call s:BufWritePostHook()
|
||||
autocmd BufReadPost * call s:BufReadPostHook(expand('<afile>', 1))
|
||||
autocmd BufWritePost * call s:BufWritePostHook(expand('<afile>', 1))
|
||||
augroup END
|
||||
endif
|
||||
|
||||
if exists('##QuitPre')
|
||||
" QuitPre was added in Vim 7.3.544
|
||||
augroup syntastic
|
||||
autocmd QuitPre * call s:QuitPreHook(expand('<amatch>', 1))
|
||||
autocmd QuitPre * call s:QuitPreHook(expand('<afile>', 1))
|
||||
augroup END
|
||||
endif
|
||||
|
||||
function! s:BufReadPostHook() abort " {{{2
|
||||
if g:syntastic_check_on_open
|
||||
function! s:BufReadPostHook(fname) abort " {{{2
|
||||
let buf = syntastic#util#fname2buf(a:fname)
|
||||
if g:syntastic_check_on_open && buf > 0
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
|
||||
\ 'autocmd: BufReadPost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))))
|
||||
call s:UpdateErrors(1, [])
|
||||
\ 'autocmd: BufReadPost, buffer ' . buf . ' = ' . string(a:fname))
|
||||
if index(s:_check_stack, buf) == -1
|
||||
call add(s:_check_stack, buf)
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:BufWritePostHook() abort " {{{2
|
||||
function! s:BufWritePostHook(fname) abort " {{{2
|
||||
let buf = syntastic#util#fname2buf(a:fname)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
|
||||
\ 'autocmd: BufWritePost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))))
|
||||
call s:UpdateErrors(1, [])
|
||||
\ 'autocmd: BufWritePost, buffer ' . buf . ' = ' . string(a:fname))
|
||||
call s:UpdateErrors(buf, 1, [])
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:BufEnterHook() abort " {{{2
|
||||
function! s:BufEnterHook(fname) abort " {{{2
|
||||
let buf = syntastic#util#fname2buf(a:fname)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
|
||||
\ 'autocmd: BufEnter, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))) .
|
||||
\ ', &buftype = ' . string(&buftype))
|
||||
if &buftype ==# ''
|
||||
call s:notifiers.refresh(g:SyntasticLoclist.current())
|
||||
\ 'autocmd: BufEnter, buffer ' . buf . ' = ' . string(a:fname) . ', &buftype = ' . string(&buftype))
|
||||
if buf > 0 && getbufvar(buf, '&buftype') ==# ''
|
||||
let idx = index(reverse(copy(s:_check_stack)), buf)
|
||||
if idx >= 0
|
||||
if !has('vim_starting')
|
||||
call remove(s:_check_stack, -idx - 1)
|
||||
call s:UpdateErrors(buf, 1, [])
|
||||
endif
|
||||
elseif &buftype ==# ''
|
||||
call s:notifiers.refresh(g:SyntasticLoclist.current())
|
||||
endif
|
||||
elseif &buftype ==# 'quickfix'
|
||||
" TODO: this is needed because in recent versions of Vim lclose
|
||||
" can no longer be called from BufWinLeave
|
||||
" TODO: at this point there is no b:syntastic_loclist
|
||||
let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1')
|
||||
let owner = str2nr(getbufvar(bufnr(''), 'syntastic_owner_buffer'))
|
||||
let loclist = filter(copy(getloclist(0)), 'v:val["valid"]')
|
||||
let owner = str2nr(getbufvar(buf, 'syntastic_owner_buffer'))
|
||||
let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : []))
|
||||
if !empty(get(w:, 'syntastic_loclist_set', [])) && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
|
||||
call SyntasticLoclistHide()
|
||||
|
@ -298,8 +330,39 @@ function! s:BufEnterHook() abort " {{{2
|
|||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:BufWinEnterHook(fname) abort " {{{2
|
||||
let buf = syntastic#util#fname2buf(a:fname)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
|
||||
\ 'autocmd: BufWinEnter, buffer ' . buf . ' = ' . string(a:fname) . ', &buftype = ' . string(&buftype))
|
||||
if buf > 0 && getbufvar(buf, '&buftype') ==# ''
|
||||
let idx = index(reverse(copy(s:_check_stack)), buf)
|
||||
if idx >= 0 && !has('vim_starting')
|
||||
call remove(s:_check_stack, -idx - 1)
|
||||
call s:UpdateErrors(buf, 1, [])
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:VimEnterHook() abort " {{{2
|
||||
let g:syntastic_version =
|
||||
\ g:_SYNTASTIC_VERSION .
|
||||
\ ' (Vim ' . v:version . (has('nvim') ? ', Neovim' : '') . ', ' .
|
||||
\ g:_SYNTASTIC_UNAME .
|
||||
\ (has('gui') ? ', GUI' : '') . ')'
|
||||
lockvar g:syntastic_version
|
||||
|
||||
let buf = bufnr('')
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
|
||||
\ 'autocmd: VimEnter, buffer ' . buf . ' = ' . string(bufname(buf)) . ', &buftype = ' . string(&buftype))
|
||||
let idx = index(reverse(copy(s:_check_stack)), buf)
|
||||
if idx >= 0 && getbufvar(buf, '&buftype') ==# ''
|
||||
call remove(s:_check_stack, -idx - 1)
|
||||
call s:UpdateErrors(buf, 1, [])
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:QuitPreHook(fname) abort " {{{2
|
||||
let buf = bufnr(fnameescape(a:fname))
|
||||
let buf = syntastic#util#fname2buf(a:fname)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, 'autocmd: QuitPre, buffer ' . buf . ' = ' . string(a:fname))
|
||||
|
||||
if !syntastic#util#var('check_on_wq')
|
||||
|
@ -317,30 +380,28 @@ endfunction " }}}2
|
|||
" Main {{{1
|
||||
|
||||
"refresh and redraw all the error info for this buf when saving or reading
|
||||
function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2
|
||||
function! s:UpdateErrors(buf, auto_invoked, checker_names) abort " {{{2
|
||||
call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'version')
|
||||
call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, s:_DEBUG_DUMP_OPTIONS)
|
||||
call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, g:_SYNTASTIC_SHELL_OPTIONS)
|
||||
call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') .
|
||||
\ ': ' . (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
|
||||
|
||||
call s:modemap.synch()
|
||||
|
||||
if s:_skip_file()
|
||||
if s:_skip_file(a:buf)
|
||||
return
|
||||
endif
|
||||
|
||||
let run_checks = !a:auto_invoked || s:modemap.doAutoChecking()
|
||||
let run_checks = !a:auto_invoked || s:modemap.doAutoChecking(a:buf)
|
||||
if run_checks
|
||||
call s:CacheErrors(a:checker_names)
|
||||
call syntastic#util#setChangedtick()
|
||||
else
|
||||
if a:auto_invoked
|
||||
return
|
||||
endif
|
||||
call s:CacheErrors(a:buf, a:checker_names)
|
||||
call syntastic#util#setLastTick(a:buf)
|
||||
elseif a:auto_invoked
|
||||
return
|
||||
endif
|
||||
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
let loclist = g:SyntasticLoclist.current(a:buf)
|
||||
|
||||
if exists('*SyntasticCheckHook')
|
||||
call SyntasticCheckHook(loclist.getRaw())
|
||||
|
@ -356,14 +417,8 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2
|
|||
let do_jump = 0
|
||||
endif
|
||||
|
||||
let w:syntastic_loclist_set = []
|
||||
if syntastic#util#var('always_populate_loc_list') || do_jump
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist (new)')
|
||||
call setloclist(0, loclist.getRaw())
|
||||
if !exists('b:syntastic_changedtick')
|
||||
call syntastic#util#setChangedtick()
|
||||
endif
|
||||
let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick]
|
||||
call loclist.setloclist(1)
|
||||
if run_checks && do_jump && !loclist.isEmpty()
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: jump')
|
||||
execute 'silent! lrewind ' . do_jump
|
||||
|
@ -383,39 +438,44 @@ function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
"clear the loc list for the buffer
|
||||
function! s:ClearCache() abort " {{{2
|
||||
call s:notifiers.reset(g:SyntasticLoclist.current())
|
||||
call b:syntastic_loclist.destroy()
|
||||
function! s:ClearCache(buf) abort " {{{2
|
||||
let loclist = g:SyntasticLoclist.current(a:buf)
|
||||
call s:notifiers.reset(loclist)
|
||||
call loclist.destroy()
|
||||
endfunction " }}}2
|
||||
|
||||
"detect and cache all syntax errors in this buffer
|
||||
function! s:CacheErrors(checker_names) abort " {{{2
|
||||
function! s:CacheErrors(buf, checker_names) abort " {{{2
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: ' .
|
||||
\ (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
|
||||
call s:ClearCache()
|
||||
call s:ClearCache(a:buf)
|
||||
let newLoclist = g:SyntasticLoclist.New([])
|
||||
call newLoclist.setOwner(a:buf)
|
||||
|
||||
if !s:_skip_file()
|
||||
if !s:_skip_file(a:buf)
|
||||
" debug logging {{{3
|
||||
call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'aggregate_errors')
|
||||
if syntastic#util#isRunningWindows()
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TMP = ' . string($TMP) . ', $TEMP = ' . string($TEMP))
|
||||
else
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TERM = ' . string($TERM))
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$TMPDIR = ' . string($TMPDIR))
|
||||
endif
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$PATH = ' . string($PATH))
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . string(getcwd()))
|
||||
" }}}3
|
||||
|
||||
let filetypes = s:_resolve_filetypes([])
|
||||
let aggregate_errors = syntastic#util#var('aggregate_errors') || len(filetypes) > 1
|
||||
let clist = s:registry.getCheckers(getbufvar(a:buf, '&filetype'), a:checker_names)
|
||||
|
||||
let aggregate_errors =
|
||||
\ syntastic#util#var('aggregate_errors') || len(syntastic#util#unique(map(copy(clist), 'v:val.getFiletype()'))) > 1
|
||||
let decorate_errors = aggregate_errors && syntastic#util#var('id_checkers')
|
||||
let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
|
||||
|
||||
let clist = []
|
||||
for type in filetypes
|
||||
call extend(clist, s:registry.getCheckers(type, a:checker_names))
|
||||
endfor
|
||||
|
||||
let names = []
|
||||
let unavailable_checkers = 0
|
||||
for checker in clist
|
||||
let cname = checker.getFiletype() . '/' . checker.getName()
|
||||
let cname = checker.getCName()
|
||||
if !checker.isAvailable()
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Checker ' . cname . ' is not available')
|
||||
let unavailable_checkers += 1
|
||||
|
@ -436,7 +496,7 @@ function! s:CacheErrors(checker_names) abort " {{{2
|
|||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', loclist)
|
||||
endif
|
||||
|
||||
let newLoclist = newLoclist.extend(loclist)
|
||||
call newLoclist.extend(loclist)
|
||||
|
||||
if !aggregate_errors
|
||||
break
|
||||
|
@ -556,7 +616,7 @@ function! SyntasticMake(options) abort " {{{2
|
|||
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess:', err_lines)
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
noautocmd lgetexpr err_lines
|
||||
|
||||
let errors = deepcopy(getloclist(0))
|
||||
|
||||
|
@ -569,6 +629,12 @@ function! SyntasticMake(options) abort " {{{2
|
|||
catch /\m^Vim\%((\a\+)\)\=:E380/
|
||||
" E380: At bottom of quickfix stack
|
||||
call setloclist(0, [], 'r')
|
||||
try
|
||||
" Vim 7.4.2200 or later
|
||||
call setloclist(0, [], 'r', { 'title': '' })
|
||||
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
|
||||
" do nothing
|
||||
endtry
|
||||
catch /\m^Vim\%((\a\+)\)\=:E776/
|
||||
" E776: No location list
|
||||
" do nothing
|
||||
|
@ -630,11 +696,6 @@ endfunction " }}}2
|
|||
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:_resolve_filetypes(filetypes) abort " {{{2
|
||||
let type = len(a:filetypes) ? a:filetypes[0] : &filetype
|
||||
return split( get(g:syntastic_filetype_map, type, type), '\m\.' )
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:_ignore_file(filename) abort " {{{2
|
||||
let fname = fnamemodify(a:filename, ':p')
|
||||
for pattern in g:syntastic_ignore_files
|
||||
|
@ -660,10 +721,10 @@ function! s:_is_quitting(buf) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
" Skip running in special buffers
|
||||
function! s:_skip_file() abort " {{{2
|
||||
let fname = expand('%', 1)
|
||||
let skip = s:_is_quitting(bufnr('%')) || get(b:, 'syntastic_skip_checks', 0) ||
|
||||
\ (&buftype !=# '') || !filereadable(fname) || getwinvar(0, '&diff') ||
|
||||
function! s:_skip_file(buf) abort " {{{2
|
||||
let fname = bufname(a:buf)
|
||||
let skip = s:_is_quitting(a:buf) || getbufvar(a:buf, 'syntastic_skip_checks') ||
|
||||
\ (getbufvar(a:buf, '&buftype') !=# '') || !filereadable(fname) || getwinvar(0, '&diff') ||
|
||||
\ getwinvar(0, '&previewwindow') || s:_ignore_file(fname) ||
|
||||
\ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
|
||||
if skip
|
||||
|
@ -674,17 +735,19 @@ endfunction " }}}2
|
|||
|
||||
" Explain why checks will be skipped for the current file
|
||||
function! s:_explain_skip(filetypes) abort " {{{2
|
||||
if empty(a:filetypes) && s:_skip_file()
|
||||
let buf = bufnr('')
|
||||
if empty(a:filetypes) && s:_skip_file(buf)
|
||||
let why = []
|
||||
let fname = expand('%', 1)
|
||||
let fname = bufname(buf)
|
||||
let bt = getbufvar(buf, '&buftype')
|
||||
|
||||
if s:_is_quitting(bufnr('%'))
|
||||
if s:_is_quitting(buf)
|
||||
call add(why, 'quitting buffer')
|
||||
endif
|
||||
if get(b:, 'syntastic_skip_checks', 0)
|
||||
if getbufvar(buf, 'syntastic_skip_checks')
|
||||
call add(why, 'b:syntastic_skip_checks set')
|
||||
endif
|
||||
if &buftype !=# ''
|
||||
if bt !=# ''
|
||||
call add(why, 'buftype = ' . string(&buftype))
|
||||
endif
|
||||
if !filereadable(fname)
|
||||
|
|
|
@ -25,10 +25,27 @@ function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2
|
|||
call a:loclist.show()
|
||||
endif
|
||||
else
|
||||
if auto_loc_list == 1 || auto_loc_list == 2
|
||||
"TODO: this will close the loc list window if one was opened by
|
||||
"something other than syntastic
|
||||
lclose
|
||||
if (auto_loc_list == 1 || auto_loc_list == 2) && !empty(get(w:, 'syntastic_loclist_set', []))
|
||||
try
|
||||
" Vim 7.4.2200 or later
|
||||
let title = get(getloclist(0, { 'title': 1 }), 'title', ':SyntasticCheck ')
|
||||
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
|
||||
let title = ':SyntasticCheck '
|
||||
endtry
|
||||
|
||||
if strpart(title, 0, 16) ==# ':SyntasticCheck '
|
||||
" TODO: this will close the loc list window if one was opened
|
||||
" by something other than syntastic
|
||||
call SyntasticLoclistHide()
|
||||
|
||||
try
|
||||
" Vim 7.4.2200 or later
|
||||
call setloclist(0, [], 'r', { 'title': '' })
|
||||
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
|
||||
" do nothing
|
||||
endtry
|
||||
let w:syntastic_loclist_set = []
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
|
|
@ -15,7 +15,7 @@ function! g:SyntasticChecker.New(args, ...) abort " {{{2
|
|||
|
||||
if a:0
|
||||
" redirected checker
|
||||
let newObj._exec = get(a:args, 'exec', a:1['_exec'])
|
||||
let newObj._exec_default = get(a:args, 'exec', a:1['_exec_default'])
|
||||
|
||||
let filetype = a:1['_filetype']
|
||||
let name = a:1['_name']
|
||||
|
@ -31,7 +31,10 @@ function! g:SyntasticChecker.New(args, ...) abort " {{{2
|
|||
let newObj._enable = a:1['_enable']
|
||||
endif
|
||||
else
|
||||
let newObj._exec = get(a:args, 'exec', newObj._name)
|
||||
let newObj._exec_default = get(a:args, 'exec', newObj._name)
|
||||
if newObj._exec_default ==# ''
|
||||
let newObj._exec_default = '<dummy>'
|
||||
endif
|
||||
let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
|
||||
|
||||
if has_key(a:args, 'enable')
|
||||
|
@ -62,23 +65,24 @@ function! g:SyntasticChecker.getName() abort " {{{2
|
|||
return self._name
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.getCName() abort " {{{2
|
||||
return self._filetype . '/' . self._name
|
||||
endfunction " }}}2
|
||||
|
||||
" Synchronise _exec with user's setting. Force re-validation if needed.
|
||||
"
|
||||
" XXX: This function must be called at least once before calling either
|
||||
" getExec() or getExecEscaped(). Normally isAvailable() does that for you
|
||||
" automatically, but you should keep still this in mind if you change the
|
||||
" current checker workflow.
|
||||
function! g:SyntasticChecker.syncExec() abort " {{{2
|
||||
let user_exec =
|
||||
\ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
|
||||
\ syntastic#util#var(self._filetype . '_' . self._name . '_exec'), 1 )
|
||||
|
||||
if user_exec !=# '' && user_exec !=# self._exec
|
||||
let self._exec = user_exec
|
||||
if has_key(self, '_available')
|
||||
" we have a new _exec on the block, it has to be validated
|
||||
call remove(self, '_available')
|
||||
endif
|
||||
function! g:SyntasticChecker.syncExec(...) abort " {{{2
|
||||
if a:0
|
||||
let self._exec = a:1
|
||||
else
|
||||
let suffix = self._name . '_exec'
|
||||
let self._exec = expand(
|
||||
\ syntastic#util#var(self._filetype . '_' . suffix,
|
||||
\ syntastic#util#var(suffix, self._exec_default)), 1 )
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
|
@ -92,7 +96,7 @@ endfunction " }}}2
|
|||
|
||||
function! g:SyntasticChecker.getLocListRaw() abort " {{{2
|
||||
let checker_start = reltime()
|
||||
let name = self._filetype . '/' . self._name
|
||||
let name = self.getCName()
|
||||
|
||||
if has_key(self, '_enable')
|
||||
let status = syntastic#util#var(self._enable, -1)
|
||||
|
@ -150,7 +154,7 @@ function! g:SyntasticChecker.getVersion(...) abort " {{{2
|
|||
call self.setVersion(parsed_ver)
|
||||
else
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
|
||||
call syntastic#log#error("checker " . self._filetype . "/" . self._name . ": can't parse version string (abnormal termination?)")
|
||||
call syntastic#log#error("checker " . self.getCName() . ": can't parse version string (abnormal termination?)")
|
||||
endif
|
||||
endif
|
||||
return get(self, '_version', [])
|
||||
|
@ -164,8 +168,8 @@ function! g:SyntasticChecker.setVersion(version) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.log(msg, ...) abort " {{{2
|
||||
let leader = self._filetype . '/' . self._name . ': '
|
||||
if a:0 > 0
|
||||
let leader = self.getCName() . ': '
|
||||
if a:0
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1)
|
||||
else
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg)
|
||||
|
@ -187,10 +191,15 @@ endfunction " }}}2
|
|||
|
||||
function! g:SyntasticChecker.isAvailable() abort " {{{2
|
||||
call self.syncExec()
|
||||
|
||||
if !has_key(self, '_available')
|
||||
let self._available = self._isAvailableFunc()
|
||||
let self._available = {}
|
||||
endif
|
||||
return self._available
|
||||
if !has_key(self._available, self._exec)
|
||||
let self._available[self._exec] = self._isAvailableFunc()
|
||||
endif
|
||||
|
||||
return self._available[self._exec]
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.isDisabled() abort " {{{2
|
||||
|
|
|
@ -10,7 +10,7 @@ let g:SyntasticLoclist = {}
|
|||
function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2
|
||||
let newObj = copy(self)
|
||||
|
||||
let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
|
||||
let llist = filter(copy(a:rawLoclist), 'v:val["valid"]')
|
||||
|
||||
for e in llist
|
||||
if get(e, 'type', '') ==# ''
|
||||
|
@ -27,17 +27,18 @@ function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2
|
|||
return newObj
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticLoclist.current() abort " {{{2
|
||||
if !exists('b:syntastic_loclist') || empty(b:syntastic_loclist)
|
||||
let b:syntastic_loclist = g:SyntasticLoclist.New([])
|
||||
function! g:SyntasticLoclist.current(...) abort " {{{2
|
||||
let buf = a:0 ? a:1 : bufnr('')
|
||||
let loclist = syntastic#util#getbufvar(buf, 'syntastic_loclist', {})
|
||||
if type(loclist) != type({}) || empty(loclist)
|
||||
unlet! loclist
|
||||
let loclist = g:SyntasticLoclist.New([])
|
||||
endif
|
||||
return b:syntastic_loclist
|
||||
return loclist
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticLoclist.extend(other) abort " {{{2
|
||||
let list = self.copyRaw()
|
||||
call extend(list, a:other.copyRaw())
|
||||
return g:SyntasticLoclist.New(list)
|
||||
call extend(self._rawLoclist, a:other.copyRaw())
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticLoclist.sort() abort " {{{2
|
||||
|
@ -167,7 +168,6 @@ function! g:SyntasticLoclist.setOwner(buffer) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticLoclist.deploy() abort " {{{2
|
||||
call self.setOwner(bufnr(''))
|
||||
let self._stamp = syntastic#util#stamp()
|
||||
for buf in self.getBuffers()
|
||||
call setbufvar(buf, 'syntastic_loclist', self)
|
||||
|
@ -281,7 +281,7 @@ endfunction " }}}2
|
|||
"
|
||||
"would return all errors for buffer 10.
|
||||
"
|
||||
"Note that all comparisons are done with ==?
|
||||
"Note that all string comparisons are done with ==?
|
||||
function! g:SyntasticLoclist.filter(filters) abort " {{{2
|
||||
let conditions = values(map(copy(a:filters), 's:_translate(v:key, v:val)'))
|
||||
let filter = len(conditions) == 1 ?
|
||||
|
@ -289,23 +289,29 @@ function! g:SyntasticLoclist.filter(filters) abort " {{{2
|
|||
return filter(copy(self._rawLoclist), filter)
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticLoclist.setloclist() abort " {{{2
|
||||
function! g:SyntasticLoclist.setloclist(new) abort " {{{2
|
||||
if !exists('w:syntastic_loclist_set')
|
||||
let w:syntastic_loclist_set = []
|
||||
endif
|
||||
if empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [bufnr(''), b:changedtick]
|
||||
let replace = g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set)
|
||||
if a:new || empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [self._owner, getbufvar(self._owner, 'changedtick')]
|
||||
let replace = !a:new && g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set)
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
|
||||
call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
|
||||
call syntastic#util#setChangedtick()
|
||||
let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick]
|
||||
try
|
||||
" Vim 7.4.2200 or later
|
||||
call setloclist(0, [], 'r', { 'title': ':SyntasticCheck ' . self._name })
|
||||
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
|
||||
" do nothing
|
||||
endtry
|
||||
call syntastic#util#setLastTick(self._owner)
|
||||
let w:syntastic_loclist_set = [self._owner, getbufvar(self._owner, 'syntastic_lasttick')]
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
"display the cached errors for this buf in the location list
|
||||
function! g:SyntasticLoclist.show() abort " {{{2
|
||||
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show')
|
||||
call self.setloclist()
|
||||
call self.setloclist(0)
|
||||
|
||||
if !self.isEmpty()
|
||||
let num = winnr()
|
||||
|
|
|
@ -29,7 +29,8 @@ function! g:SyntasticModeMap.synch() abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticModeMap.allowsAutoChecking(filetype) abort " {{{2
|
||||
let fts = split(a:filetype, '\m\.')
|
||||
let registry = g:SyntasticRegistry.Instance()
|
||||
let fts = registry.resolveFiletypes(a:filetype)
|
||||
|
||||
if self.isPassive()
|
||||
return self._isOneFiletypeActive(fts)
|
||||
|
@ -38,13 +39,13 @@ function! g:SyntasticModeMap.allowsAutoChecking(filetype) abort " {{{2
|
|||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticModeMap.doAutoChecking() abort " {{{2
|
||||
let local_mode = get(b:, 'syntastic_mode', '')
|
||||
function! g:SyntasticModeMap.doAutoChecking(buf) abort " {{{2
|
||||
let local_mode = getbufvar(a:buf, 'syntastic_mode')
|
||||
if local_mode ==# 'active' || local_mode ==# 'passive'
|
||||
return local_mode ==# 'active'
|
||||
endif
|
||||
|
||||
return self.allowsAutoChecking(&filetype)
|
||||
return self.allowsAutoChecking(getbufvar(a:buf, '&filetype'))
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticModeMap.isPassive() abort " {{{2
|
||||
|
@ -72,7 +73,7 @@ function! g:SyntasticModeMap.echoMode() abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticModeMap.modeInfo(filetypes) abort " {{{2
|
||||
echomsg 'Syntastic version: ' . g:_SYNTASTIC_VERSION . ' (Vim ' . v:version . ', ' . g:_SYNTASTIC_UNAME . ')'
|
||||
echomsg 'Syntastic version: ' . g:syntastic_version
|
||||
let type = len(a:filetypes) ? a:filetypes[0] : &filetype
|
||||
echomsg 'Info for filetype: ' . type
|
||||
|
||||
|
@ -96,7 +97,7 @@ function! g:SyntasticModeMap.modeInfo(filetypes) abort " {{{2
|
|||
echomsg 'Local mode: ' . b:syntastic_mode
|
||||
endif
|
||||
|
||||
echomsg 'The current file will ' . (self.doAutoChecking() ? '' : 'not ') . 'be checked automatically'
|
||||
echomsg 'The current file will ' . (self.doAutoChecking(bufnr('')) ? '' : 'not ') . 'be checked automatically'
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ function! g:SyntasticNotifiers.Instance() abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticNotifiers.refresh(loclist) abort " {{{2
|
||||
if !a:loclist.isEmpty() && !a:loclist.isNewerThan([])
|
||||
if !syntastic#util#bufIsActive(bufnr('')) || (!a:loclist.isEmpty() && !a:loclist.isNewerThan([]))
|
||||
" loclist not fully constructed yet
|
||||
return
|
||||
endif
|
||||
|
|
|
@ -12,6 +12,7 @@ let s:_DEFAULT_CHECKERS = {
|
|||
\ 'apiblueprint': ['drafter'],
|
||||
\ 'applescript': ['osacompile'],
|
||||
\ 'asciidoc': ['asciidoc'],
|
||||
\ 'asl': ['iasl'],
|
||||
\ 'asm': ['gcc'],
|
||||
\ 'bro': ['bro'],
|
||||
\ 'bemhtml': ['bemhtmllint'],
|
||||
|
@ -42,6 +43,7 @@ let s:_DEFAULT_CHECKERS = {
|
|||
\ 'handlebars': ['handlebars'],
|
||||
\ 'haskell': ['hdevtools', 'hlint'],
|
||||
\ 'haxe': ['haxe'],
|
||||
\ 'help': [],
|
||||
\ 'hss': ['hss'],
|
||||
\ 'html': ['tidy'],
|
||||
\ 'jade': ['jade_lint'],
|
||||
|
@ -84,6 +86,7 @@ let s:_DEFAULT_CHECKERS = {
|
|||
\ 'slim': ['slimrb'],
|
||||
\ 'sml': ['smlnj'],
|
||||
\ 'spec': ['rpmlint'],
|
||||
\ 'solidity': ['solc'],
|
||||
\ 'sql': ['sqlint'],
|
||||
\ 'stylus': ['stylint'],
|
||||
\ 'tcl': ['nagelfar'],
|
||||
|
@ -93,7 +96,7 @@ let s:_DEFAULT_CHECKERS = {
|
|||
\ 'trig': ['rapper'],
|
||||
\ 'turtle': ['rapper'],
|
||||
\ 'twig': ['twiglint'],
|
||||
\ 'typescript': ['tsc'],
|
||||
\ 'typescript': [],
|
||||
\ 'vala': ['valac'],
|
||||
\ 'verilog': ['verilator'],
|
||||
\ 'vhdl': ['ghdl'],
|
||||
|
@ -186,24 +189,39 @@ endfunction " }}}2
|
|||
" not checked for availability (that is, the corresponding IsAvailable() are
|
||||
" not run).
|
||||
function! g:SyntasticRegistry.getCheckers(ftalias, hints_list) abort " {{{2
|
||||
let ft = s:_normalise_filetype(a:ftalias)
|
||||
call self._loadCheckersFor(ft, 0)
|
||||
|
||||
let checkers_map = self._checkerMap[ft]
|
||||
if empty(checkers_map)
|
||||
return []
|
||||
endif
|
||||
|
||||
call self._checkDeprecation(ft)
|
||||
let ftlist = self.resolveFiletypes(a:ftalias)
|
||||
|
||||
let names =
|
||||
\ !empty(a:hints_list) ? syntastic#util#unique(a:hints_list) :
|
||||
\ exists('b:syntastic_checkers') ? b:syntastic_checkers :
|
||||
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
|
||||
\ get(s:_DEFAULT_CHECKERS, ft, 0)
|
||||
\ !empty(a:hints_list) ? a:hints_list :
|
||||
\ exists('b:syntastic_checkers') ? b:syntastic_checkers : []
|
||||
|
||||
return type(names) == type([]) ?
|
||||
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
|
||||
let cnames = []
|
||||
if !empty(names)
|
||||
for name in names
|
||||
if name !~# '/'
|
||||
for ft in ftlist
|
||||
call add(cnames, ft . '/' . name)
|
||||
endfor
|
||||
else
|
||||
call add(cnames, name)
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
for ft in ftlist
|
||||
call self._sanityCheck(ft)
|
||||
let defs =
|
||||
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
|
||||
\ get(s:_DEFAULT_CHECKERS, ft, [])
|
||||
call extend(cnames, map(copy(defs), 'stridx(v:val, "/") < 0 ? ft . "/" . v:val : v:val' ))
|
||||
endfor
|
||||
endif
|
||||
let cnames = syntastic#util#unique(cnames)
|
||||
|
||||
for ft in syntastic#util#unique(map( copy(cnames), 'v:val[: stridx(v:val, "/")-1]' ))
|
||||
call self._loadCheckersFor(ft, 0)
|
||||
endfor
|
||||
|
||||
return self._filterCheckersByName(cnames)
|
||||
endfunction " }}}2
|
||||
|
||||
" Same as getCheckers(), but keep only the available checkers. This runs the
|
||||
|
@ -240,8 +258,12 @@ function! g:SyntasticRegistry.getNamesOfAvailableCheckers(ftalias) abort " {{{2
|
|||
return keys(filter( copy(self._checkerMap[ft]), 'v:val.isAvailable()' ))
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticRegistry.resolveFiletypes(ftalias) abort " {{{2
|
||||
return map(split( get(g:syntastic_filetype_map, a:ftalias, a:ftalias), '\m\.' ), 's:_normalise_filetype(v:val)')
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
|
||||
let ft_list = syntastic#util#unique(map( copy(a:ftalias_list), 's:_normalise_filetype(v:val)' ))
|
||||
let ft_list = syntastic#util#unique(self.resolveFiletypes(empty(a:ftalias_list) ? &filetype : a:ftalias_list[0]))
|
||||
if len(ft_list) != 1
|
||||
let available = []
|
||||
let active = []
|
||||
|
@ -255,8 +277,8 @@ function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
|
|||
else
|
||||
let ft = ft_list[0]
|
||||
let available = self.getNamesOfAvailableCheckers(ft)
|
||||
let active = map(self.getCheckersAvailable(ft, []), 'v:val.getName()')
|
||||
let disabled = map(self.getCheckersDisabled(ft, []), 'v:val.getName()')
|
||||
let active = map(self.getCheckersAvailable(ft, []), 'ft ==# v:val.getFiletype() ? v:val.getName() : v:val.getCName()')
|
||||
let disabled = map(self.getCheckersDisabled(ft, []), 'ft ==# v:val.getFiletype() ? v:val.getName() : v:val.getCName()')
|
||||
endif
|
||||
|
||||
let cnt = len(available)
|
||||
|
@ -272,7 +294,7 @@ function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
|
|||
let cnt = len(disabled)
|
||||
let plural = cnt != 1 ? 's' : ''
|
||||
if len(disabled)
|
||||
let cklist = join(sort(disabled))
|
||||
let cklist = join(sort(disabled, 's:_compare_checker_names'))
|
||||
echomsg 'Checker' . plural . ' disabled for security reasons: ' . cklist
|
||||
endif
|
||||
|
||||
|
@ -319,8 +341,20 @@ function! g:SyntasticRegistry._registerChecker(checker) abort " {{{2
|
|||
let self._checkerMap[ft][name] = a:checker
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByName(checkers_map, list) abort " {{{2
|
||||
return filter( map(copy(a:list), 'get(a:checkers_map, v:val, {})'), '!empty(v:val)' )
|
||||
function! g:SyntasticRegistry._findChecker(cname) abort " {{{2
|
||||
let sep_idx = stridx(a:cname, '/')
|
||||
if sep_idx > 0
|
||||
let ft = a:cname[: sep_idx-1]
|
||||
let name = a:cname[sep_idx+1 :]
|
||||
else
|
||||
let ft = &filetype
|
||||
let name = a:cname
|
||||
endif
|
||||
return get(self._checkerMap[ft], name, {})
|
||||
endfunction "}}}2
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByName(cnames) abort " {{{2
|
||||
return filter( map(copy(a:cnames), 'self._findChecker(v:val)'), '!empty(v:val)' )
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticRegistry._loadCheckersFor(filetype, force) abort " {{{2
|
||||
|
@ -336,8 +370,18 @@ function! g:SyntasticRegistry._loadCheckersFor(filetype, force) abort " {{{2
|
|||
endfunction " }}}2
|
||||
|
||||
" Check for obsolete variable g:syntastic_<filetype>_checker
|
||||
function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2
|
||||
if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
|
||||
function! g:SyntasticRegistry._sanityCheck(filetype) abort " {{{2
|
||||
if exists('g:syntastic_' . a:filetype . '_checkers') &&
|
||||
\ type(g:syntastic_{a:filetype}_checkers) != type([])
|
||||
|
||||
unlet! g:syntastic_{a:filetype}_checkers
|
||||
call syntastic#log#error('variable g:syntastic_' . a:filetype . '_checkers has to be a list of strings')
|
||||
endif
|
||||
|
||||
if exists('g:syntastic_' . a:filetype . '_checker') &&
|
||||
\ !exists('g:syntastic_' . a:filetype . '_checkers') &&
|
||||
\ type(g:syntastic_{a:filetype}_checker) == type('')
|
||||
|
||||
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
|
||||
call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
|
||||
endif
|
||||
|
@ -370,6 +414,26 @@ function! s:_disabled_by_ycm(filetype) abort " {{{2
|
|||
return index(s:_YCM_TYPES, a:filetype) >= 0
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:_compare_checker_names(a, b) abort " {{{2
|
||||
if a:a ==# a:b
|
||||
return 0
|
||||
endif
|
||||
|
||||
if stridx(a:a, '/') < 0
|
||||
if stridx(a:b, '/') < 0
|
||||
return a:a < a:b ? -1 : 1
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
else
|
||||
if stridx(a:b, '/') < 0
|
||||
return 1
|
||||
else
|
||||
return a:a < a:b ? -1 : 1
|
||||
endif
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_asciidoc_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_asciidoc_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'asciidoc',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
59
sources_non_forked/syntastic/syntax_checkers/asl/iasl.vim
Normal file
59
sources_non_forked/syntastic/syntax_checkers/asl/iasl.vim
Normal file
|
@ -0,0 +1,59 @@
|
|||
"============================================================================
|
||||
"File: iasl.vim
|
||||
"Description: Syntax checking plugin for syntastic using iasl
|
||||
"Maintainer: Peter Wu <peter@lekensteyn.nl>
|
||||
"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_asl_iasl_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_asl_iasl_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_asl_iasl_GetLocList() dict
|
||||
let tmpdir = syntastic#util#tmpdir() . syntastic#util#Slash()
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-vi',
|
||||
\ 'args_after': ['-p', tmpdir] })
|
||||
|
||||
let errorformat =
|
||||
\ '%f(%l) : %trror %n - %m,' .
|
||||
\ '%f(%l) : %tarning %n - %m,' .
|
||||
\ '%f(%l) : %temark %n - %m,' .
|
||||
\ '%f(%l) : %tptimize %n - %m,' .
|
||||
\ '%f(%l) : %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 255] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] =~? 'r'
|
||||
let e['type'] = 'W'
|
||||
elseif e['type'] =~? 'o'
|
||||
let e['type'] = 'W'
|
||||
let e['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
call syntastic#util#rmrf(tmpdir)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'asl',
|
||||
\ 'name': 'iasl'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -1,6 +1,6 @@
|
|||
"============================================================================
|
||||
"File: avrgcc.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: Karel <karelishere at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
|
@ -22,10 +22,12 @@ endif
|
|||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:opt_x = { 'c': 'c', 'cpp': 'c++' }
|
||||
|
||||
function! SyntaxCheckers_c_avrgcc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': syntastic#c#ReadConfig(g:syntastic_avrgcc_config_file),
|
||||
\ 'args_after': '-x c -fsyntax-only' })
|
||||
\ 'args_after': '-x ' . get(s:opt_x, self.getFiletype(), '') . ' -fsyntax-only' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
|
|
24
sources_non_forked/syntastic/syntax_checkers/cpp/avrgcc.vim
Normal file
24
sources_non_forked/syntastic/syntax_checkers/cpp/avrgcc.vim
Normal file
|
@ -0,0 +1,24 @@
|
|||
"============================================================================
|
||||
"File: avrgcc.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: Sławek Piotrowski <sentinel at atteo dot 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_cpp_avrgcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_avrgcc_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'avrgcc',
|
||||
\ 'exec': 'avr-g++',
|
||||
\ 'redirect': 'c/avrgcc'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -1,7 +1,7 @@
|
|||
"============================================================================
|
||||
"File: dockerfile_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using dockerfile-lint
|
||||
" (https://github.com/projectatomic/dockerfile-lint).
|
||||
" (https://github.com/projectatomic/dockerfile_lint).
|
||||
"Maintainer: Tim Carry <tim at pixelastic dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
"============================================================================
|
||||
"File: ghc-mod.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot 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_haskell_ghc_mod_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_ghc_mod_checker = 1
|
||||
|
||||
let s:ghc_mod_new = -1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict " {{{1
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
" ghc-mod 5.0.0 and later needs the "version" command to print the
|
||||
" version. But the "version" command appeared in 4.1.0. Thus, we need to
|
||||
" know the version in order to know how to find out the version. :)
|
||||
|
||||
" Try "ghc-mod version".
|
||||
let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1)
|
||||
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
|
||||
if !len(ver)
|
||||
" That didn't work. Try "ghc-mod" alone.
|
||||
let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1)
|
||||
let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
|
||||
endif
|
||||
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : []
|
||||
|
||||
if len(parsed_ver)
|
||||
" Encouraged by the great success in finding out the version, now we
|
||||
" need either a Vim that can handle NULs in system() output, or a
|
||||
" ghc-mod that has the "--boundary" option.
|
||||
call self.setVersion(parsed_ver)
|
||||
let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
|
||||
else
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
|
||||
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
|
||||
let s:ghc_mod_new = -1
|
||||
endif
|
||||
|
||||
" ghc-mod 5.4.0 wants to run in the root directory of the project;
|
||||
" syntastic can't cope with the resulting complications
|
||||
"
|
||||
" References:
|
||||
" https://hackage.haskell.org/package/ghc-mod-5.4.0.0/changelog
|
||||
let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4])
|
||||
|
||||
return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout
|
||||
endfunction " }}}1
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict " {{{1
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe': self.getExecEscaped() . ' check' . (s:ghc_mod_new ? ' --boundary=""' : '') })
|
||||
|
||||
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'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'iconv',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'returns': [0] })
|
||||
endfunction " }}}1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'ghc_mod',
|
||||
\ 'exec': 'ghc-mod' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -31,12 +31,12 @@ function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
|
|||
|
||||
let errorformat =
|
||||
\ '%-Z %#,'.
|
||||
\ '%W%f:%l:%v: Warning: %m,'.
|
||||
\ '%W%f:%l:%v: Warning:,'.
|
||||
\ '%E%f:%l:%v: %m,'.
|
||||
\ '%E%>%f:%l:%v:,'.
|
||||
\ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning: %m,'.
|
||||
\ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning:,'.
|
||||
\ '%E%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: %m,'.
|
||||
\ '%E%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
|
||||
\ '%+C %#%m,'.
|
||||
\ '%W%>%f:%l:%v:,'.
|
||||
\ '%W%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
|
||||
\ '%+C %#%tarning: %m,'
|
||||
|
||||
return SyntasticMake({
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_help_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_help_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'help',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,46 @@
|
|||
"============================================================================
|
||||
"File: html.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_html_htmlhint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_htmlhint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_html_htmlhint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 9, 13])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_html_htmlhint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '--format unix' })
|
||||
|
||||
let errorformat = '%f:%l:%c: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'htmlhint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_html_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -25,7 +25,7 @@ function! SyntaxCheckers_javascript_flow_IsAvailable() dict
|
|||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [0, 18, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_flow_GetLocList() dict
|
||||
|
|
|
@ -47,7 +47,7 @@ endfunction
|
|||
function! SyntaxCheckers_lua_luac_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_after': '-p' })
|
||||
|
||||
let errorformat = 'luac: %#%f:%l: %m'
|
||||
let errorformat = '%*\f: %#%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_markdown_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_markdown_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'markdown',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -20,7 +20,7 @@ set cpo&vim
|
|||
|
||||
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-X gnu -f elf' .
|
||||
\ 'args_after': '-X gnu' .
|
||||
\ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . syntastic#util#Slash()) .
|
||||
\ ' ' . syntastic#c#NullOutput() })
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_nroff_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nroff_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'nroff',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -1,6 +1,6 @@
|
|||
"============================================================================
|
||||
"File: perl.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>,
|
||||
" Eric Harmon <http://eharmon.net>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
|
@ -23,7 +23,7 @@
|
|||
"
|
||||
" let g:syntastic_enable_perl_checker = 1
|
||||
"
|
||||
" References:
|
||||
" Reference:
|
||||
"
|
||||
" - http://perldoc.perl.org/perlrun.html#*-c*
|
||||
|
||||
|
@ -55,15 +55,15 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1
|
|||
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
else
|
||||
let includes = copy(syntastic#util#var('perl_lib_path'))
|
||||
let includes = copy(syntastic#util#var('perl_lib_path', []))
|
||||
endif
|
||||
let shebang = syntastic#util#parseShebang()
|
||||
let extra = join(map(includes, '"-I" . v:val')) .
|
||||
\ (index(shebang['args'], '-T') >= 0 ? ' -T' : '') .
|
||||
\ (index(shebang['args'], '-t') >= 0 ? ' -t' : '')
|
||||
let extra = map(includes, '"-I" . v:val') +
|
||||
\ (index(shebang['args'], '-T') >= 0 ? ['-T'] : []) +
|
||||
\ (index(shebang['args'], '-t') >= 0 ? ['-t'] : [])
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '-c -X ' . extra })
|
||||
let makeprg = self.makeprgBuild({ 'args_before': ['-c', '-X '] + extra })
|
||||
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
@ -74,7 +74,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1
|
|||
return errors
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '-c -Mwarnings ' . extra })
|
||||
let makeprg = self.makeprgBuild({ 'args_before': ['-c', '-Mwarnings'] + extra })
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_pod_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_pod_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'pod',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_rst_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_rst_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'rst',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -25,11 +25,12 @@ function! SyntaxCheckers_scala_fsc_GetLocList() dict
|
|||
" working directory changing after being started
|
||||
" that's why we better pass an absolute path
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '-Ystop-after:parser',
|
||||
\ 'args': '-Ystop-after:parser',
|
||||
\ 'fname': syntastic#util#shexpand('%:p') })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: %trror: %m,' .
|
||||
\ '%W%f:%l: %tarning:%m,' .
|
||||
\ '%Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
"============================================================================
|
||||
"File: solc.vim
|
||||
"Description: Solidity syntax checker - using solc
|
||||
"Maintainer: Jacob Cholewa <jacob@cholewa.dk>
|
||||
"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_solidity_solc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_solidity_solc_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_solidity_solc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%l:%c: %trror: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'solidity',
|
||||
\ 'name': 'solc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -19,13 +19,25 @@ let s:save_cpo = &cpo
|
|||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_stylus_stylint_GetLocList() dict
|
||||
if !exists('s:stylint_new')
|
||||
let s:stylint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5, 7])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat =
|
||||
\ '%WWarning: %m,' .
|
||||
\ '%EError: %m,' .
|
||||
\ '%CFile: %f,' .
|
||||
\ '%CLine: %l:%.%#'
|
||||
if s:stylint_new
|
||||
let errorformat =
|
||||
\ '%P%f,' .
|
||||
\ '%-Q,' .
|
||||
\ '%\m%l:%c%\s%\+%t%\%%(rror%\|arning%\)%\s%\+%m%\s%\+%\S%\+%\s%#,' .
|
||||
\ '%\m%l%\s%\+%t%\%%(rror%\|arning%\)%\s%\+%m%\s%\+%\S%\+%\s%#'
|
||||
else
|
||||
let errorformat =
|
||||
\ '%WWarning: %m,' .
|
||||
\ '%EError: %m,' .
|
||||
\ '%CFile: %f,' .
|
||||
\ '%CLine: %l:%.%#'
|
||||
endif
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_tex_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_tex_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'tex',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_texinfo_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_texinfo_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'texinfo',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -0,0 +1,45 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_text_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_text_proselint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_text_proselint_sort')
|
||||
let g:syntastic_text_proselint_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_text_proselint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%l:%c: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': { 'type': 'W', 'subtype': 'Style' },
|
||||
\ 'preprocess': 'iconv',
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'text',
|
||||
\ 'name': 'proselint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -1,66 +0,0 @@
|
|||
"============================================================================
|
||||
"File: tsc.vim
|
||||
"Description: TypeScript syntax checker
|
||||
"Maintainer: Bill Casarin <bill@casarin.ca>
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_typescript_tsc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_typescript_tsc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_typescript_tsc_sort')
|
||||
let g:syntastic_typescript_tsc_sort = 1
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_typescript_tsc_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let version_output = split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n', 1)
|
||||
let ver = filter(copy(version_output), 'v:val =~# ''\m\<Version ''')
|
||||
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0], '\v<Version \zs\d+(\.\d+)\ze') : []
|
||||
|
||||
if len(parsed_ver)
|
||||
call self.setVersion(parsed_ver)
|
||||
let s:tsc_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 5])
|
||||
else
|
||||
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
|
||||
call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
|
||||
let s:tsc_new = -1
|
||||
endif
|
||||
|
||||
return s:tsc_new >= 0
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_typescript_tsc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '--module commonjs',
|
||||
\ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f %#(%l\,%c): error %m,' .
|
||||
\ '%E%f %#(%l\,%c): %m,' .
|
||||
\ '%Eerror %m,' .
|
||||
\ '%C%\s%\+%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['guards'],
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'typescript',
|
||||
\ 'name': 'tsc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
|
@ -99,8 +99,7 @@ endfunction " }}}2
|
|||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'vim',
|
||||
\ 'name': 'vimlint',
|
||||
\ 'exec': '' })
|
||||
\ 'name': 'vimlint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
"============================================================================
|
||||
"File: proselint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot 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_xhtml_proselint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_xhtml_proselint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'xhtml',
|
||||
\ 'name': 'proselint',
|
||||
\ 'redirect': 'text/proselint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
1
sources_non_forked/tabular/.gitignore
vendored
Normal file
1
sources_non_forked/tabular/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/doc/tags
|
24
sources_non_forked/tabular/LICENSE.md
Normal file
24
sources_non_forked/tabular/LICENSE.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
Copyright (c) 2016, Matthew J. Wozniski
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* The names of the contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
sources_non_forked/tabular/README.md
Normal file
29
sources_non_forked/tabular/README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
Tabular
|
||||
==============
|
||||
Sometimes, it's useful to line up text. Naturally, it's nicer to have the
|
||||
computer do this for you, since aligning things by hand quickly becomes
|
||||
unpleasant. While there are other plugins for aligning text, the ones I've
|
||||
tried are either impossibly difficult to understand and use, or too simplistic
|
||||
to handle complicated tasks. This plugin aims to make the easy things easy
|
||||
and the hard things possible, without providing an unnecessarily obtuse
|
||||
interface. It's still a work in progress, and criticisms are welcome.
|
||||
|
||||
See [Aligning Text with Tabular.vim](http://vimcasts.org/episodes/aligning-text-with-tabular-vim/)
|
||||
for a screencast that shows how Tabular.vim works.
|
||||
|
||||
See [doc/Tabular.txt](http://raw.github.com/godlygeek/tabular/master/doc/Tabular.txt)
|
||||
for detailed documentation.
|
||||
|
||||
Installation
|
||||
==============
|
||||
If you don't have a preferred installation method, I recommend installing
|
||||
[pathogen.vim](https://github.com/tpope/vim-pathogen), and then simply
|
||||
copy and paste:
|
||||
|
||||
mkdir -p ~/.vim/bundle
|
||||
cd ~/.vim/bundle
|
||||
git clone git://github.com/godlygeek/tabular.git
|
||||
|
||||
Once help tags have been generated (either using Pathogen's `:Helptags`
|
||||
command, or by pointing vim's `:helptags` command at the directory where you
|
||||
installed Tabular), you can view the manual with `:help tabular`.
|
73
sources_non_forked/tabular/after/plugin/TabularMaps.vim
Normal file
73
sources_non_forked/tabular/after/plugin/TabularMaps.vim
Normal file
|
@ -0,0 +1,73 @@
|
|||
" Copyright (c) 2016, Matthew J. Wozniski
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
" modification, are permitted provided that the following conditions are met:
|
||||
" * Redistributions of source code must retain the above copyright notice,
|
||||
" this list of conditions and the following disclaimer.
|
||||
" * Redistributions in binary form must reproduce the above copyright
|
||||
" notice, this list of conditions and the following disclaimer in the
|
||||
" documentation and/or other materials provided with the distribution.
|
||||
" * The names of the contributors may not be used to endorse or promote
|
||||
" products derived from this software without specific prior written
|
||||
" permission.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
|
||||
" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
" NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if !exists(':Tabularize') || get(g:, 'no_default_tabular_maps', 0)
|
||||
finish " Tabular.vim wasn't loaded or the default maps are unwanted
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
AddTabularPattern! assignment /[|&+*/%<>=!~-]\@<!\([<>!=]=\|=\~\)\@![|&+*/%<>=!~-]*=/l1r1
|
||||
AddTabularPattern! two_spaces / /l0
|
||||
|
||||
AddTabularPipeline! multiple_spaces / / map(a:lines, "substitute(v:val, ' *', ' ', 'g')") | tabular#TabularizeStrings(a:lines, ' ', 'l0')
|
||||
|
||||
AddTabularPipeline! argument_list /(.*)/ map(a:lines, 'substitute(v:val, ''\s*\([(,)]\)\s*'', ''\1'', ''g'')')
|
||||
\ | tabular#TabularizeStrings(a:lines, '[(,)]', 'l0')
|
||||
\ | map(a:lines, 'substitute(v:val, ''\(\s*\),'', '',\1 '', "g")')
|
||||
\ | map(a:lines, 'substitute(v:val, ''\s*)'', ")", "g")')
|
||||
|
||||
function! SplitCDeclarations(lines)
|
||||
let rv = []
|
||||
for line in a:lines
|
||||
" split the line into declaractions
|
||||
let split = split(line, '\s*[,;]\s*')
|
||||
" separate the type from the first declaration
|
||||
let type = substitute(split[0], '\%(\%([&*]\s*\)*\)\=\k\+$', '', '')
|
||||
" add the ; back on every declaration
|
||||
call map(split, 'v:val . ";"')
|
||||
" add the first element to the return as-is, and remove it from the list
|
||||
let rv += [ remove(split, 0) ]
|
||||
" transform the other elements by adding the type on at the beginning
|
||||
call map(split, 'type . v:val')
|
||||
" and add them all to the return
|
||||
let rv += split
|
||||
endfor
|
||||
return rv
|
||||
endfunction
|
||||
|
||||
AddTabularPipeline! split_declarations /,.*;/ SplitCDeclarations(a:lines)
|
||||
|
||||
AddTabularPattern! ternary_operator /^.\{-}\zs?\|:/l1
|
||||
|
||||
AddTabularPattern! cpp_io /<<\|>>/l1
|
||||
|
||||
AddTabularPattern! pascal_assign /:=/l1
|
||||
|
||||
AddTabularPattern! trailing_c_comments /\/\*\|\*\/\|\/\//l1
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
409
sources_non_forked/tabular/autoload/tabular.vim
Normal file
409
sources_non_forked/tabular/autoload/tabular.vim
Normal file
|
@ -0,0 +1,409 @@
|
|||
" Tabular: Align columnar data using regex-designated column boundaries
|
||||
" Maintainer: Matthew Wozniski (godlygeek@gmail.com)
|
||||
" Date: Thu, 03 May 2012 20:49:32 -0400
|
||||
" Version: 1.0
|
||||
"
|
||||
" Long Description:
|
||||
" Sometimes, it's useful to line up text. Naturally, it's nicer to have the
|
||||
" computer do this for you, since aligning things by hand quickly becomes
|
||||
" unpleasant. While there are other plugins for aligning text, the ones I've
|
||||
" tried are either impossibly difficult to understand and use, or too simplistic
|
||||
" to handle complicated tasks. This plugin aims to make the easy things easy
|
||||
" and the hard things possible, without providing an unnecessarily obtuse
|
||||
" interface. It's still a work in progress, and criticisms are welcome.
|
||||
"
|
||||
" License:
|
||||
" Copyright (c) 2012, Matthew J. Wozniski
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
" modification, are permitted provided that the following conditions are met:
|
||||
" * Redistributions of source code must retain the above copyright notice,
|
||||
" this list of conditions and the following disclaimer.
|
||||
" * Redistributions in binary form must reproduce the above copyright
|
||||
" notice, this list of conditions and the following disclaimer in the
|
||||
" documentation and/or other materials provided with the distribution.
|
||||
" * The names of the contributors may not be used to endorse or promote
|
||||
" products derived from this software without specific prior written
|
||||
" permission.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
|
||||
" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
" NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
" Stupid vimscript crap {{{1
|
||||
let s:savecpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Private Functions {{{1
|
||||
|
||||
" Return the number of bytes in a string after expanding tabs to spaces. {{{2
|
||||
" This expansion is done based on the current value of 'tabstop'
|
||||
if exists('*strdisplaywidth')
|
||||
" Needs vim 7.3
|
||||
let s:Strlen = function("strdisplaywidth")
|
||||
else
|
||||
function! s:Strlen(string)
|
||||
" Implement the tab handling part of strdisplaywidth for vim 7.2 and
|
||||
" earlier - not much that can be done about handling doublewidth
|
||||
" characters.
|
||||
let rv = 0
|
||||
let i = 0
|
||||
|
||||
for char in split(a:string, '\zs')
|
||||
if char == "\t"
|
||||
let rv += &ts - i
|
||||
let i = 0
|
||||
else
|
||||
let rv += 1
|
||||
let i = (i + 1) % &ts
|
||||
endif
|
||||
endfor
|
||||
|
||||
return rv
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Align a string within a field {{{2
|
||||
" These functions do not trim leading and trailing spaces.
|
||||
|
||||
" Right align 'string' in a field of size 'fieldwidth'
|
||||
function! s:Right(string, fieldwidth)
|
||||
let spaces = a:fieldwidth - s:Strlen(a:string)
|
||||
return matchstr(a:string, '^\s*') . repeat(" ", spaces) . substitute(a:string, '^\s*', '', '')
|
||||
endfunction
|
||||
|
||||
" Left align 'string' in a field of size 'fieldwidth'
|
||||
function! s:Left(string, fieldwidth)
|
||||
let spaces = a:fieldwidth - s:Strlen(a:string)
|
||||
return a:string . repeat(" ", spaces)
|
||||
endfunction
|
||||
|
||||
" Center align 'string' in a field of size 'fieldwidth'
|
||||
function! s:Center(string, fieldwidth)
|
||||
let spaces = a:fieldwidth - s:Strlen(a:string)
|
||||
let right = spaces / 2
|
||||
let left = right + (right * 2 != spaces)
|
||||
return repeat(" ", left) . a:string . repeat(" ", right)
|
||||
endfunction
|
||||
|
||||
" Remove spaces around a string {{{2
|
||||
|
||||
" Remove all trailing spaces from a string.
|
||||
function! s:StripTrailingSpaces(string)
|
||||
return matchstr(a:string, '^.\{-}\ze\s*$')
|
||||
endfunction
|
||||
|
||||
" Remove all leading spaces from a string.
|
||||
function! s:StripLeadingSpaces(string)
|
||||
return matchstr(a:string, '^\s*\zs.*$')
|
||||
endfunction
|
||||
|
||||
" Split a string into fields and delimiters {{{2
|
||||
" Like split(), but include the delimiters as elements
|
||||
" All odd numbered elements are delimiters
|
||||
" All even numbered elements are non-delimiters (including zero)
|
||||
function! s:SplitDelim(string, delim)
|
||||
let rv = []
|
||||
let beg = 0
|
||||
|
||||
let len = len(a:string)
|
||||
let searchoff = 0
|
||||
|
||||
while 1
|
||||
let mid = match(a:string, a:delim, beg + searchoff, 1)
|
||||
if mid == -1 || mid == len
|
||||
break
|
||||
endif
|
||||
|
||||
let matchstr = matchstr(a:string, a:delim, beg + searchoff, 1)
|
||||
let length = strlen(matchstr)
|
||||
|
||||
if length == 0 && beg == mid
|
||||
" Zero-length match for a zero-length delimiter - advance past it
|
||||
let searchoff += 1
|
||||
continue
|
||||
endif
|
||||
|
||||
if beg == mid
|
||||
let rv += [ "" ]
|
||||
else
|
||||
let rv += [ a:string[beg : mid-1] ]
|
||||
endif
|
||||
|
||||
let rv += [ matchstr ]
|
||||
|
||||
let beg = mid + length
|
||||
let searchoff = 0
|
||||
endwhile
|
||||
|
||||
let rv += [ strpart(a:string, beg) ]
|
||||
|
||||
return rv
|
||||
endfunction
|
||||
|
||||
" Replace lines from `start' to `start + len - 1' with the given strings. {{{2
|
||||
" If more lines are needed to show all strings, they will be added.
|
||||
" If there are too few strings to fill all lines, lines will be removed.
|
||||
function! s:SetLines(start, len, strings)
|
||||
if a:start > line('$') + 1 || a:start < 1
|
||||
throw "Invalid start line!"
|
||||
endif
|
||||
|
||||
if len(a:strings) > a:len
|
||||
let fensave = &fen
|
||||
let view = winsaveview()
|
||||
call append(a:start + a:len - 1, repeat([''], len(a:strings) - a:len))
|
||||
call winrestview(view)
|
||||
let &fen = fensave
|
||||
elseif len(a:strings) < a:len
|
||||
let fensave = &fen
|
||||
let view = winsaveview()
|
||||
sil exe (a:start + len(a:strings)) . ',' . (a:start + a:len - 1) . 'd_'
|
||||
call winrestview(view)
|
||||
let &fen = fensave
|
||||
endif
|
||||
|
||||
call setline(a:start, a:strings)
|
||||
endfunction
|
||||
|
||||
" Runs the given commandstring argument as an expression. {{{2
|
||||
" The commandstring expression is expected to reference the a:lines argument.
|
||||
" If the commandstring expression returns a list the items of that list will
|
||||
" replace the items in a:lines, otherwise the expression is assumed to have
|
||||
" modified a:lines itself.
|
||||
function! s:FilterString(lines, commandstring)
|
||||
exe 'let rv = ' . a:commandstring
|
||||
|
||||
if type(rv) == type(a:lines) && rv isnot a:lines
|
||||
call filter(a:lines, 0)
|
||||
call extend(a:lines, rv)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Public API {{{1
|
||||
|
||||
if !exists("g:tabular_default_format")
|
||||
let g:tabular_default_format = "l1"
|
||||
endif
|
||||
|
||||
let s:formatelempat = '\%([lrc]\d\+\)'
|
||||
|
||||
function! tabular#ElementFormatPattern()
|
||||
return s:formatelempat
|
||||
endfunction
|
||||
|
||||
" Given a list of strings and a delimiter, split each string on every
|
||||
" occurrence of the delimiter pattern, format each element according to either
|
||||
" the provided format (optional) or the default format, and join them back
|
||||
" together with enough space padding to guarantee that the nth delimiter of
|
||||
" each string is aligned.
|
||||
function! tabular#TabularizeStrings(strings, delim, ...)
|
||||
if a:0 > 1
|
||||
echoerr "TabularizeStrings accepts only 2 or 3 arguments (got ".(a:0+2).")"
|
||||
return 1
|
||||
endif
|
||||
|
||||
let formatstr = (a:0 ? a:1 : g:tabular_default_format)
|
||||
|
||||
if formatstr !~? s:formatelempat . '\+'
|
||||
echoerr "Tabular: Invalid format \"" . formatstr . "\" specified!"
|
||||
return 1
|
||||
endif
|
||||
|
||||
let format = split(formatstr, s:formatelempat . '\zs')
|
||||
|
||||
let lines = map(a:strings, 's:SplitDelim(v:val, a:delim)')
|
||||
|
||||
" Strip spaces
|
||||
" - Only from non-delimiters; spaces in delimiters must have been matched
|
||||
" intentionally
|
||||
" - Don't strip leading spaces from the first element; we like indenting.
|
||||
for line in lines
|
||||
if len(line) == 1 && s:do_gtabularize
|
||||
continue " Leave non-matching lines unchanged for GTabularize
|
||||
endif
|
||||
|
||||
if line[0] !~ '^\s*$'
|
||||
let line[0] = s:StripTrailingSpaces(line[0])
|
||||
endif
|
||||
if len(line) >= 3
|
||||
for i in range(2, len(line)-1, 2)
|
||||
let line[i] = s:StripLeadingSpaces(s:StripTrailingSpaces(line[i]))
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Find the max length of each field
|
||||
let maxes = []
|
||||
for line in lines
|
||||
if len(line) == 1 && s:do_gtabularize
|
||||
continue " non-matching lines don't affect field widths for GTabularize
|
||||
endif
|
||||
|
||||
for i in range(len(line))
|
||||
if i == len(maxes)
|
||||
let maxes += [ s:Strlen(line[i]) ]
|
||||
else
|
||||
let maxes[i] = max( [ maxes[i], s:Strlen(line[i]) ] )
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
let lead_blank = empty(filter(copy(lines), 'v:val[0] =~ "\\S"'))
|
||||
|
||||
" Concatenate the fields, according to the format pattern.
|
||||
for idx in range(len(lines))
|
||||
let line = lines[idx]
|
||||
|
||||
if len(line) == 1 && s:do_gtabularize
|
||||
let lines[idx] = line[0] " GTabularize doesn't change non-matching lines
|
||||
continue
|
||||
endif
|
||||
|
||||
for i in range(len(line))
|
||||
let how = format[i % len(format)][0]
|
||||
let pad = format[i % len(format)][1:-1]
|
||||
|
||||
if how =~? 'l'
|
||||
let field = s:Left(line[i], maxes[i])
|
||||
elseif how =~? 'r'
|
||||
let field = s:Right(line[i], maxes[i])
|
||||
elseif how =~? 'c'
|
||||
let field = s:Center(line[i], maxes[i])
|
||||
endif
|
||||
|
||||
let line[i] = field . (lead_blank && i == 0 ? '' : repeat(" ", pad))
|
||||
endfor
|
||||
|
||||
let lines[idx] = s:StripTrailingSpaces(join(line, ''))
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Apply 0 or more filters, in sequence, to selected text in the buffer {{{2
|
||||
" The lines to be filtered are determined as follows:
|
||||
" If the function is called with a range containing multiple lines, then
|
||||
" those lines will be used as the range.
|
||||
" If the function is called with no range or with a range of 1 line, then
|
||||
" if GTabularize mode is being used,
|
||||
" the range will not be adjusted
|
||||
" if "includepat" is not specified,
|
||||
" that 1 line will be filtered,
|
||||
" if "includepat" is specified and that line does not match it,
|
||||
" no lines will be filtered
|
||||
" if "includepat" is specified and that line does match it,
|
||||
" all contiguous lines above and below the specified line matching the
|
||||
" pattern will be filtered.
|
||||
"
|
||||
" The remaining arguments must each be a filter to apply to the text.
|
||||
" Each filter must either be a String evaluating to a function to be called.
|
||||
function! tabular#PipeRange(includepat, ...) range
|
||||
exe a:firstline . ',' . a:lastline
|
||||
\ . 'call tabular#PipeRangeWithOptions(a:includepat, a:000, {})'
|
||||
endfunction
|
||||
|
||||
" Extended version of tabular#PipeRange, which
|
||||
" 1) Takes the list of filters as an explicit list rather than as varargs
|
||||
" 2) Supports passing a dictionary of options to control the routine.
|
||||
" Currently, the only supported option is 'mode', which determines whether
|
||||
" to behave as :Tabularize or as :GTabularize
|
||||
" This allows me to add new features here without breaking API compatibility
|
||||
" in the future.
|
||||
function! tabular#PipeRangeWithOptions(includepat, filterlist, options) range
|
||||
let top = a:firstline
|
||||
let bot = a:lastline
|
||||
|
||||
let s:do_gtabularize = (get(a:options, 'mode', '') ==# 'GTabularize')
|
||||
|
||||
if !s:do_gtabularize
|
||||
" In the default mode, apply range extension logic
|
||||
if a:includepat != '' && top == bot
|
||||
if top < 0 || top > line('$') || getline(top) !~ a:includepat
|
||||
return
|
||||
endif
|
||||
while top > 1 && getline(top-1) =~ a:includepat
|
||||
let top -= 1
|
||||
endwhile
|
||||
while bot < line('$') && getline(bot+1) =~ a:includepat
|
||||
let bot += 1
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
|
||||
let lines = map(range(top, bot), 'getline(v:val)')
|
||||
|
||||
for filter in a:filterlist
|
||||
if type(filter) != type("")
|
||||
echoerr "PipeRange: Bad filter: " . string(filter)
|
||||
endif
|
||||
|
||||
call s:FilterString(lines, filter)
|
||||
|
||||
unlet filter
|
||||
endfor
|
||||
|
||||
call s:SetLines(top, bot - top + 1, lines)
|
||||
endfunction
|
||||
|
||||
" Part of the public interface so interested pipelines can query this and
|
||||
" adjust their behavior appropriately.
|
||||
function! tabular#DoGTabularize()
|
||||
return s:do_gtabularize
|
||||
endfunction
|
||||
|
||||
function! s:SplitDelimTest(string, delim, expected)
|
||||
let result = s:SplitDelim(a:string, a:delim)
|
||||
|
||||
if result !=# a:expected
|
||||
echomsg 'Test failed!'
|
||||
echomsg ' string=' . string(a:string) . ' delim=' . string(a:delim)
|
||||
echomsg ' Returned=' . string(result)
|
||||
echomsg ' Expected=' . string(a:expected)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! tabular#SplitDelimUnitTest()
|
||||
let assignment = '[|&+*/%<>=!~-]\@<!\([<>!=]=\|=\~\)\@![|&+*/%<>=!~-]*='
|
||||
let two_spaces = ' '
|
||||
let ternary_operator = '^.\{-}\zs?\|:'
|
||||
let cpp_io = '<<\|>>'
|
||||
let pascal_assign = ':='
|
||||
let trailing_c_comments = '\/\*\|\*\/\|\/\/'
|
||||
|
||||
call s:SplitDelimTest('a+=b', assignment, ['a', '+=', 'b'])
|
||||
call s:SplitDelimTest('a-=b', assignment, ['a', '-=', 'b'])
|
||||
call s:SplitDelimTest('a!=b', assignment, ['a!=b'])
|
||||
call s:SplitDelimTest('a==b', assignment, ['a==b'])
|
||||
call s:SplitDelimTest('a&=b', assignment, ['a', '&=', 'b'])
|
||||
call s:SplitDelimTest('a|=b', assignment, ['a', '|=', 'b'])
|
||||
call s:SplitDelimTest('a=b=c', assignment, ['a', '=', 'b', '=', 'c'])
|
||||
|
||||
call s:SplitDelimTest('a b c', two_spaces, ['a', ' ', 'b', ' ', 'c'])
|
||||
call s:SplitDelimTest('a b c', two_spaces, ['a b', ' ', ' c'])
|
||||
call s:SplitDelimTest('ab c', two_spaces, ['ab', ' ', '', ' ', 'c'])
|
||||
|
||||
call s:SplitDelimTest('a?b:c', ternary_operator, ['a', '?', 'b', ':', 'c'])
|
||||
|
||||
call s:SplitDelimTest('a<<b<<c', cpp_io, ['a', '<<', 'b', '<<', 'c'])
|
||||
|
||||
call s:SplitDelimTest('a:=b=c', pascal_assign, ['a', ':=', 'b=c'])
|
||||
|
||||
call s:SplitDelimTest('x//foo', trailing_c_comments, ['x', '//', 'foo'])
|
||||
call s:SplitDelimTest('x/*foo*/',trailing_c_comments, ['x', '/*', 'foo', '*/', ''])
|
||||
|
||||
call s:SplitDelimTest('#ab#cd#ef', '[^#]*', ['#', 'ab', '#', 'cd', '#', 'ef', ''])
|
||||
call s:SplitDelimTest('#ab#cd#ef', '#\zs', ['#', '', 'ab#', '', 'cd#', '', 'ef'])
|
||||
endfunction
|
||||
|
||||
" Stupid vimscript crap, part 2 {{{1
|
||||
let &cpo = s:savecpo
|
||||
unlet s:savecpo
|
||||
|
||||
" vim:set sw=2 sts=2 fdm=marker:
|
260
sources_non_forked/tabular/doc/Tabular.txt
Normal file
260
sources_non_forked/tabular/doc/Tabular.txt
Normal file
|
@ -0,0 +1,260 @@
|
|||
*Tabular.txt* Configurable, flexible, intuitive text aligning
|
||||
|
||||
*tabular* *tabular.vim*
|
||||
|
||||
#|#|#|#|#| #| #| ~
|
||||
#| #|#|#| #|#|#| #| #| #| #|#|#| #| #|#| ~
|
||||
#| #| #| #| #| #| #| #| #| #| #|#| ~
|
||||
#| #| #| #| #| #| #| #| #| #| #| ~
|
||||
#| #|#|#| #|#|#| #|#|#| #| #|#|#| #| ~
|
||||
|
||||
For Vim version 7.0 or newer
|
||||
|
||||
By Matt Wozniski
|
||||
mjw@drexel.edu
|
||||
|
||||
Reference Manual ~
|
||||
|
||||
*tabular-toc*
|
||||
|
||||
1. Description |tabular-intro|
|
||||
2. Walkthrough |tabular-walkthrough|
|
||||
3. Scripting |tabular-scripting|
|
||||
|
||||
The functionality mentioned here is a plugin, see |add-plugin|.
|
||||
You can avoid loading this plugin by setting the "Tabular_loaded" global
|
||||
variable in your |vimrc| file: >
|
||||
:let g:tabular_loaded = 1
|
||||
|
||||
==============================================================================
|
||||
1. Description *tabular-intro*
|
||||
|
||||
Sometimes, it's useful to line up text. Naturally, it's nicer to have the
|
||||
computer do this for you, since aligning things by hand quickly becomes
|
||||
unpleasant. While there are other plugins for aligning text, the ones I've
|
||||
tried are either impossibly difficult to understand and use, or too simplistic
|
||||
to handle complicated tasks. This plugin aims to make the easy things easy
|
||||
and the hard things possible, without providing an unnecessarily obtuse
|
||||
interface. It's still a work in progress, and criticisms are welcome.
|
||||
|
||||
==============================================================================
|
||||
2. Walkthrough *tabular-walkthrough* *:Tabularize*
|
||||
|
||||
Tabular's commands are based largely on regular expressions. The basic
|
||||
technique used by Tabular is taking some regex to match field delimiters,
|
||||
splitting the input lines at those delimiters, trimming unnecessary spaces
|
||||
from the non-delimiter parts, padding the non-delimiter parts of the lines
|
||||
with spaces to make them the same length, and joining things back together
|
||||
again.
|
||||
|
||||
For instance, consider starting with the following lines:
|
||||
>
|
||||
Some short phrase,some other phrase
|
||||
A much longer phrase here,and another long phrase
|
||||
<
|
||||
Let's say we want to line these lines up at the commas. We can tell
|
||||
Tabularize to do this by passing a pattern matching , to the Tabularize
|
||||
command:
|
||||
>
|
||||
:Tabularize /,
|
||||
|
||||
Some short phrase , some other phrase
|
||||
A much longer phrase here , and another long phrase
|
||||
<
|
||||
I encourage you to try copying those lines to another buffer and trying to
|
||||
call :Tabularize. You'll want to take notice of two things quickly: First,
|
||||
instead of requiring a range, Tabularize tries to figure out what you want to
|
||||
happen. Since it knows that you want to act on lines matching a comma, it
|
||||
will look upwards and downwards for lines around the current line that match a
|
||||
comma, and consider all contiguous lines matching the pattern to be the range
|
||||
to be acted upon. You can always override this by specifying a range, though.
|
||||
|
||||
The second thing you should notice is that you'll almost certainly be able to
|
||||
abbreviate :Tabularize to :Tab - using this form in mappings and scripts is
|
||||
discouraged as it will make conflicts with other scripts more likely, but for
|
||||
interactive use it's a nice timesaver. Another convenience feature is that
|
||||
running :Tabularize without providing a new pattern will cause it to reuse the
|
||||
last pattern it was called with.
|
||||
|
||||
So, anyway, now the commas line up. Splitting the lines on commas, Tabular
|
||||
realized that 'Some short phrase' would need to be padded with spaces to match
|
||||
the length of 'A much longer phrase here', and it did that before joining the
|
||||
lines back together. You'll also notice that, in addition to the spaces
|
||||
inserting for padding, extra spaces were inserted between fields. That's
|
||||
because by default, Tabular prints things left-aligned with one space between
|
||||
fields. If you wanted to print things right-aligned with no spaces between
|
||||
fields, you would provide a different format to the Tabularize command:
|
||||
>
|
||||
:Tabularize /,/r0
|
||||
|
||||
Some short phrase, some other phrase
|
||||
A much longer phrase here,and another long phrase
|
||||
<
|
||||
A format specifier is either l, r, or c, followed by one or more digits. If
|
||||
the letter is l, the field will be left aligned, similarly for r and right
|
||||
aligning and c and center aligning. The number following the letter is the
|
||||
number of spaces padding to insert before the start of the next field.
|
||||
Multiple format specifiers can be added to the same command - each field will
|
||||
be printed with the next format specifier in the list; when they all have been
|
||||
used the first will be used again, and so on. So, the last command right
|
||||
aligned every field, then inserted 0 spaces of padding before the next field.
|
||||
What if we wanted to right align the text before the comma, and left align the
|
||||
text after the comma? The command would look like this:
|
||||
>
|
||||
:Tabularize /,/r1c1l0
|
||||
|
||||
Some short phrase , some other phrase
|
||||
A much longer phrase here , and another long phrase
|
||||
<
|
||||
That command would be read as "Align the matching text, splitting fields on
|
||||
commas. Print everything before the first comma right aligned, then 1 space,
|
||||
then the comma center aligned, then 1 space, then everything after the comma
|
||||
left aligned." Notice that the alignment of the field the comma is in is
|
||||
irrelevant - since it's only 1 cell wide, it looks the same whether it's right,
|
||||
left, or center aligned. Also notice that the 0 padding spaces specified for
|
||||
the 3rd field are unused - but they would be used if there were enough fields
|
||||
to require looping through the fields again. For instance:
|
||||
>
|
||||
abc,def,ghi
|
||||
a,b
|
||||
a,b,c
|
||||
|
||||
:Tabularize /,/r1c1l0
|
||||
|
||||
abc , def, ghi
|
||||
a , b
|
||||
a , b , c
|
||||
<
|
||||
Notice that now, the format pattern has been reused; field 4 (the second comma)
|
||||
is right aligned, field 5 is center aligned. No spaces were inserted between
|
||||
the 3rd field (containing "def") and the 4th field (the second comma) because
|
||||
the format specified 'l0'.
|
||||
|
||||
But, what if you only wanted to act on the first comma on the line, rather than
|
||||
all of the commas on the line? Let's say we want everything before the first
|
||||
comma right aligned, then the comma, then everything after the comma left
|
||||
aligned:
|
||||
>
|
||||
abc,def,ghi
|
||||
a,b
|
||||
a,b,c
|
||||
|
||||
:Tabularize /^[^,]*\zs,/r0c0l0
|
||||
|
||||
abc,def,ghi
|
||||
a,b
|
||||
a,b,c
|
||||
<
|
||||
Here, we used a Vim regex that would only match the first comma on the line.
|
||||
It matches the beginning of the line, followed by all the non-comma characters
|
||||
up to the first comma, and then forgets about what it matched so far and
|
||||
pretends that the match starts exactly at the comma.
|
||||
|
||||
But, now that this command does exactly what we want it to, it's become pretty
|
||||
unwieldy. It would be unpleasant to need to type that more than once or
|
||||
twice. The solution is to assign a name to it.
|
||||
>
|
||||
:AddTabularPattern first_comma /^[^,]*\zs,/r0c0l0
|
||||
<
|
||||
Now, typing ":Tabularize first_comma" will do the same thing as typing the
|
||||
whole pattern out each time. Of course this is more useful if you store the
|
||||
name in a file to be used later.
|
||||
|
||||
NOTE: In order to make these new commands available every time vim starts,
|
||||
you'll need to put those new commands into a .vim file in a plugin directory
|
||||
somewhere in your 'runtimepath'. In order to make sure that Tabular.vim has
|
||||
already been loaded before your file tries to use :AddTabularPattern or
|
||||
:AddTabularPipeline, the new file should be installed in an after/plugin
|
||||
directory in 'runtimepath'. In general, it will be safe to find out where the
|
||||
TabularMaps.vim plugin was installed, and place other files extending
|
||||
Tabular.vim in the same directory as TabularMaps.vim. For more information,
|
||||
and some suggested best practices, check out the |tabular-scripting| section.
|
||||
|
||||
Lastly, we'll approach the case where tabular cannot achieve your desired goal
|
||||
just by splitting lines appart, trimming whitespace, padding with whitespace,
|
||||
and rejoining the lines. As an example, consider the multiple_spaces command
|
||||
from TabularMaps.vim. The goal is to split using two or more spaces as a
|
||||
field delimiter, and join fields back together, properly lined up, with only
|
||||
two spaces between the end of each field and the beginning of the next.
|
||||
Unfortunately, Tabular can't do this with only the commands we know so far:
|
||||
>
|
||||
:Tabularize / /
|
||||
<
|
||||
The above function won't work, because it will consider "a b" as 5 fields
|
||||
delimited by two pairs of 2 spaces ( 'a', ' ', '', ' ', 'b' ) instead of as
|
||||
3 fields delimited by one set of 2 or more spaces ( 'a', ' ', 'b' ).
|
||||
>
|
||||
:Tabularize / \+/
|
||||
<
|
||||
The above function won't work either, because it will leave the delimiter as 4
|
||||
spaces when used against "a b", meaning that we would fail at our goal of
|
||||
collapsing everything down to two spaces between fields. So, we need a new
|
||||
command to get around this:
|
||||
>
|
||||
:AddTabularPipeline multiple_spaces / \{2,}/
|
||||
\ map(a:lines, "substitute(v:val, ' \{2,}', ' ', 'g')")
|
||||
\ | tabular#TabularizeStrings(a:lines, ' ', 'l0')
|
||||
<
|
||||
Yeah. I know it looks complicated. Bear with me. I probably will try to add
|
||||
in some shortcuts for this syntax, but this verbose will be guaranteed to
|
||||
always work.
|
||||
|
||||
You should already recognize the name being assigned. The next thing to
|
||||
happen is / \{2,}/ which is a pattern specifying which lines should
|
||||
automatically be included in the range when no range is given. Without this,
|
||||
there would be no pattern to use for extending the range. Everything after
|
||||
that is a | separated list of expressions to be evaluated. In the context in
|
||||
which they will be evaluated, a:lines will be set to a List of Strings
|
||||
containing the text of the lines being filtered as they procede through the
|
||||
pipeline you've set up. The \ at the start of the lines are just vim's line
|
||||
continuation marker; you needn't worry much about them. So, the first
|
||||
expression in the pipeline transforms each line by replacing every instance of
|
||||
2 or more spaces with exactly two spaces. The second command in the pipeline
|
||||
performs the equivalent of ":Tabularize / /l0"; the only difference is that
|
||||
it is operating on a List of Strings rather than text in the buffer. At the
|
||||
end of the pipeline, the Strings in the modified a:lines (or the return value
|
||||
of the last expression in the pipeline, if it returns a List) will replace the
|
||||
chosen range.
|
||||
|
||||
==============================================================================
|
||||
3. Extending *tabular-scripting*
|
||||
|
||||
As mentioned above, the most important consideration when extending Tabular
|
||||
with new maps or commands is that your plugin must be loaded after Tabular.vim
|
||||
has finished loading, and only if Tabular.vim has loaded successfully. The
|
||||
easiest approach to making sure it loads after Tabular.vim is simply putting
|
||||
the new file (we'll call it "tabular_extra.vim" as an example) into an
|
||||
"after/plugin/" directory in 'runtimepath', for instance:
|
||||
>
|
||||
~/.vim/after/plugin/tabular_extra.vim
|
||||
<
|
||||
The default set of mappings, found in "TabularMaps.vim", is installed in
|
||||
the after/plugin/ subdirectory of whatever directory Tabular was installed to.
|
||||
|
||||
The other important consideration is making sure that your commands are only
|
||||
called if Tabular.vim was actually loaded. The easiest way to do this is by
|
||||
checking for the existence of the :Tabularize command at the start of your
|
||||
plugin. A short example plugin would look like this:
|
||||
>
|
||||
" after/plugin/my_tabular_commands.vim
|
||||
" Provides extra :Tabularize commands
|
||||
|
||||
if !exists(':Tabularize')
|
||||
finish " Give up here; the Tabular plugin musn't have been loaded
|
||||
endif
|
||||
|
||||
" Make line wrapping possible by resetting the 'cpo' option, first saving it
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
AddTabularPattern! asterisk /*/l1
|
||||
|
||||
AddTabularPipeline! remove_leading_spaces /^ /
|
||||
\ map(a:lines, "substitute(v:val, '^ *', '', '')")
|
||||
|
||||
" Restore the saved value of 'cpo'
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
<
|
||||
==============================================================================
|
||||
vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
|
346
sources_non_forked/tabular/plugin/Tabular.vim
Normal file
346
sources_non_forked/tabular/plugin/Tabular.vim
Normal file
|
@ -0,0 +1,346 @@
|
|||
" Tabular: Align columnar data using regex-designated column boundaries
|
||||
" Maintainer: Matthew Wozniski (godlygeek@gmail.com)
|
||||
" Date: Thu, 03 May 2012 20:49:32 -0400
|
||||
" Version: 1.0
|
||||
"
|
||||
" Long Description:
|
||||
" Sometimes, it's useful to line up text. Naturally, it's nicer to have the
|
||||
" computer do this for you, since aligning things by hand quickly becomes
|
||||
" unpleasant. While there are other plugins for aligning text, the ones I've
|
||||
" tried are either impossibly difficult to understand and use, or too simplistic
|
||||
" to handle complicated tasks. This plugin aims to make the easy things easy
|
||||
" and the hard things possible, without providing an unnecessarily obtuse
|
||||
" interface. It's still a work in progress, and criticisms are welcome.
|
||||
"
|
||||
" License:
|
||||
" Copyright (c) 2012, Matthew J. Wozniski
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
" modification, are permitted provided that the following conditions are met:
|
||||
" * Redistributions of source code must retain the above copyright notice,
|
||||
" this list of conditions and the following disclaimer.
|
||||
" * Redistributions in binary form must reproduce the above copyright
|
||||
" notice, this list of conditions and the following disclaimer in the
|
||||
" documentation and/or other materials provided with the distribution.
|
||||
" * The names of the contributors may not be used to endorse or promote
|
||||
" products derived from this software without specific prior written
|
||||
" permission.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS
|
||||
" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
" NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
" Abort if running in vi-compatible mode or the user doesn't want us.
|
||||
if &cp || exists('g:tabular_loaded')
|
||||
if &cp && &verbose
|
||||
echo "Not loading Tabular in compatible mode."
|
||||
endif
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:tabular_loaded = 1
|
||||
|
||||
" Stupid vimscript crap {{{1
|
||||
let s:savecpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Private Things {{{1
|
||||
|
||||
" Dictionary of command name to command
|
||||
let s:TabularCommands = {}
|
||||
|
||||
" Generate tab completion list for :Tabularize {{{2
|
||||
" Return a list of commands that match the command line typed so far.
|
||||
" NOTE: Tries to handle commands with spaces in the name, but Vim doesn't seem
|
||||
" to handle that terribly well... maybe I should give up on that.
|
||||
function! s:CompleteTabularizeCommand(argstart, cmdline, cursorpos)
|
||||
let names = keys(s:TabularCommands)
|
||||
if exists("b:TabularCommands")
|
||||
let names += keys(b:TabularCommands)
|
||||
endif
|
||||
|
||||
let cmdstart = substitute(a:cmdline, '^\s*\S\+\s*', '', '')
|
||||
|
||||
return filter(names, 'v:val =~# ''^\V'' . escape(cmdstart, ''\'')')
|
||||
endfunction
|
||||
|
||||
" Choose the proper command map from the given command line {{{2
|
||||
" Returns [ command map, command line with leading <buffer> removed ]
|
||||
function! s:ChooseCommandMap(commandline)
|
||||
let map = s:TabularCommands
|
||||
let cmd = a:commandline
|
||||
|
||||
if cmd =~# '^<buffer>\s\+'
|
||||
if !exists('b:TabularCommands')
|
||||
let b:TabularCommands = {}
|
||||
endif
|
||||
let map = b:TabularCommands
|
||||
let cmd = substitute(cmd, '^<buffer>\s\+', '', '')
|
||||
endif
|
||||
|
||||
return [ map, cmd ]
|
||||
endfunction
|
||||
|
||||
" Parse '/pattern/format' into separate pattern and format parts. {{{2
|
||||
" If parsing fails, return [ '', '' ]
|
||||
function! s:ParsePattern(string)
|
||||
if a:string[0] != '/'
|
||||
return ['','']
|
||||
endif
|
||||
|
||||
let pat = '\\\@<!\%(\\\\\)\{-}\zs/' . tabular#ElementFormatPattern() . '*$'
|
||||
let format = matchstr(a:string[1:-1], pat)
|
||||
if !empty(format)
|
||||
let format = format[1 : -1]
|
||||
let pattern = a:string[1 : -len(format) - 2]
|
||||
else
|
||||
let pattern = a:string[1 : -1]
|
||||
endif
|
||||
|
||||
return [pattern, format]
|
||||
endfunction
|
||||
|
||||
" Split apart a list of | separated expressions. {{{2
|
||||
function! s:SplitCommands(string)
|
||||
if a:string =~ '^\s*$'
|
||||
return []
|
||||
endif
|
||||
|
||||
let end = match(a:string, "[\"'|]")
|
||||
|
||||
" Loop until we find a delimiting | or end-of-string
|
||||
while end != -1 && (a:string[end] != '|' || a:string[end+1] == '|')
|
||||
if a:string[end] == "'"
|
||||
let end = match(a:string, "'", end+1) + 1
|
||||
if end == 0
|
||||
throw "No matching end single quote"
|
||||
endif
|
||||
elseif a:string[end] == '"'
|
||||
" Find a " preceded by an even number of \ (or 0)
|
||||
let pattern = '\%(\\\@<!\%(\\\\\)*\)\@<="'
|
||||
let end = matchend(a:string, pattern, end+1) + 1
|
||||
if end == 0
|
||||
throw "No matching end double quote"
|
||||
endif
|
||||
else " Found ||
|
||||
let end += 2
|
||||
endif
|
||||
|
||||
let end = match(a:string, "[\"'|]", end)
|
||||
endwhile
|
||||
|
||||
if end == 0 || a:string[0 : end - (end > 0)] =~ '^\s*$'
|
||||
throw "Empty element"
|
||||
endif
|
||||
|
||||
if end == -1
|
||||
let rv = [ a:string ]
|
||||
else
|
||||
let rv = [ a:string[0 : end-1] ] + s:SplitCommands(a:string[end+1 : -1])
|
||||
endif
|
||||
|
||||
return rv
|
||||
endfunction
|
||||
|
||||
" Public Things {{{1
|
||||
|
||||
" Command associating a command name with a simple pattern command {{{2
|
||||
" AddTabularPattern[!] [<buffer>] name /pattern[/format]
|
||||
"
|
||||
" If <buffer> is provided, the command will only be available in the current
|
||||
" buffer, and will be used instead of any global command with the same name.
|
||||
"
|
||||
" If a command with the same name and scope already exists, it is an error,
|
||||
" unless the ! is provided, in which case the existing command will be
|
||||
" replaced.
|
||||
"
|
||||
" pattern is a regex describing the delimiter to be used.
|
||||
"
|
||||
" format describes the format pattern to be used. The default will be used if
|
||||
" none is provided.
|
||||
com! -nargs=+ -bang AddTabularPattern
|
||||
\ call AddTabularPattern(<q-args>, <bang>0)
|
||||
|
||||
function! AddTabularPattern(command, force)
|
||||
try
|
||||
let [ commandmap, rest ] = s:ChooseCommandMap(a:command)
|
||||
|
||||
let name = matchstr(rest, '.\{-}\ze\s*/')
|
||||
let pattern = substitute(rest, '.\{-}\s*\ze/', '', '')
|
||||
|
||||
let [ pattern, format ] = s:ParsePattern(pattern)
|
||||
|
||||
if empty(name) || empty(pattern)
|
||||
throw "Invalid arguments!"
|
||||
endif
|
||||
|
||||
if !a:force && has_key(commandmap, name)
|
||||
throw string(name) . " is already defined, use ! to overwrite."
|
||||
endif
|
||||
|
||||
let command = "tabular#TabularizeStrings(a:lines, " . string(pattern)
|
||||
|
||||
if !empty(format)
|
||||
let command .= ", " . string(format)
|
||||
endif
|
||||
|
||||
let command .= ")"
|
||||
|
||||
let commandmap[name] = { 'pattern' : pattern, 'commands' : [ command ] }
|
||||
catch
|
||||
echohl ErrorMsg
|
||||
echomsg "AddTabularPattern: " . v:exception
|
||||
echohl None
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Command associating a command name with a pipeline of functions {{{2
|
||||
" AddTabularPipeline[!] [<buffer>] name /pattern/ func [ | func2 [ | func3 ] ]
|
||||
"
|
||||
" If <buffer> is provided, the command will only be available in the current
|
||||
" buffer, and will be used instead of any global command with the same name.
|
||||
"
|
||||
" If a command with the same name and scope already exists, it is an error,
|
||||
" unless the ! is provided, in which case the existing command will be
|
||||
" replaced.
|
||||
"
|
||||
" pattern is a regex that will be used to determine which lines will be
|
||||
" filtered. If the cursor line doesn't match the pattern, using the command
|
||||
" will be a no-op, otherwise the cursor and all contiguous lines matching the
|
||||
" pattern will be filtered.
|
||||
"
|
||||
" Each 'func' argument represents a function to be called. This function
|
||||
" will have access to a:lines, a List containing one String per line being
|
||||
" filtered.
|
||||
com! -nargs=+ -bang AddTabularPipeline
|
||||
\ call AddTabularPipeline(<q-args>, <bang>0)
|
||||
|
||||
function! AddTabularPipeline(command, force)
|
||||
try
|
||||
let [ commandmap, rest ] = s:ChooseCommandMap(a:command)
|
||||
|
||||
let name = matchstr(rest, '.\{-}\ze\s*/')
|
||||
let pattern = substitute(rest, '.\{-}\s*\ze/', '', '')
|
||||
|
||||
let commands = matchstr(pattern, '^/.\{-}\\\@<!\%(\\\\\)\{-}/\zs.*')
|
||||
let pattern = matchstr(pattern, '/\zs.\{-}\\\@<!\%(\\\\\)\{-}\ze/')
|
||||
|
||||
if empty(name) || empty(pattern)
|
||||
throw "Invalid arguments!"
|
||||
endif
|
||||
|
||||
if !a:force && has_key(commandmap, name)
|
||||
throw string(name) . " is already defined, use ! to overwrite."
|
||||
endif
|
||||
|
||||
let commandlist = s:SplitCommands(commands)
|
||||
|
||||
if empty(commandlist)
|
||||
throw "Must provide a list of functions!"
|
||||
endif
|
||||
|
||||
let commandmap[name] = { 'pattern' : pattern, 'commands' : commandlist }
|
||||
catch
|
||||
echohl ErrorMsg
|
||||
echomsg "AddTabularPipeline: " . v:exception
|
||||
echohl None
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Tabularize /pattern[/format] {{{2
|
||||
" Tabularize name
|
||||
"
|
||||
" Align text, either using the given pattern, or the command associated with
|
||||
" the given name.
|
||||
com! -nargs=* -range -complete=customlist,<SID>CompleteTabularizeCommand
|
||||
\ Tabularize <line1>,<line2>call Tabularize(<q-args>)
|
||||
|
||||
function! Tabularize(command, ...) range
|
||||
let piperange_opt = {}
|
||||
if a:0
|
||||
let piperange_opt = a:1
|
||||
endif
|
||||
|
||||
if empty(a:command)
|
||||
if !exists("s:last_tabularize_command")
|
||||
echohl ErrorMsg
|
||||
echomsg "Tabularize hasn't been called yet; no pattern/command to reuse!"
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
else
|
||||
let s:last_tabularize_command = a:command
|
||||
endif
|
||||
|
||||
let command = s:last_tabularize_command
|
||||
|
||||
let range = a:firstline . ',' . a:lastline
|
||||
|
||||
try
|
||||
let [ pattern, format ] = s:ParsePattern(command)
|
||||
|
||||
if !empty(pattern)
|
||||
let cmd = "tabular#TabularizeStrings(a:lines, " . string(pattern)
|
||||
|
||||
if !empty(format)
|
||||
let cmd .= "," . string(format)
|
||||
endif
|
||||
|
||||
let cmd .= ")"
|
||||
|
||||
exe range . 'call tabular#PipeRangeWithOptions(pattern, [ cmd ], '
|
||||
\ . 'piperange_opt)'
|
||||
else
|
||||
if exists('b:TabularCommands') && has_key(b:TabularCommands, command)
|
||||
let usercmd = b:TabularCommands[command]
|
||||
elseif has_key(s:TabularCommands, command)
|
||||
let usercmd = s:TabularCommands[command]
|
||||
else
|
||||
throw "Unrecognized command " . string(command)
|
||||
endif
|
||||
|
||||
exe range . 'call tabular#PipeRangeWithOptions(usercmd["pattern"], '
|
||||
\ . 'usercmd["commands"], piperange_opt)'
|
||||
endif
|
||||
catch
|
||||
echohl ErrorMsg
|
||||
echomsg "Tabularize: " . v:exception
|
||||
echohl None
|
||||
return
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" GTabularize /pattern[/format] {{{2
|
||||
" GTabularize name
|
||||
"
|
||||
" Align text on only matching lines, either using the given pattern, or the
|
||||
" command associated with the given name. Mnemonically, this is similar to
|
||||
" the :global command, which takes some action on all rows matching a pattern
|
||||
" in a range. This command is different from normal :Tabularize in 3 ways:
|
||||
" 1) If a line in the range does not match the pattern, it will be left
|
||||
" unchanged, and not in any way affect the outcome of other lines in the
|
||||
" range (at least, normally - but Pipelines can and will still look at
|
||||
" non-matching rows unless they are specifically written to be aware of
|
||||
" tabular#DoGTabularize() and handle it appropriately).
|
||||
" 2) No automatic range determination - :Tabularize automatically expands
|
||||
" a single-line range (or a call with no range) to include all adjacent
|
||||
" matching lines. That behavior does not make sense for this command.
|
||||
" 3) If called without a range, it will act on all lines in the buffer (like
|
||||
" :global) rather than only a single line
|
||||
com! -nargs=* -range=% -complete=customlist,<SID>CompleteTabularizeCommand
|
||||
\ GTabularize <line1>,<line2>
|
||||
\ call Tabularize(<q-args>, { 'mode': 'GTabularize' } )
|
||||
|
||||
" Stupid vimscript crap, part 2 {{{1
|
||||
let &cpo = s:savecpo
|
||||
unlet s:savecpo
|
||||
|
||||
" vim:set sw=2 sts=2 fdm=marker:
|
|
@ -3,6 +3,11 @@
|
|||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
" License: WTFPL
|
||||
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax_save = b:current_syntax
|
||||
endif
|
||||
|
||||
" Inherit coffee from html so coffeeComment isn't redefined and given higher
|
||||
" priority than hamlInterpolation.
|
||||
syn cluster hamlCoffeescript contains=@htmlCoffeeScript
|
||||
|
@ -11,3 +16,8 @@ syn region hamlCoffeescriptFilter matchgroup=hamlFilter
|
|||
\ end="^\%(\z1 \| *$\)\@!"
|
||||
\ contains=@hamlCoffeeScript,hamlInterpolation
|
||||
\ keepend
|
||||
|
||||
if exists('s:current_syntax_save')
|
||||
let b:current_syntax = s:current_syntax_save
|
||||
unlet s:current_syntax_save
|
||||
endif
|
||||
|
|
|
@ -3,9 +3,18 @@
|
|||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
" License: WTFPL
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax_save = b:current_syntax
|
||||
endif
|
||||
|
||||
" Syntax highlighting for text/coffeescript script tags
|
||||
syn include @htmlCoffeeScript syntax/coffee.vim
|
||||
syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
|
||||
\ end=#</script>#me=s-1 keepend
|
||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||
\ containedin=htmlHead
|
||||
|
||||
if exists('s:current_syntax_save')
|
||||
let b:current_syntax = s:current_syntax_save
|
||||
unlet s:current_syntax_save
|
||||
endif
|
||||
|
|
|
@ -32,7 +32,7 @@ hi def link coffeeConditional Conditional
|
|||
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
|
||||
hi def link coffeeException Exception
|
||||
|
||||
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\)\>/
|
||||
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\)\>/
|
||||
\ display
|
||||
" The `own` keyword is only a keyword after `for`.
|
||||
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
|
||||
|
@ -107,7 +107,7 @@ hi def link coffeeFloat Float
|
|||
|
||||
" An error for reserved keywords, taken from the RESERVED array:
|
||||
" http://coffeescript.org/documentation/docs/lexer.html#section-67
|
||||
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
|
||||
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|native\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
|
||||
\ display
|
||||
hi def link coffeeReservedError Error
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ the `<F7>` key if so. For example, to remap it to `<F3>` instead, use:
|
|||
|
||||
For flake8 configuration options please consult the following page:
|
||||
|
||||
https://flake8.readthedocs.org/en/latest/config.html
|
||||
http://flake8.pycqa.org/en/latest/user/configuration.html
|
||||
|
||||
To customize the location of your flake8 binary, set `g:flake8_cmd`:
|
||||
|
||||
|
@ -108,6 +108,20 @@ This plugin goes well together with the following plugin:
|
|||
and `<F9>`)
|
||||
|
||||
|
||||
Max line lengths
|
||||
----------------
|
||||
|
||||
One particular customization a lot of people like to make is relaxing the
|
||||
maximum line length default. This is a config setting that should be set in
|
||||
flake8 itself. (vim-flake8 "just" invokes it and deals with showing the output
|
||||
in Vim's quickfix window.)
|
||||
|
||||
To do so, put the following into your `~/.config/flake8` file:
|
||||
|
||||
[flake8]
|
||||
max-line-length = 120
|
||||
|
||||
|
||||
History
|
||||
-------
|
||||
1.6: Deprecated configuring flake8 options through Vim settings. Instead,
|
||||
|
|
|
@ -468,8 +468,8 @@ endfun
|
|||
function! s:repo_aliases() dict abort
|
||||
if !has_key(self,'_aliases')
|
||||
let self._aliases = {}
|
||||
for line in split(self.git_chomp('config','--get-regexp','^alias[.]'),"\n")
|
||||
let self._aliases[matchstr(line,'\.\zs\S\+')] = matchstr(line,' \zs.*')
|
||||
for line in split(self.git_chomp('config','-z','--get-regexp','^alias[.]'),"\1")
|
||||
let self._aliases[matchstr(line, '\.\zs.\{-}\ze\n')] = matchstr(line, '\n\zs.*')
|
||||
endfor
|
||||
endif
|
||||
return self._aliases
|
||||
|
@ -859,7 +859,7 @@ function! s:StageUndo() abort
|
|||
let hash = repo.git_chomp('hash-object', '-w', filename)
|
||||
if !empty(hash)
|
||||
if section ==# 'untracked'
|
||||
call repo.git_chomp_in_tree('clean', '--', filename)
|
||||
call repo.git_chomp_in_tree('clean', '-f', '--', filename)
|
||||
elseif section ==# 'unmerged'
|
||||
call repo.git_chomp_in_tree('rm', '--', filename)
|
||||
elseif section ==# 'unstaged'
|
||||
|
@ -1776,13 +1776,17 @@ function! s:Diff(vert,keepfocus,...) abort
|
|||
let nr = bufnr('')
|
||||
execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
|
||||
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
||||
let nr2 = bufnr('')
|
||||
call s:diffthis()
|
||||
wincmd p
|
||||
execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
|
||||
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
||||
let nr3 = bufnr('')
|
||||
call s:diffthis()
|
||||
wincmd p
|
||||
call s:diffthis()
|
||||
execute 'nnoremap <buffer> <silent> d2o :diffget '.nr2.'<Bar>diffupdate<CR>'
|
||||
execute 'nnoremap <buffer> <silent> d3o :diffget '.nr3.'<Bar>diffupdate<CR>'
|
||||
return post
|
||||
elseif len(args)
|
||||
let arg = join(args, ' ')
|
||||
|
@ -2317,7 +2321,7 @@ function! s:Browse(bang,line1,count,...) abort
|
|||
if empty(url) && raw ==# '.'
|
||||
call s:throw("Instaweb failed to start")
|
||||
elseif empty(url)
|
||||
call s:throw('"'.remote."' is not a supported remote")
|
||||
call s:throw("'".remote."' is not a supported remote")
|
||||
endif
|
||||
|
||||
let url = s:gsub(url, '[ <>]', '\="%".printf("%02X",char2nr(submatch(0)))')
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
### Actual behavior
|
||||
### Behavior
|
||||
|
||||
Write here what's happening ...
|
||||
|
||||
### Expected behavior
|
||||
|
||||
Write here what you're expecting ...
|
||||
Write here what's happening and what you're expecting instead of...
|
||||
|
||||
### Steps to reproduce:
|
||||
|
||||
Please create a reproducible case of your problem. Re produce it
|
||||
with a minimal `vimrc` with all plugins disabled and only `vim-go`
|
||||
enabled:
|
||||
Please create a reproducible case of your problem. If this step is
|
||||
not provided, the issue will be **closed**
|
||||
|
||||
Re produce it with a minimal `vimrc` with all plugins disabled and
|
||||
only `vim-go` enabled:
|
||||
|
||||
1.
|
||||
2.
|
||||
|
@ -22,7 +20,7 @@ Add here your current configuration and additional information that might be
|
|||
useful, such as:
|
||||
|
||||
* `vimrc` you used to reproduce
|
||||
* vim version:
|
||||
* vim-go version
|
||||
* go version
|
||||
* vim version:
|
||||
* vim-go version:
|
||||
* go version:
|
||||
|
||||
|
|
1
sources_non_forked/vim-go/.gitignore
vendored
1
sources_non_forked/vim-go/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
doc/tags
|
||||
.DS_Store
|
||||
|
|
|
@ -1,17 +1,203 @@
|
|||
## 1.8 (unplanned)
|
||||
## 1.11 - Unplanned
|
||||
|
||||
FEATURES:
|
||||
|
||||
* If you open a new buffer with a Go filename it get automatically populated based on the directory. If there are no Go files a simple main package is created, otherwise the file will include the package declaration line based on the package in the current directory. Checkout the demo to see it in action: https://twitter.com/fatih/status/748333086643994624. This is enabled by default. Can be disabled with `let g:go_template_autocreate = 0`. You can use your own template with `let g:go_template_file = "foo.go"` and putting the file under the `templates/` folder. [gh-918]
|
||||
* The snippet expansion `json` is now much more smarter. It pre populates the placeholder according to the first word and it also applies `snake_case` or `camelCase` conversion. Checkout the demo to see it in action: https://github.com/fatih/vim-go/pull/927 [gh-927]
|
||||
* **`:GoSameIds`** support. When called highlights all same identifiers in the current file. Can be also enabled to highlight identifiers automatically. Checkout the demo to see it in action: https://twitter.com/fatih/status/753673709278339072. [gh-936]
|
||||
* Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055]
|
||||
* Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* Add `statusline` support for `:GoMetaLinter` [gh-1120]
|
||||
* Quickfix and Location lists contain now a descriptive title (requires at least Vim `7.4.2200`)[gh-1004]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* Always use full path to detect packages to be shown in statusline [gh-1121]
|
||||
* Use `echom` to persist errors in case of multiple echos [gh-1122]
|
||||
* Fix a race condition where a quickfix window was not closed if a job has succeeded [gh-1123]
|
||||
* Do not expand coverage arguments for non job execution of `:GoCoverage` [gh-1127]
|
||||
* `:GoCoverage` doesn't mess up custom syntax anymore [gh-1128]
|
||||
* Disable autoformat for `asm` files as they might be non Go ASM format [gh-1141]
|
||||
* Fix indentation broken when using a action with a minus sign like `{{-` [gh-1143]
|
||||
* Fix breaking Neovim change of passing less arguments to callbacks [gh-1145]
|
||||
* Fix `guru` commands if custom build tags were set [gh-1136]
|
||||
* Fix referencing a non defined variable for async commands when bang (!) was used
|
||||
* Fix `:GoDef` failing for a modified buffer if `hidden` was not set [gh-1132]
|
||||
* Fix `:GoDefStack` to allow popping from jump list when buffer is modified [gh-1133]
|
||||
|
||||
|
||||
## 1.10 (November 24, 2016)
|
||||
|
||||
FEATURES:
|
||||
|
||||
* **Vim 8.0 support!** This is the initial version to add Vim 8.0 based support to
|
||||
all basic commands (check out below for more information). With time we'll
|
||||
going to extend it to other commands. All the features are only enabled if
|
||||
you have at least Vim 8.0.0087. Backwards compatible with Vim 7.4.x.
|
||||
If you see any problems, please open an issue.
|
||||
|
||||
* We have now a [logo for vim-go](https://github.com/fatih/vim-go/blob/master/assets/vim-go.png)! Thanks to @egonelbre for his work on this.
|
||||
* `:GoBuild`, `:GoTest`, `:GoTestCompile`, `:GoInstall` commands are now fully
|
||||
async. Async means it doesn't block your UI anymore. If the command finished
|
||||
it echoes the status. For a better experience use the statusline information
|
||||
(more info below)
|
||||
|
||||
* `:GoCoverage` and `:GoCoverageBrowser` commands are fully async.
|
||||
* `:GoDef` is fully async if `guru` is used as command.
|
||||
* `:GoRename` is fully async .
|
||||
|
||||
* `:GoMetaLinter` is fully asnyc. Also works with the current autosave linting
|
||||
feature. As a reminder, to enable auto linting on save either call
|
||||
`:GoMetaLinterAutoSaveToggle` (temporary) or add `let
|
||||
g:go_metalinter_autosave = 1` (persistent) to your virmc).
|
||||
|
||||
* All `guru` commands run asynchronously if Vim 8.0 is being used. Current
|
||||
Commands:
|
||||
* GoImplements
|
||||
* GoWhicherrs
|
||||
* GoCallees
|
||||
* GoDescribe
|
||||
* GoCallers
|
||||
* GoCallstack
|
||||
* GoFreevars
|
||||
* GoChannelPeers
|
||||
* GoReferrers
|
||||
|
||||
* `:GoSameIds` also runs asynchronously. This makes it useful especially for
|
||||
auto sameids mode. In this mode it constantly evaluates the identifier under the
|
||||
cursor whenever it's in hold position and then calls :GoSameIds. As a
|
||||
reminder, to enable auto info either call `:GoSameIdsAutoToggle`(temporary)
|
||||
or add `let g:go_auto_sameids = 1` (persistent) to your vimrc.
|
||||
|
||||
* `:GoInfo` is now non blocking and works in async mode if `guru` is used in
|
||||
`g:go_info_mode`. This makes it useful especially for autoinfo mode. In this
|
||||
mode it constantly evaluates the identifier under the cursor whenever it's in
|
||||
hold position and then calls :GoInfo. As a reminder, to enable auto info
|
||||
either call `:GoAutoTypeInfoToggle`(temporary) or add `let
|
||||
g:go_auto_type_info = 1` (persistent) to your vimrc. To use `guru` instead of
|
||||
`gocode` add following to your vimrc: `let g:go_info_mode = 'guru'`
|
||||
|
||||
The `guru` is more accurate and reliabed due the usage of `guru` describe. It
|
||||
doesn't rely on `pkg/` folder like `gocode` does. However it's slower than
|
||||
`gocode` as there is no caching mechanism in `guru` yet.
|
||||
|
||||
* **New**: Statusline function: `go#statusline#Show()` which can be plugged into
|
||||
the statusline bar. Works only with vim 8.0. It shows all asynchronously
|
||||
called functions status real time. Checkout it in action:
|
||||
https://twitter.com/fatih/status/800473735467847680. To enable it add the
|
||||
following to your `vimrc`. If you use lightline, airline, .. check out their
|
||||
respective documentation on how to add a custom function:
|
||||
|
||||
```viml
|
||||
" go command status (requires vim-go)
|
||||
set statusline+=%#goStatuslineColor#
|
||||
set statusline+=%{go#statusline#Show()}
|
||||
set statusline+=%*
|
||||
```
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* **:GoDocBrowser** is now capable to to understand the identifier under the cursor (just like :GoDoc)
|
||||
* Function calls are now highlighted as well when `g:go_highlight_functions` is enabled [gh-1048]
|
||||
* Add completion support for un-imported packages. This allows to complete even
|
||||
if the package is not imported. By default it's disabled, enable by adding
|
||||
`let g:go_gocode_unimported_packages = 1` [gh-1084]
|
||||
* Tools that embeds GOROOT into their binaries do not work when people update
|
||||
their Go version and the GOROOT contains the vesion as part of their path
|
||||
(i.e: `/usr/local/Cellar/go/1.7.2/libexec`, [more
|
||||
info](https://blog.filippo.io/stale-goroot-and-gorebuild/)) . This is now
|
||||
fixed by introducing automatic GOROOT set/unset before each tool invoke.
|
||||
[gh-954]
|
||||
* Added new setting `g:go_echo_go_info` to enable/disable printing identifier
|
||||
information when completion is done [gh-1101]
|
||||
* Added new `go_echo_command_info` setting is added, which is enabled by
|
||||
default. It's just a switch for disabling messages of commands, such as
|
||||
`:GoBuild`, `:GoTest`, etc.. Useful to *disable* if `go#statusline#Show()` is
|
||||
being used in Statusline, to prevent to see duplicates notifications.
|
||||
* goSameId highlighting is now linked to `Search`, which is much more clear as
|
||||
it changes according to the users colorscheme
|
||||
* Add plug mapping `(go-lint)` for :GoLint [gh-1089]
|
||||
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* Change back nil and iota highlighting color to the old type [gh-1049]
|
||||
* Fix passing arguments to `:GoBuild` while using NeoVim [gh-1062]
|
||||
* Do not open a split if `:GoDef` is used on a modified file [gh-1083]
|
||||
* Highlight nested structs correctly [gh-1075]
|
||||
* Highlight builtin functions correctly if `g:go_highlight_functions` is enabled [gh-1070]
|
||||
* Fix `:GoSameIds` highlighting if a new buffer is opened in the same window [gh-1067]
|
||||
* Internal: add `abort` to all vim function to return in case of errors [gh-1100]
|
||||
* Fix `:GoCoverage` to be executed if working dir is not inside the test dir [gh-1033]
|
||||
|
||||
BACKWARDS INCOMPATIBILITIES:
|
||||
|
||||
* remove vim-dispatch and vimproc.vim support. vim 8.0 has now the necessary
|
||||
API to invoke async jobs and timers. Going forward we should use those. Also
|
||||
this will remove the burden to maintain compatibility with those plugins.
|
||||
|
||||
* `go#jobcontrol#Statusline()` is removed in favor of the new, global and
|
||||
extensible `go#statusline#Show()`
|
||||
|
||||
## 1.9 (September 13, 2016)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
* **guru** uses now the `-modified` flag, which allows us use guru on modified
|
||||
buffers as well. This affects all commands where `guru` is used. Such as
|
||||
`:GoDef`, `:GoReferrers`, etc.. [gh-944]
|
||||
* **:GoDoc** uses now the `-modified` flag under the hood (for `gogetdoc), which allows us to get documentation for the identifier under the cursor ina modified buffer. [gh-1014]
|
||||
* Cleanup and improve documentation [gh-987]
|
||||
* Add new `g:go_gocode_socket_type` setting to change the underlying socket type passed to `gocode`. Usefull to fallback to `tcp` on cases such as Bash on Windows [gh-1000]
|
||||
* `:GoSameIds` is now automatically re-evaluated in cases of buffer reloads (such as `:GoRename`) [gh-998]
|
||||
* Improve docs about `go_auto_sameids` [gh-1017]
|
||||
* Improve error message by printing the full path if an incompatible `goimports` is being used [gh-1006]
|
||||
* `iota` and `nil` are now highlighted correctly and are not treated as booleans [gh-1030]
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
* Fix system calls on Windows [gh-988]
|
||||
* Fix :GoSameIds and :GoCoverage for light background and after changing color schemes [gh-983]
|
||||
* Fix TagBar and `GoCallers` for Windows user [gh-999]
|
||||
* Set updatetime for for `auto_sameids` feature as well [gh-1016]
|
||||
* Update docs about missing `go_highlight_generate_tags` setting [gh-1023]
|
||||
* Fix updating the jumplist if `:GoDef` is used [gh-1029]
|
||||
* Fix highlighting literal percent sign (`%%`) in strings [gh-1011]
|
||||
* Fix highlighting of nested fields [gh-1007]
|
||||
* Fix checking for `exepath` feature for the upcoming vim 8.0 release [gh-1046]
|
||||
|
||||
BACKWARDS INCOMPATIBILITIES:
|
||||
|
||||
* Rename `GoMetalinterAutoSaveToggle` to `GoMetaLinterAutoSaveToggle` to make it compatible with the existing `:GoMetaLinter` command [gh-1020]
|
||||
|
||||
## 1.8 (July 31, 2016)
|
||||
|
||||
FEATURES:
|
||||
* New **`:GoAddTags`** command that adds field tags for the fields of a struct automatically based on the field names. Checkout the demo to see it in action: https://twitter.com/fatih/status/759822857773907968 [gh-971]
|
||||
* The snippet expansion `json` is now much more smarter. It pre populates the placeholder according to the first word and it also applies `snake_case` or `camelCase` conversion. Together with `:GoAddTags` it gives `vim-go` users flexible ways of populating a field tag. Checkout the demo to see it in action: https://twitter.com/fatih/status/754477622042689536 [gh-927]
|
||||
* New **`:GoSameIds`** command. When called highlights all same identifiers in the current file. Can be also enabled to highlight identifiers automatically (with `:GoSameIdsAutoToggle` or `g:go_auto_sameids`). Checkout the demo to see it in action: https://twitter.com/fatih/status/753673709278339072. [gh-936]
|
||||
* New **`:GoWhicherrs`** command. It shows all possible values of the selected error variable. [gh-948]
|
||||
* Add new `errp` snippet to expand an `if err != nil { panic() }` clause [gh-926]
|
||||
* If you open a new buffer with a Go filename it get automatically populated based on the directory. If there are no Go files a simple main package is created, otherwise the file will include the package declaration line based on the package in the current directory. Checkout the demo to see it in action: https://twitter.com/fatih/status/748333086643994624. This is enabled by default. Can be disabled with `let g:go_template_autocreate = 0`. You can use your own template with `let g:go_template_file = "foo.go"` and putting the file under the `templates/` folder. [gh-918]
|
||||
* Added new toggle commands to enable/disable feature that run for your
|
||||
automatic. For example if you have `let g:go_auto_type_info = 1` enabled, you
|
||||
can now easily enable/disable it on the fly. Support added with the following
|
||||
commands: `:GoAutoTypeInfoToggle`, `:GoFmtAutoSaveToggle`,
|
||||
`:GoAsmFmtAutoSaveToggle`, `:GoMetalinterAutoSaveToggle`,
|
||||
`:GoTemplateAutoCreateToggle` [gh-945]
|
||||
|
||||
|
||||
IMPROVEMENTS:
|
||||
* `:GoDoc` accepts arguments now which are passed directly to `godoc`. So usages like `:GoDoc flag` works again (it was changed in previous versions [gh-894]
|
||||
* `:GoDef` works now for modified files as well [gh-910]
|
||||
* Internal: pass filename to the `--srcdir` flag to enable upcoming `goimports` features [gh-957]
|
||||
* Internal: fix indentations on all files to **2-spaces/no tabs**. This is now the default vim-go style across all VimL files [gh-915]
|
||||
* Internal: autocmd settings can be now dynamically enabled/disabled [gh-939]
|
||||
* Internal: automatically detect `GOPATH` for :GoInstall [gh-980]
|
||||
* Internal: shell executions uses now by default `sh` and then resets it back to the user preference. [gh-967]
|
||||
* Syntax: improved syntax highglighting performance for methods, fields, structs and interface type declarations [gh-917]
|
||||
* Syntax: moved `:GoCoverage` highlight definition into go's syntax file for more customizability [gh-962]
|
||||
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
|
@ -21,6 +207,7 @@ BUG FIXES:
|
|||
* Fix `:GoFmt` not picking up `-srcdir` if the command was set to use `goimports` [gh-904]
|
||||
* Fix `:GoTestCompile` to not leave behind artifacts if the cwd and the test files's directory do not match [gh-909]
|
||||
* Fix `:GoDocBrowser` to not fail if godoc doesn't exist [gh-920]
|
||||
* Fix `:GoFmt` to not change the permissions of saved file. Now original file permissions are restored [gh-922]
|
||||
|
||||
BACKWARDS INCOMPATIBILITIES:
|
||||
|
||||
|
|
|
@ -56,3 +56,5 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The Go gopher was designed by Renee French. http://reneefrench.blogspot.com/ The design is licensed under the Creative Commons 3.0 Attributions license. Read this article for more details: https://blog.golang.org/gopher
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# vim-go
|
||||
|
||||
<p align="center">
|
||||
<img style="float: right;" src="assets/vim-go.png" alt="Vim-go logo"/>
|
||||
</p>
|
||||
|
||||
Go (golang) support for Vim, which comes with pre-defined sensible settings (like
|
||||
auto gofmt on save), with autocomplete, snippet support, improved syntax
|
||||
highlighting, go toolchain commands, and more. If needed vim-go installs all
|
||||
|
@ -7,8 +11,6 @@ necessary binaries for providing seamless Vim integration with current
|
|||
commands. It's highly customizable and each individual feature can be
|
||||
disabled/enabled easily.
|
||||
|
||||
![vim-go](https://dl.dropboxusercontent.com/u/174404/vim-go-2.png)
|
||||
|
||||
## Features
|
||||
|
||||
* Improved Syntax highlighting with items such as Functions, Operators, Methods.
|
||||
|
@ -44,16 +46,20 @@ disabled/enabled easily.
|
|||
* Custom vim text objects such as `a function` or `inner function`
|
||||
list.
|
||||
* Jump to function or type declarations with `:GoDecls` or `:GoDeclsDir`
|
||||
* A async launcher for the go command is implemented for Neovim, fully async
|
||||
building and testing (beta).
|
||||
* Integrated with the Neovim terminal, launch `:GoRun` and other go commands
|
||||
in their own new terminal. (beta)
|
||||
* Vim 8.0 support. Async execution for most commands, various underlying improvements.
|
||||
* NeoVim support (beta). Async execution for some commands.
|
||||
* Alternate between implementation and test code with `:GoAlternate`
|
||||
|
||||
Checkout the official [tutorial](https://github.com/fatih/vim-go-tutorial)
|
||||
that goes literally over all features and shows many tips and tricks. It shows
|
||||
how to install vim-go and explains many unknown use cases. Recommended for
|
||||
beginners as well as advanced users: https://github.com/fatih/vim-go-tutorial
|
||||
|
||||
## Install
|
||||
|
||||
Master branch is supposed to be a development branch. So stuff here can break and change.
|
||||
Please try use always the [latest release](https://github.com/fatih/vim-go/releases/latest)
|
||||
Master branch is supposed to be a development branch. So stuff here can break
|
||||
and change. Please try use always the [latest
|
||||
release](https://github.com/fatih/vim-go/releases/latest)
|
||||
|
||||
Vim-go follows the standard runtime path structure, so I highly recommend to
|
||||
use a common and well known plugin manager to install vim-go. Do not use vim-go
|
||||
|
@ -69,6 +75,8 @@ command.
|
|||
* `NeoBundle 'fatih/vim-go'`
|
||||
* [Vundle](https://github.com/gmarik/vundle)
|
||||
* `Plugin 'fatih/vim-go'`
|
||||
* [Vim packages](http://vimhelp.appspot.com/repeat.txt.html#packages) (since Vim 7.4.1528)
|
||||
* `git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go`
|
||||
|
||||
Please be sure all necessary binaries are installed (such as `gocode`, `godef`,
|
||||
`goimports`, etc.). You can easily install them with the included
|
||||
|
@ -84,7 +92,8 @@ installed binaries.
|
|||
completion (completion by type) install:
|
||||
[neocomplete](https://github.com/Shougo/neocomplete.vim) for Vim or
|
||||
[deoplete](https://github.com/Shougo/deoplete.nvim) and
|
||||
[deoplete-go](https://github.com/zchee/deoplete-go) for NeoVim
|
||||
[deoplete-go](https://github.com/zchee/deoplete-go) for NeoVim or
|
||||
[SimpleAutoCmplPop](https://github.com/roxma/SimpleAutoComplPop)
|
||||
* To display source code tag information on a sidebar install
|
||||
[tagbar](https://github.com/majutsushi/tagbar).
|
||||
* For snippet features install:
|
||||
|
@ -226,9 +235,10 @@ let g:go_get_update = 0
|
|||
### Using with Neovim (beta)
|
||||
|
||||
Note: Neovim currently is not a first class citizen for vim-go. You are free
|
||||
to open bugs but I'm not going to look at them. Even though I'm using Neovim
|
||||
myself, Neovim itself is still alpha. So vim-go might not work well as good as
|
||||
in Vim. I'm happy to accept pull requests or very detailed bug reports.
|
||||
to open bug, however I'm not using Neovim so it's hard for me to test it.
|
||||
vim-go might not work well as good as in Vim. I'm happy to accept pull requests
|
||||
or very detailed bug reports. If you're interested to improve the state of
|
||||
Neovim in vim-go you're always welcome!
|
||||
|
||||
|
||||
Run `:GoRun` in a new tab, horizontal split or vertical split terminal
|
||||
|
@ -270,7 +280,6 @@ To resolve this:
|
|||
let g:go_list_type = "quickfix"
|
||||
```
|
||||
|
||||
|
||||
## More info
|
||||
|
||||
Check out the [Wiki](https://github.com/fatih/vim-go/wiki) page for more
|
||||
|
@ -282,8 +291,12 @@ other [various pieces](https://github.com/fatih/vim-go/wiki) of information.
|
|||
## Donation
|
||||
|
||||
People have asked for this for a long time, now you can be a fully supporter by
|
||||
[being a patron](https://www.patreon.com/fatih)! This is fully optional and is
|
||||
just a way to support vim-go's ongoing development directly. Thanks!
|
||||
[being a patron](https://www.patreon.com/fatih)!
|
||||
|
||||
By being a patron, you are enabling vim-go to grow and mature, helping me to
|
||||
invest in bug fixes, new documentation, and improving both current and future
|
||||
features. It's completely optional and is just a direct way to support Vim-go's
|
||||
ongoing development. Thanks!
|
||||
|
||||
[https://www.patreon.com/fatih](https://www.patreon.com/fatih)
|
||||
|
||||
|
|
BIN
sources_non_forked/vim-go/assets/screenshot.png
Normal file
BIN
sources_non_forked/vim-go/assets/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 747 KiB |
BIN
sources_non_forked/vim-go/assets/vim-go.png
Normal file
BIN
sources_non_forked/vim-go/assets/vim-go.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
821
sources_non_forked/vim-go/assets/vim-go.svg
Normal file
821
sources_non_forked/vim-go/assets/vim-go.svg
Normal file
|
@ -0,0 +1,821 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="173.53481mm"
|
||||
height="147.26407mm"
|
||||
viewBox="0 0 614.88711 521.80181"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="vim-go.svg"
|
||||
style="enable-background:new"
|
||||
inkscape:export-filename="F:\Go\src\github.com\egonelbre\vim-go\assets\vim-go.png"
|
||||
inkscape:export-xdpi="46.84"
|
||||
inkscape:export-ydpi="46.84">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="gopher-iris"
|
||||
osb:paint="solid"
|
||||
gradientTransform="translate(-9.2596241,38.869516)">
|
||||
<stop
|
||||
style="stop-color:#394455;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4317" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="docker-iris"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#394d54;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4311" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="docker-jaw"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#d4edf1;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4305" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="docker-eye"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4299" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="docker-line"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#394d54;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4293" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="docker-body"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#24b8eb;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4287" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="gopher-limbs"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#e1d6b9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4269" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="gopher-nose"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#e1d0cb;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4263" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="gopher-body"
|
||||
osb:paint="solid"
|
||||
gradientTransform="matrix(-0.18574987,-0.98259706,0.98259706,-0.18574987,-1213.2665,1828.8814)">
|
||||
<stop
|
||||
style="stop-color:#96d6ff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4334" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4253">
|
||||
<stop
|
||||
style="stop-color:#bce8ff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4194" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4182">
|
||||
<stop
|
||||
style="stop-color:#2e3436;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4184" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="gopher-eye"
|
||||
osb:paint="solid"
|
||||
gradientTransform="translate(381.30424,802.02286)">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4178" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="gopher-lines"
|
||||
osb:paint="solid"
|
||||
gradientTransform="matrix(2.0620253,3.9293227,1.3839016,-0.24027903,2506.9621,8572.3972)">
|
||||
<stop
|
||||
style="stop-color:#394655;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4166" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-lines"
|
||||
id="linearGradient4168"
|
||||
x1="776.14288"
|
||||
y1="39.505058"
|
||||
x2="822.42859"
|
||||
y2="39.505058"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92105265,0,0,0.92105265,79.548449,262.52483)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-eye"
|
||||
id="linearGradient4180"
|
||||
x1="776.14288"
|
||||
y1="90.770309"
|
||||
x2="822.42859"
|
||||
y2="90.770309"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92105266,0,0,0.92105266,124.54841,215.30684)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-body"
|
||||
id="linearGradient4336"
|
||||
x1="-628.69226"
|
||||
y1="371.77307"
|
||||
x2="-151.41731"
|
||||
y2="371.77307"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-1,0,0,1,-681.83098,347.55492)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-nose"
|
||||
id="linearGradient4265"
|
||||
x1="198.05417"
|
||||
y1="374.50043"
|
||||
x2="263.28683"
|
||||
y2="374.50043"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.65610141,0,0,0.65610141,185.97779,480.81383)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-limbs"
|
||||
id="linearGradient4271"
|
||||
x1="730.36273"
|
||||
y1="373.60995"
|
||||
x2="831.0592"
|
||||
y2="373.60995"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.90381797,-0.29515654,-0.62039307,-0.90381797,-597.71307,820.3894)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-limbs"
|
||||
id="linearGradient4273"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.54351115,-0.65417141,-1.0770811,0.54351115,655.01412,667.6722)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-limbs"
|
||||
id="linearGradient4275"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.94401471,-0.3302474,-0.32955964,0.94401471,1151.0861,721.50542)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-limbs"
|
||||
id="linearGradient4279"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.89463991,0.4064691,0.49110603,-0.89463991,-749.6705,579.40921)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-limbs"
|
||||
id="linearGradient4281"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.49170605,0.377674,2.0076181,-0.49170605,229.12024,357.65841)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-iris"
|
||||
id="linearGradient4319"
|
||||
x1="427.26477"
|
||||
y1="316.13431"
|
||||
x2="488.88409"
|
||||
y2="316.13431"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-1,0,0,1,744.54563,401.01143)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#gopher-iris"
|
||||
id="linearGradient4321"
|
||||
gradientTransform="matrix(5.6994379,2.2315229,-1.9072375,4.8711945,4487.6828,1182.8772)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.76274166"
|
||||
inkscape:cx="499.78979"
|
||||
inkscape:cy="92.336365"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer11"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="1912"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-global="false"
|
||||
showguides="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4305"
|
||||
originx="-15.732723"
|
||||
originy="-274.01154" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer11"
|
||||
inkscape:label="background"
|
||||
style="display:none"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#d3e5de;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4347"
|
||||
width="614.88708"
|
||||
height="521.80182"
|
||||
x="15.732722"
|
||||
y="256.54886"
|
||||
inkscape:export-filename="vim-go.png"
|
||||
inkscape:export-xdpi="46.84"
|
||||
inkscape:export-ydpi="46.84" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer6"
|
||||
inkscape:label="shadow"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2e4233;fill-opacity:0.10714285;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 287.3893,695.44531 c -50.0612,-2.78118 -62.1134,11.12305 -91.7793,11.12305 -29.6659,0 -47.28069,-6.48881 -76.01953,-1.85352 -28.738834,4.6353 -40.790093,3.70867 -55.623042,16.6875 -14.832949,12.97883 -21.926707,11.85327 -18.541016,20.39454 1.318705,3.32677 3.956373,1.53579 10.703125,0.83984 115.165183,-11.87969 237.050993,16.53486 337.406243,16.77539 83.20192,0.19942 110.33047,-21.09623 105.22253,-34.76541 -16.86616,-45.13499 -81.24683,-23.67849 -211.36901,-29.20139 z"
|
||||
id="path4349"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssssc" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
inkscape:label="cape-back"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<path
|
||||
style="fill:#0c7a31;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 260.24444,535.87695 c -20.68496,5.13447 -3.94094,36.63825 -23.78246,45.53288 -18.22356,8.16932 -29.87743,27.29784 -48.21487,37.53094 -24.3143,13.56845 -47.25416,17.93122 -70.94376,35.71927 -11.54022,8.66532 -48.036929,3.46906 -49.132109,17.96915 56.226929,-8.73065 86.269619,15.95087 120.882979,20.57024 30.54605,4.07656 53.64011,2.39756 79.48357,-7.50413 89.71977,-34.37532 52.16171,-111.74704 51.81195,-135.28471 -17.69563,-3.28964 -42.98659,-18.78289 -60.1053,-14.53364 z"
|
||||
id="path4321"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssscsscs" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer5"
|
||||
inkscape:label="gopher-body"
|
||||
style="display:inline;opacity:1"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<g
|
||||
style="display:inline;opacity:1"
|
||||
transform="matrix(-0.34823803,-0.28093567,-0.33018747,0.52325377,856.33627,409.62314)"
|
||||
id="g4537">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4275);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 419.84023,584.57289 c -1.11092,4.23495 -3.11543,7.14238 -5.84936,9.02308 -2.73394,1.8807 -6.19236,2.76095 -10.13743,3.23943 -3.94504,0.47846 -8.37351,0.59759 -13.05363,0.66122 -4.6801,0.0636 -9.60653,0.0259 -14.5852,-0.15006 -4.97865,-0.17599 -9.67742,-0.66266 -13.94891,-1.44453 -4.27148,-0.78187 -8.12262,-1.83504 -11.28827,-3.15781 -3.16564,-1.32277 -5.63542,-2.92368 -7.07427,-4.89074 -1.43884,-1.96709 -1.83785,-4.30021 -0.94134,-7.07932 0.89648,-2.77911 2.64686,-4.65171 5.05838,-5.71202 2.41152,-1.06032 5.47772,-1.29847 8.97039,-1.04717 3.49268,0.25132 7.40119,0.98198 11.60615,1.60695 4.20496,0.62498 8.71575,1.10136 13.55734,0.95747 4.84159,-0.14387 9.82241,-1.20624 14.59946,-2.18657 4.77703,-0.9803 9.35663,-1.80521 13.2055,-1.76209 3.8489,0.0431 6.93814,0.92314 8.72484,2.84805 1.78673,1.92488 0.0493,13.32997 1.15633,9.09414 z"
|
||||
id="path4539"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssssssssssssssssc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 411.66722,570.50504 c -3.64483,-0.3204 -7.91192,0.0353 -12.44327,0.67313 -5.17866,0.72899 -10.69026,1.78243 -16.25596,1.96339 -5.56571,0.181 -10.75654,-0.27799 -15.6406,-0.87383 -4.8841,-0.59575 -9.46828,-1.26261 -13.59381,-1.35067 -4.12552,-0.0881 -7.77812,0.41271 -10.6665,1.77043 -2.88834,1.35772 -5.00621,3.55109 -6.11385,6.60546 -1.10762,3.05438 -0.68341,5.7953 0.96623,8.19507 1.64966,2.39979 4.51594,4.46252 8.19691,6.21125 3.681,1.74874 8.16283,3.1933 13.12136,4.28264 4.95854,1.08935 10.4013,1.79657 16.15733,2.05756 5.756,0.26106 11.2421,0.29972 16.33832,0.21929 5.09618,-0.0804 9.79866,-0.25121 13.94009,-0.87517 1.57579,-0.23741 3.06793,-0.55279 4.47088,-0.96129 2.8331,-0.82603 3.60613,-5.66983 1.06694,-4.35369 -2.35253,1.21937 -5.13009,1.88834 -8.23473,2.27934 -3.78352,0.47652 -8.03435,0.60519 -12.52976,0.67623 -4.49538,0.071 -9.22983,0.0403 -14.01368,-0.12137 -4.78387,-0.16172 -9.29761,-0.62006 -13.39935,-1.36274 -4.10176,-0.74271 -7.79879,-1.74643 -10.8363,-3.01023 -3.03748,-1.2638 -5.40588,-2.79646 -6.78423,-4.6796 -1.37835,-1.88316 -1.75885,-4.11616 -0.89417,-6.78092 0.86467,-2.66475 2.54876,-4.4645 4.86314,-5.48862 2.31437,-1.0241 5.2526,-1.265 8.60072,-1.03925 3.34811,0.22576 7.09649,0.90864 11.13305,1.49473 4.03653,0.5862 8.37113,1.03632 13.02879,0.89877 4.65766,-0.13756 9.45383,-1.14909 14.04535,-2.09377 4.59152,-0.94468 8.9823,-1.75345 12.66755,-1.73592 0.46066,0.002 0.91144,0.0161 1.3482,0.0436 1.1223,0.0708 2.1698,0.20509 3.10067,0.47739 1.0735,0.314 2.95461,-2.6047 -0.11758,-2.94357 -0.49859,-0.055 -1.54942,0.19872 -1.52174,-0.17766 z"
|
||||
id="path4541"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csscsscssssssssssssssssssssccsssc" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(-0.20408679,0.36109427,0.8060854,0.48598006,286.09208,226.24278)"
|
||||
id="g4640"
|
||||
style="display:inline;opacity:1">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 767.29926,387.32674 c 11.1235,7.96555 31.77795,11.29978 44.73159,15.54502 12.95363,4.24526 18.14889,9.35948 22.12936,13.37285 3.98046,4.01338 5.94428,7.14463 4.71807,9.52723 -1.2262,2.38259 -5.54351,3.99405 -14.00119,4.81166 -8.45765,0.81761 -15.90978,0.12055 -23.02358,-1.72572 -7.11381,-1.84628 -13.80694,-4.86649 -21.70559,-8.603 -7.89866,-3.73649 -17.3272,-8.0507 -25.81115,-14.18439 -8.48395,-6.13369 -17.62324,-13.90003 -23.14238,-24.13356 -5.51915,-10.23352 -5.78201,-21.34406 -5.37146,-30.88264 0.41055,-9.53859 1.51092,-17.55377 2.71572,-23.74931 1.20482,-6.19553 2.71509,-10.67437 4.77102,-13.66952 2.05591,-2.99513 4.65165,-4.52673 7.71923,-4.52673 3.06759,0 5.70357,1.83092 7.62535,5.49926 1.9218,3.66832 3.04778,9.24444 3.28639,16.76004 0.23861,7.51561 -0.67126,17.08072 0.34029,27.19831 1.01155,10.1176 3.89485,20.79494 15.01833,28.7605 z"
|
||||
id="path4642"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4281);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 760.81735,387.61463 c 8.35351,7.22933 23.40419,11.34465 36.92829,14.85447 13.52408,3.50986 21.76315,7.50998 26.41399,11.29491 4.65086,3.78492 7.04347,6.96136 6.89289,9.28045 -0.15059,2.31908 -3.07202,3.85186 -9.99413,4.53735 -6.92209,0.68549 -13.12478,-0.17957 -19.18856,-2.15841 -6.06375,-1.97886 -12.01277,-5.06603 -19.62326,-8.64782 -7.61047,-3.5818 -16.94465,-7.61787 -24.98938,-13.21535 -8.04472,-5.59749 -15.82286,-12.65396 -20.9022,-21.24583 -5.07935,-8.59186 -6.01346,-17.801 -5.99188,-25.91871 0.0216,-8.1177 0.93462,-15.14861 1.86635,-20.66954 0.93173,-5.52092 2.01706,-9.59713 3.38259,-12.30465 1.36554,-2.70753 3.03466,-4.06947 5.01979,-4.01398 1.98511,0.0555 3.57672,1.84704 4.61437,5.2751 1.03765,3.42807 1.44745,8.54444 1.4737,15.15288 0.0262,6.60845 -0.43638,14.76057 0.91317,23.27473 1.34954,8.51418 4.83074,17.27506 13.18427,24.5044 z"
|
||||
id="path4644"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
</g>
|
||||
<g
|
||||
style="display:inline;opacity:1"
|
||||
id="g4594"
|
||||
transform="matrix(-0.13664232,-0.29657059,-0.88136995,0.09664282,727.56031,790.52022)">
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4588"
|
||||
d="m 767.29926,387.32674 c 11.1235,7.96555 31.77795,11.29978 44.73159,15.54502 12.95363,4.24526 18.14889,9.35948 22.12936,13.37285 3.98046,4.01338 5.94428,7.14463 4.71807,9.52723 -1.2262,2.38259 -5.54351,3.99405 -14.00119,4.81166 -8.45765,0.81761 -15.90978,0.12055 -23.02358,-1.72572 -7.11381,-1.84628 -13.80694,-4.86649 -21.70559,-8.603 -7.89866,-3.73649 -17.3272,-8.0507 -25.81115,-14.18439 -8.48395,-6.13369 -17.62324,-13.90003 -23.14238,-24.13356 -5.51915,-10.23352 -5.78201,-21.34406 -5.37146,-30.88264 0.41055,-9.53859 1.51092,-17.55377 2.71572,-23.74931 1.20482,-6.19553 2.71509,-10.67437 4.77102,-13.66952 2.05591,-2.99513 4.65165,-4.52673 7.71923,-4.52673 3.06759,0 5.70357,1.83092 7.62535,5.49926 1.9218,3.66832 3.04778,9.24444 3.28639,16.76004 0.23861,7.51561 -0.67126,17.08072 0.34029,27.19831 1.01155,10.1176 3.89485,20.79494 15.01833,28.7605 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="ellipse4590"
|
||||
d="m 760.81735,387.61463 c 8.35351,7.22933 23.40419,11.34465 36.92829,14.85447 13.52408,3.50986 21.76315,7.50998 26.41399,11.29491 4.65086,3.78492 7.04347,6.96136 6.89289,9.28045 -0.15059,2.31908 -3.07202,3.85186 -9.99413,4.53735 -6.92209,0.68549 -13.12478,-0.17957 -19.18856,-2.15841 -6.06375,-1.97886 -12.01277,-5.06603 -19.62326,-8.64782 -7.61047,-3.5818 -16.94465,-7.61787 -24.98938,-13.21535 -8.04472,-5.59749 -15.82286,-12.65396 -20.9022,-21.24583 -5.07935,-8.59186 -6.01346,-17.801 -5.99188,-25.91871 0.0216,-8.1177 0.93462,-15.14861 1.86635,-20.66954 0.93173,-5.52092 2.01706,-9.59713 3.38259,-12.30465 1.36554,-2.70753 3.03466,-4.06947 5.01979,-4.01398 1.98511,0.0555 3.57672,1.84704 4.61437,5.2751 1.03765,3.42807 1.44745,8.54444 1.4737,15.15288 0.0262,6.60845 -0.43638,14.76057 0.91317,23.27473 1.34954,8.51418 4.83074,17.27506 13.18427,24.5044 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4271);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
<g
|
||||
style="display:inline"
|
||||
id="g4533-2"
|
||||
transform="matrix(-0.60102903,0.32221978,0.53870829,0.77401445,526.12645,47.501077)" />
|
||||
<g
|
||||
style="opacity:1"
|
||||
transform="matrix(-0.32879267,0.17361606,0.20143296,0.28338802,143.13323,319.59452)"
|
||||
id="g4404">
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4406"
|
||||
d="m -626.54672,402.3529 c 2.22767,10.86299 0.34493,21.82632 -3.86747,31.42527 -4.21252,9.59894 -10.55173,17.86115 -17.72096,24.29983 -7.1694,6.43883 -15.25476,11.10591 -24.5716,13.61353 -9.31698,2.50761 -20.94966,4.46936 -31.63903,1.98398 -10.68939,-2.48537 -18.0688,-9.22838 -24.09401,-15.89285 -6.02508,-6.66442 -12.35923,-14.47524 -22.96531,-22.06805 -10.60584,-7.59266 -20.8648,-15.59839 -25.16123,-23.3775 -4.29632,-7.77931 -7.008,-15.66934 -7.81517,-23.39095 -0.80717,-7.7215 0.35908,-14.55922 3.12288,-20.54462 2.76393,-5.98548 7.12557,-11.1208 12.7854,-15.40902 5.65998,-4.28811 12.61751,-7.73606 20.64204,-10.24271 8.02465,-2.50651 17.11262,-4.07552 27.13941,-4.41504 10.0268,-0.3395 20.06604,0.59388 29.76158,2.87504 9.69543,2.2813 19.05511,5.92037 27.47739,11.02309 8.42215,5.10286 15.89307,11.69212 21.60465,19.6287 5.71147,7.93674 13.0738,19.62846 15.30143,30.4913 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-body);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="csssccscsccscscccsccscsssscscscc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4408"
|
||||
d="m -784.21409,457.33922 c -0.56136,0.0656 -1.08141,0.1809 -1.55606,0.33615 -0.63289,0.20699 -1.18396,0.48516 -1.6349,0.82686 -0.45093,0.3417 -0.80184,0.74659 -1.02778,1.21891 -0.22595,0.47234 -0.32669,1.01119 -0.27449,1.62035 0.0522,0.60917 0.25282,1.23371 0.57968,1.84938 0.32687,0.61567 0.98957,1.25218 1.83531,1.84156 0.84574,0.58937 1.35671,1.20529 1.82543,1.72857 0.46713,0.52147 1.13451,0.85371 2.02424,0.92674 0.10253,0.008 0.12328,-0.30471 0.0344,-0.32876 -0.78083,-0.20262 -1.25826,-0.72023 -1.71877,-1.11076 -0.4254,-0.46645 -0.87231,-1.01406 -1.62104,-1.54604 -0.74871,-0.53197 -1.47289,-1.09304 -1.77689,-1.63886 -0.30398,-0.54584 -0.49685,-1.10009 -0.55469,-1.64239 -0.0579,-0.54231 0.0245,-1.0222 0.21918,-1.44322 0.19469,-0.42103 0.50198,-0.78371 0.90168,-1.08623 0.39973,-0.30252 0.89062,-0.54587 1.4577,-0.7237 0.28355,-0.0889 0.5872,-0.16119 0.90722,-0.21465 0.32002,-0.0535 0.6576,-0.0885 1.01178,-0.10163 0.70839,-0.0255 1.4163,0.0392 2.10043,0.1987 0.68412,0.15947 1.34499,0.41522 1.93838,0.77329 0.59338,0.35806 1.11885,0.81986 1.52108,1.37653 0.40222,0.55667 0.92117,1.37523 1.07925,2.13677 0.12981,0.62539 0.0734,1.25844 -0.13288,1.83379 -0.0385,0.10712 0.4977,0.29416 0.62787,-0.0111 0.24265,-0.5698 0.23445,-1.24057 0.1026,-1.8741 -0.17834,-0.85666 -0.69031,-1.76937 -1.13671,-2.40019 -0.4464,-0.6308 -1.03123,-1.15292 -1.68895,-1.55276 -0.65772,-0.39984 -1.38674,-0.68003 -2.14271,-0.85021 -0.75599,-0.17016 -1.54036,-0.23166 -2.32498,-0.19142 -0.19617,0.0101 -0.38815,0.0268 -0.57528,0.0484 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
transform="matrix(13.851095,0,0,13.851095,10133.213,-6001.611)" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -753.77185,413.0219 c -0.13663,-2.61847 2.18018,-4.94804 7.2193,-6.20054 7.65443,-1.90257 20.03831,1.84566 27.93811,5.67152 4.33357,2.09883 8.88981,3.89076 12.66635,7.19411 1.28185,1.12133 2.51799,2.28349 3.36855,4.40869 -1.65849,0.577 -4.10492,-0.92134 -5.87278,-2.13046 -6.96771,-4.76531 -14.69502,-8.08983 -22.67695,-9.12646 -6.71591,-0.87187 -8.86923,-3.11022 -14.75541,-2.56175 -3.72583,0.34716 -4.90626,2.13878 -7.88716,2.74489 z"
|
||||
id="path4365-1-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssscsssc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -720.16989,411.68353 c 0.28532,-2.32502 0.86962,3.90377 -0.31886,5.45995 -4.46007,5.84 -8.20289,12.32072 -12.42083,18.36519 -1.37385,1.96787 -3.29463,0.0414 -2.42738,-2.09874 0.88118,-2.1739 2.06053,-3.99898 3.34915,-5.8153 1.20809,-1.70147 2.81353,-3.0576 3.88834,-4.85958 2.06619,-3.46267 2.39577,-6.62873 4.25443,-10.2393 0.63712,-1.23818 3.5225,0.42546 3.67386,-0.80905 z"
|
||||
id="path4367-9-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssss" />
|
||||
</g>
|
||||
<g
|
||||
style="display:inline;opacity:1"
|
||||
id="g4198"
|
||||
transform="matrix(0.69027452,0,0,0.73815345,642.18876,259.65104)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -140.71724,398.66408 c -9.31409,71.69689 -25.7611,141.32 -83.87724,188.8641 -73.31672,59.97949 -208.09131,67.90599 -303.42706,10.99618 -27.57065,-16.45805 -49.52457,-62.17665 -53.04177,-91.74122 -7.35191,-61.79791 19.82699,-103.64945 13.47928,-160.67805 -5.05249,-45.39216 -29.63784,-82.95495 -27.30836,-137.00138 1.56315,-36.26681 11.06536,-78.46439 40.50727,-100.88356 38.57103,-29.370718 83.60539,-46.188952 134.68095,-45.031125 72.73731,1.648875 151.17838,6.326503 212.18714,49.939365 43.544,31.12796 68.50323,82.53699 72.90385,135.3004 4.52019,54.19698 -0.16075,104.48555 -6.10406,150.23529 z"
|
||||
id="path4188"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4336);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -158.93683,464.92976 c -15.56115,65.9367 -58.42288,127.39267 -134.42207,151.72082 -70.61462,22.6045 -163.49236,17.29949 -232.18476,-25.54762 -26.14623,-16.30879 -46.09162,-61.46233 -48.95901,-89.47579 -6.03547,-58.9646 19.04741,-102.17429 13.30293,-156.59502 -4.7951,-45.42661 -28.02123,-78.34585 -27.29597,-132.22289 0.47399,-35.21112 8.99044,-76.95773 37.82112,-98.79995 36.52466,-27.671205 78.3526,-45.238515 126.45621,-45.012482 76.22124,0.358155 162.16208,5.533182 222.84373,56.658952 55.47879,46.74224 63.38318,129.04796 60.81019,193.3049 -2.12217,52.99813 -7.67242,100.63054 -18.37237,145.96908 z"
|
||||
id="ellipse4190"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssss" />
|
||||
</g>
|
||||
<g
|
||||
id="g4376"
|
||||
transform="matrix(0.40138799,-0.13710458,0.13710458,0.40138799,470.81791,82.723801)"
|
||||
style="opacity:1">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-body);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -626.57295,401.69566 c 2.24713,11.35067 0.36741,22.38948 -3.843,32.03835 -4.21053,9.64886 -10.54997,17.90531 -17.7192,24.34399 -7.1694,6.43883 -15.25457,11.1106 -24.57171,13.61082 -9.31727,2.5002 -20.94956,4.47176 -31.64526,1.82793 -10.69571,-2.64383 -18.09209,-9.81214 -24.14818,-17.25062 -6.05597,-7.43843 -12.44269,-16.56671 -23.09665,-25.35944 -10.65372,-8.79255 -20.95218,-17.78817 -25.30072,-26.87318 -4.34843,-9.08528 -7.1154,-18.36084 -7.98,-27.52156 -0.86459,-9.1606 0.24716,-17.36404 2.9617,-24.58398 2.71467,-7.22004 7.03243,-13.45488 12.66059,-18.5369 5.6283,-5.08191 12.56665,-9.01064 20.59229,-11.48936 8.02576,-2.47858 17.13537,-3.50537 27.20916,-2.66707 10.0738,0.83832 20.1809,3.47234 29.95223,7.6529 9.77122,4.18068 19.21426,9.9086 27.71179,16.89733 8.49741,6.98886 16.03465,15.24007 21.79567,24.41557 5.7609,9.17565 13.1742,22.14471 15.42129,33.49522 z"
|
||||
id="path4398"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -784.27135,455.90422 c -0.56339,0.0147 -1.08437,0.10666 -1.55902,0.26191 -0.63289,0.20699 -1.18231,0.52669 -1.63059,0.93484 -0.44828,0.40815 -0.79558,0.90361 -1.01756,1.4752 -0.22199,0.5716 -0.31844,1.21792 -0.26185,1.93717 0.0566,0.71926 0.26134,1.4471 0.59196,2.157 0.33063,0.7099 0.99621,1.41858 1.84494,2.08284 0.84872,0.66425 1.36325,1.36931 1.83382,1.93901 0.46898,0.56774 1.13678,0.9105 2.02675,0.98962 0.10256,0.009 0.12294,-0.31321 0.034,-0.33899 -0.78143,-0.21746 -1.26048,-0.77583 -1.72293,-1.21489 -0.42768,-0.5236 -0.87838,-1.16625 -1.63058,-1.78505 -0.75217,-0.61879 -1.47924,-1.25213 -1.78697,-1.89162 -0.30772,-0.63951 -0.50455,-1.29287 -0.56648,-1.9378 -0.062,-0.64492 0.0165,-1.22191 0.20772,-1.73042 0.1912,-0.50852 0.49539,-0.94884 0.89287,-1.30706 0.3975,-0.35822 0.88707,-0.63484 1.45426,-0.80994 0.2836,-0.0875 0.58767,-0.1494 0.90851,-0.1822 0.32084,-0.0328 0.65966,-0.0369 1.01552,-0.008 0.71174,0.0585 1.42446,0.24383 2.11396,0.53794 0.6895,0.29412 1.35628,0.69807 1.95502,1.19025 0.59873,0.49218 1.12894,1.07271 1.53474,1.71893 0.4058,0.64623 0.9285,1.5589 1.08808,2.35795 0.13104,0.65619 0.075,1.29927 -0.13103,1.88026 -0.0384,0.10817 0.49808,0.30362 0.62824,-0.002 0.24262,-0.57052 0.23429,-1.24452 0.10166,-1.89748 -0.17938,-0.88293 -0.69436,-1.871 -1.14416,-2.58711 -0.44981,-0.71609 -1.03943,-1.35821 -1.70275,-1.89855 -0.66333,-0.54034 -1.3987,-0.97968 -2.16052,-1.29649 -0.76184,-0.31679 -1.55154,-0.51173 -2.33984,-0.56369 -0.19709,-0.013 -0.38986,-0.0163 -0.57767,-0.0116 z"
|
||||
id="path4369"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssccscsccscscccsccscsssscscscc"
|
||||
transform="matrix(13.851095,0,0,13.851095,10133.213,-6001.611)" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -730.27274,382.91266 c 1.8068,-2.76405 6.31309,-3.63001 13.24575,-1.6171 10.53068,3.05761 22.43414,14.97755 28.94834,24.04709 3.57338,4.97534 7.6424,9.78266 9.64772,15.62449 0.68055,1.98294 1.27611,3.97774 0.68898,6.70435 -2.4056,-0.49416 -4.1871,-3.62313 -5.37952,-6.01329 -4.69962,-9.4202 -11.38574,-17.86492 -20.09536,-24.13889 -7.3284,-5.27852 -8.20487,-8.9719 -15.61502,-12.25742 -4.69053,-2.07967 -7.44128,-1.02076 -11.44089,-2.34923 z"
|
||||
id="path4365-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssscsssc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -689.31909,403.49962 c 2.08771,-2.1886 -1.9021,4.5559 -4.48533,5.36905 -9.69439,3.05157 -19.01784,7.22624 -28.57811,10.64488 -3.11327,1.11257 -3.94795,-2.11026 -1.30738,-3.72982 2.68251,-1.64492 5.45711,-2.73872 8.35507,-3.75217 2.71578,-0.94874 5.64428,-1.2851 8.27731,-2.4236 5.06052,-2.18718 7.83343,-5.20599 12.75841,-7.67984 1.68866,-0.84854 3.86766,2.73608 4.97603,1.5739 z"
|
||||
id="path4367-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssss" />
|
||||
</g>
|
||||
<g
|
||||
id="g4634"
|
||||
transform="matrix(0.13058783,-0.42795023,-0.60869797,-0.11092817,632.15501,956.21909)"
|
||||
style="display:inline;opacity:1">
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4636"
|
||||
d="m 423.50332,581.83521 c -0.004,4.40048 -1.19837,7.58856 -3.37524,9.82844 -2.17687,2.23987 -5.33154,3.55156 -9.14619,4.44292 -3.81465,0.89135 -8.28246,1.39523 -13.05675,1.83828 -4.77428,0.44304 -9.85163,0.79076 -14.95001,1.09928 -5.09838,0.30851 -9.94541,0.34741 -14.40217,0.0862 -4.45676,-0.26122 -8.52354,-0.79908 -11.99271,-1.71189 -3.46915,-0.91282 -6.33736,-2.21356 -8.3562,-4.09288 -2.01885,-1.87935 -3.18709,-4.34475 -3.25466,-7.51083 -0.0676,-3.16607 0.9983,-5.4859 2.92534,-7.0838 1.92703,-1.5979 4.71248,-2.46394 8.09977,-2.84688 3.38729,-0.38293 7.37282,-0.28336 11.77044,-0.16051 4.39762,0.12284 9.21051,0.23456 14.33166,-0.12202 5.12115,-0.35659 10.27171,-1.47349 15.16022,-2.54099 4.88852,-1.06749 9.50395,-2.05149 13.43823,-2.27114 3.9343,-0.21967 7.17754,0.32322 9.39823,2.04598 2.22069,1.72276 3.41425,4.59936 3.41004,8.99986 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4279);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="csscsscssssssssssssssssssssccsssc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4638"
|
||||
d="m 411.91406,568.54883 c -3.75011,-0.0271 -8.08701,0.53975 -12.76172,1.28711 -5.34251,0.85413 -11.10706,1.92059 -17.00976,2.32617 -5.9027,0.40562 -11.41103,0.38326 -16.44727,0.41406 -5.03624,0.0309 -9.6045,0.1607 -13.50781,0.85938 -3.9033,0.69867 -7.13503,1.96743 -9.4082,3.96875 -2.27316,2.00131 -3.58535,4.71676 -3.65235,8.17578 -0.067,3.45901 1.21821,6.3073 3.54297,8.58008 2.32476,2.27278 5.68789,3.9795 9.76172,5.25 4.07385,1.27051 8.85237,2.11894 14.05664,2.59765 5.20427,0.47871 10.83381,0.56134 16.70313,0.22266 5.86931,-0.33868 11.47146,-0.78653 16.60547,-1.34961 5.13399,-0.56309 9.79334,-1.22365 13.70703,-2.34375 1.48913,-0.4262 2.86677,-0.9287 4.12695,-1.51953 2.54507,-1.19325 2.05015,-6.17249 -0.0996,-4.54102 -1.99172,1.51153 -4.14364,1.68162 -7.15735,2.35061 -3.67269,0.81527 -8.18136,0.99111 -12.55008,1.3428 -4.3687,0.35167 -8.7789,1.78431 -13.31332,2.07736 -4.53444,0.29304 -8.86787,0.32801 -12.93181,0.0702 -4.06396,-0.25785 -7.85651,-0.78075 -11.12475,-1.64296 -3.26823,-0.86221 -5.99695,-2.08037 -7.8846,-3.81399 -1.88765,-1.73365 -2.92537,-3.9871 -2.97865,-6.80086 -0.0533,-2.81374 0.90176,-4.8192 2.66881,-6.10562 1.76704,-1.28641 5.61732,-0.58475 8.69196,-0.71399 3.07463,-0.12925 6.90624,-0.54484 10.78772,-0.41733 3.88147,0.12754 6.54592,-0.48119 11.04844,-1.2139 4.50252,-0.73264 9.15212,-2.3434 13.88736,-3.72101 4.73523,-1.37761 9.22461,-2.34259 13.00861,-2.55385 0.473,-0.0264 0.93707,-0.0422 1.38868,-0.0449 1.16046,-0.007 2.25007,0.0442 3.25,0.23633 1.15313,0.22156 2.31543,-2.86146 -0.83789,-2.92773 -0.51177,-0.0108 -1.03459,-0.045 -1.57032,-0.0488 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer9"
|
||||
inkscape:label="gopher-shadow"
|
||||
style="display:inline;opacity:0.06000001"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<ellipse
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="path4544"
|
||||
cx="-467.52527"
|
||||
cy="482.66467"
|
||||
rx="22.450642"
|
||||
ry="20.682871"
|
||||
transform="scale(-1,1)" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 234.60547,309.98047 c -6.62163,-0.0703 -10.7426,0.83465 -15.61133,3.26758 -5.0378,2.51742 -10.044,7.91661 -11.55273,12.45898 -2.26972,6.83348 -0.42196,14.92592 5.01757,21.97656 3.19606,4.1427 6.84938,6.56071 14.60938,9.66993 3.20846,1.28553 7.68985,3.50108 9.95898,4.92382 5.6211,3.52442 9.83526,5.31873 13.54102,5.76563 2.42194,0.29208 3.11523,0.63719 3.11523,1.55469 0,0.89182 -0.7061,1.28567 -2.89062,1.61328 -1.58919,0.23867 -3.77121,0.24076 -4.84961,0.004 -1.95019,-0.42833 -1.9703,-0.40483 -3.65625,4.68555 -3.87667,11.7048 -5.82609,25.85658 -5.80859,42.15625 0.0196,18.31899 1.82597,28.89111 9.58007,56.04688 5.56137,19.47655 7.15656,26.40249 8.58008,37.26171 2.05331,15.66359 1.31467,26.60445 -3.90625,57.79102 -4.8641,29.05517 -5.15869,31.69637 -5.18359,46.54297 -0.0239,14.28001 0.63486,19.84952 3.52539,29.8125 5.44577,18.77032 13.72789,34.11825 23.9082,44.30078 8.00321,8.00498 22.62783,16.26261 41.23438,23.2832 5.47456,2.06566 5.83617,2.12101 6.46679,0.99414 1.72277,-3.07839 3.2087,-3.7772 9.33203,-3.79882 -38.68101,-33.75954 -34.48259,-82.29367 -25.52281,-108.9339 7.33431,-21.80723 31.77025,-53.23407 31.77025,-53.23407 l -22.41052,-1.98245 c 0,0 -7.25969,-42.63753 -13.15682,-59.9065 -22.58603,-66.14023 -29.82384,-120.35922 4.37069,-158.19894 5.84309,-6.46598 12.5988,-11.21335 19.60937,-14.69727 -9.02679,1.89877 -18.30173,4.80561 -26.41601,8.32813 -6.65247,2.88791 -19.01394,9.90994 -18.99415,10.78906 0.009,0.39075 0.30731,1.97487 0.66407,3.52148 0.79845,3.46141 -0.0807,5.55969 -2.20117,5.25782 -1.1871,-0.16901 -1.49742,-0.76108 -1.83008,-3.48633 -0.63121,-5.17109 -3.20076,-9.39815 -9.06836,-14.91797 -9.25402,-8.70552 -17.29671,-12.21829 -29.22461,-12.76172 -1.05756,-0.0482 -2.05405,-0.0778 -3,-0.0879 z m 1.38086,24.10156 c 1.88404,0.0642 3.99413,0.41696 5.88476,1.04492 3.99187,1.32589 12.35644,6.69047 14.31446,9.17969 3.00519,3.82048 1.04901,4.01008 -3.4043,0.33008 -1.74522,-1.44216 -3.36983,-2.6211 -3.60937,-2.6211 -0.23954,0 -2.78812,1.91597 -5.66407,4.25782 -2.87594,2.34185 -5.59815,4.25776 -6.04883,4.25976 -1.88842,0.007 -0.56519,-2.08264 3.10938,-4.91015 4.64288,-3.57262 5.88952,-5.38766 4.12891,-6.00977 -0.64649,-0.22845 -2.92374,-1.13445 -5.06055,-2.01367 -3.0123,-1.23949 -4.52138,-1.50334 -6.71875,-1.17383 -3.06661,0.45987 -3.82178,-0.39095 -1.46485,-1.65234 0.9899,-0.52978 2.64916,-0.75563 4.53321,-0.69141 z m 103.78515,383.73633 c -0.005,0.0152 -0.007,0.0256 -0.0117,0.041 l -0.70118,2.28906 5.65625,1.01562 c 0.0901,0.0162 0.20551,0.0326 0.29688,0.0488 -1.81728,-1.11236 -3.56263,-2.24473 -5.24024,-3.39453 z"
|
||||
id="path4271"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssscssssssssssscsccsscscssssssscsssscscsssscccccccc" />
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 328.4205,548.25967 -4.47623,14.88037 c 2.60939,0.0254 9.84161,-6.41982 16.75619,-6.818 76.94638,-4.43102 125.04829,-0.40565 187.26295,-5.40532 1.45456,-0.11689 3.76527,-0.10936 5.20677,0.2079 5.21485,1.14773 8.09003,14.3736 9.3628,13.60525 0.6055,-14.12878 -2.32372,-19.14168 -5.81784,-22.69773 z"
|
||||
id="path4275"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccsssccc" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="gopher-face"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<g
|
||||
id="g4818"
|
||||
transform="matrix(-0.65610141,0,0,0.65610141,655.70091,210.42145)">
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4812"
|
||||
d="m 547.42756,318.16456 c -0.44046,14.77191 -4.12869,29.02667 -10.38967,42.25266 -6.26099,13.22599 -15.09198,25.42687 -25.80466,35.99686 -10.71268,10.57 -23.30432,19.50822 -37.11826,26.08983 -13.81394,6.58161 -28.85103,10.80263 -44.50193,11.8618 -15.65091,1.05917 -30.4406,-1.15844 -43.81781,-6.16756 -13.37721,-5.00911 -25.3405,-12.8075 -35.30087,-22.80416 -9.96037,-9.99666 -17.91599,-22.19037 -23.26581,-35.90798 -5.34983,-13.71761 -8.0915,-28.95913 -7.64195,-44.98105 0.44955,-16.02192 4.04447,-31.2937 10.1422,-45.07896 6.09773,-13.78526 14.69591,-26.08175 25.16951,-36.25747 10.4736,-10.17571 22.82245,-18.23043 36.46168,-23.66123 13.63924,-5.4308 28.57214,-8.24285 44.22923,-8.02541 15.6571,0.21745 30.56095,3.42714 44.11009,8.94154 13.54914,5.5144 25.7404,13.33722 35.92568,22.91495 10.18529,9.57774 18.36233,20.91345 23.87736,33.53282 5.51504,12.61936 8.36566,26.52144 7.92521,41.29336 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="ellipse4814"
|
||||
d="m 539.72249,314.79002 c 10e-4,13.89984 -3.01572,27.53808 -8.51346,40.35257 -5.49774,12.81449 -13.48047,24.80543 -23.37659,35.2527 -9.89612,10.44726 -21.70519,19.34133 -34.78531,25.87862 -13.08011,6.53727 -27.4256,10.71236 -42.3773,11.7667 -14.9517,1.05435 -29.09103,-1.11258 -41.85904,-5.93108 -12.76803,-4.81852 -24.16883,-12.28715 -33.66552,-21.79076 -9.49671,-9.50362 -17.08979,-21.04298 -22.23241,-33.95465 -5.14261,-12.91166 -7.83328,-27.19561 -7.52333,-42.13595 0.30995,-14.94034 3.58995,-29.10832 9.22975,-41.85842 5.63981,-12.7501 13.63743,-24.08168 23.39638,-33.47108 9.75897,-9.38941 21.27795,-16.83842 34.00359,-21.94183 12.72563,-5.10342 26.66067,-7.86812 41.28534,-7.94317 14.62467,-0.0751 28.55938,2.53224 41.26083,7.24431 12.70145,4.71207 24.16709,11.5339 33.81555,20.03646 9.64847,8.50257 17.47884,18.68937 22.90117,30.21241 5.42232,11.52304 8.43889,24.38332 8.44035,38.28317 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-eye);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<circle
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4319);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="path4828"
|
||||
cx="458.07443"
|
||||
cy="316.13431"
|
||||
r="30.809652" />
|
||||
<circle
|
||||
r="15.152287"
|
||||
cy="301.99216"
|
||||
cx="444.43738"
|
||||
id="circle4830"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-eye);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(-0.49821858,-0.255998,-0.255998,0.49821858,841.05915,359.59091)"
|
||||
id="g4822">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 544.2609,323.96628 c -5.95391,12.33766 -15.20034,24.2228 -25.89846,35.91934 -10.69814,11.69654 -22.74349,23.28172 -34.52447,34.21851 -11.78099,10.93679 -23.27607,21.15489 -34.23709,29.30247 -10.96102,8.14759 -21.47285,14.18083 -32.04267,16.95199 -10.56982,2.77117 -20.29711,2.02561 -29.30402,-1.67713 -9.00692,-3.70274 -20.58076,-7.76561 -27.66538,-16.71749 -7.08461,-8.95188 -12.84054,-20.18257 -16.5035,-33.03389 -3.66297,-12.85133 -5.229,-27.32914 -3.92417,-42.72858 1.30484,-15.39944 5.36688,-30.24976 11.81788,-43.75488 6.45101,-13.5051 15.29008,-25.65823 26.00811,-35.78271 10.71803,-10.12447 28.44246,-20.29305 42.24879,-25.86698 13.80633,-5.57394 28.83304,-8.62768 44.20973,-8.80364 15.3767,-0.17594 29.62737,2.52591 41.94358,7.37479 12.31622,4.84887 22.69735,11.85058 30.35956,20.34718 7.66222,8.49661 12.60139,18.48263 14.06496,29.34879 1.4636,10.86615 -0.59894,22.56457 -6.55285,34.90223 z"
|
||||
id="path4824"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 538.18032,322.65868 c -5.17728,11.63182 -13.27733,23.10077 -22.96883,34.40428 -9.69151,11.30351 -20.93897,22.46482 -32.34413,32.7753 -11.40514,10.31051 -22.90789,19.71873 -33.85893,27.13351 -10.95103,7.41476 -21.39599,12.82014 -31.59528,15.28718 -10.19931,2.46703 -19.30202,1.76338 -27.56839,-1.62958 -8.26637,-3.39295 -19.13397,-6.9512 -25.3913,-15.16185 -6.25732,-8.21068 -11.24381,-18.53447 -14.30417,-30.37519 -3.06035,-11.84072 -4.18965,-25.20221 -2.68634,-39.42576 1.5033,-14.22354 5.50837,-27.94818 11.67956,-40.43838 6.17119,-12.4902 14.50792,-23.74111 24.54768,-33.13895 10.03978,-9.39782 26.99021,-19.0621 39.83566,-24.2929 12.84546,-5.2308 26.78412,-8.15811 41.0009,-8.45853 14.21678,-0.30038 27.34319,2.03758 38.64284,6.33106 11.29965,4.29349 20.7704,10.54463 27.74089,18.16875 6.97048,7.62413 11.43794,16.6127 12.81335,26.51165 1.37541,9.89894 -0.36624,20.67759 -5.54351,32.30941 z"
|
||||
id="path4826"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<circle
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4321);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="path4828-0"
|
||||
cx="438.70038"
|
||||
cy="219.30804"
|
||||
r="27.721321"
|
||||
transform="matrix(0.98640333,0.16434257,-0.16434257,0.98640333,0,0)" />
|
||||
<circle
|
||||
r="13.633434"
|
||||
cy="205.95601"
|
||||
cx="431.24106"
|
||||
id="circle4830-3"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
transform="matrix(0.98640333,0.16434257,-0.16434257,0.98640333,0,0)" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer7"
|
||||
inkscape:label="gopher-mouth"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 477.59321,477.72343 -6.36763,0.0828 -3.71113,-0.0821 c -1.18372,-0.0262 -2.23819,0.53559 -3.00662,1.36379 -0.76845,0.82822 -1.14658,1.97521 -1.32551,3.22687 l -1.01303,7.08562 -1.40711,7.111 c -0.25342,1.28069 0.0841,2.40965 0.70518,3.23132 0.6211,0.82165 1.57363,1.28978 2.69674,1.31649 l 3.7446,0.0891 7.40657,-0.17258 c 1.42055,-0.0331 2.74014,-0.58514 3.70785,-1.43299 0.96771,-0.84787 1.54004,-2.00084 1.65553,-3.2592 l 0.6476,-7.05621 0.52522,-7.04505 c 0.0935,-1.25398 -0.46676,-2.37726 -1.25366,-3.18163 -0.78689,-0.80437 -1.85738,-1.2842 -3.00457,-1.27716 z"
|
||||
id="rect4659"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scssscssscssscsss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 476.43064,479.86835 -5.19684,0.0698 -2.47497,-0.10149 c -0.94018,-0.0386 -1.80825,0.43586 -2.46124,1.11384 -0.65298,0.67797 -1.03424,1.61771 -1.21175,2.64338 l -1.0026,5.79325 -1.25494,5.80832 c -0.22406,1.03701 0.002,1.97056 0.48938,2.64162 0.48783,0.67105 1.26653,1.03411 2.19892,1.07115 l 2.54193,0.101 5.88547,-0.12754 c 1.11447,-0.0242 2.17518,-0.47212 2.97321,-1.1643 0.79803,-0.69218 1.30904,-1.6349 1.43939,-2.66511 l 0.73009,-5.77006 0.63032,-5.76301 c 0.11259,-1.02637 -0.28558,-1.94744 -0.89178,-2.6062 -0.60618,-0.65877 -1.45658,-1.05733 -2.39458,-1.04471 z"
|
||||
id="rect4661"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scssscssscssscsss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 447.45177,471.71537 c 0.17729,2.27145 1.57656,4.32647 3.56538,6.17684 1.98881,1.85037 4.73553,3.49055 7.9169,4.83408 3.18137,1.34353 6.76993,2.37673 10.40491,2.92876 3.63499,0.55204 7.31771,0.61337 10.93742,0.17695 3.61969,-0.43645 6.8614,-1.30517 9.67542,-2.37849 2.81402,-1.07332 5.17844,-2.3467 7.04073,-3.75925 1.86231,-1.41254 3.23922,-2.97722 4.10853,-4.72358 0.86932,-1.74636 1.22997,-3.67959 0.91461,-5.76285 -0.31535,-2.08326 -1.29186,-4.11481 -2.79935,-5.98131 -1.5075,-1.86649 -3.53491,-3.56576 -5.91642,-4.97983 -2.3815,-1.41407 -5.11304,-2.54212 -8.12844,-3.28158 -3.0154,-0.73946 -6.31783,-1.09096 -9.93094,-0.97174 -3.6131,0.11924 -7.2186,0.69446 -10.6419,1.64517 -3.4233,0.95069 -6.6496,2.2832 -9.33875,3.91065 -2.68913,1.62746 -4.89892,3.50256 -6.18894,5.61926 -1.32139,2.16817 -1.77021,4.61153 -1.61916,6.54692 z"
|
||||
id="ellipse4650"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4265);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 455.1011,471.20532 c 0.31019,1.80429 1.36577,3.48937 2.98663,4.99917 1.62086,1.5098 3.80505,2.84719 6.28703,3.91437 2.48197,1.06719 5.24944,1.8562 8.07117,2.27071 2.82174,0.4145 5.70079,0.45265 8.53169,0.10713 2.83089,-0.34553 5.35911,-1.02976 7.553,-1.90451 2.19389,-0.87475 4.04484,-1.93848 5.497,-3.12538 1.45217,-1.1869 2.50911,-2.50179 3.13219,-3.93394 0.62308,-1.43214 0.81446,-2.98543 0.48985,-4.63056 -0.32461,-1.64514 -1.13916,-3.22548 -2.3414,-4.6674 -1.20224,-1.44192 -2.78948,-2.74346 -4.65903,-3.82078 -1.86955,-1.07733 -4.01937,-1.92982 -6.38974,-2.4811 -2.37037,-0.55129 -4.96168,-0.80162 -7.76722,-0.68542 -2.80553,0.11621 -5.57317,0.58631 -8.1874,1.34158 -2.61424,0.75528 -5.07126,1.79757 -7.14628,3.06167 -2.07504,1.26412 -3.75959,2.75051 -4.8326,4.37276 -1.07302,1.62225 -1.53509,3.37741 -1.22489,5.1817 z"
|
||||
id="ellipse4652"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 465.13937,460.19393 c 0.45232,1.29294 1.43586,2.44115 2.79664,3.4102 1.36078,0.96906 3.0934,1.76079 4.97332,2.36791 1.87992,0.60712 3.89927,1.0315 5.87533,1.25741 1.97606,0.2259 3.90879,0.25223 5.71982,0.052 1.81102,-0.20028 3.33955,-0.60742 4.63321,-1.17435 1.29367,-0.56695 2.35232,-1.29343 3.18646,-2.14861 0.83413,-0.85519 1.44471,-1.8405 1.79916,-2.93195 0.35445,-1.09146 0.45213,-2.29028 0.21175,-3.55738 -0.24038,-1.2671 -0.80099,-2.48156 -1.64917,-3.57911 -0.84818,-1.09755 -1.9831,-2.07741 -3.35494,-2.8723 -1.37184,-0.7949 -2.98056,-1.40441 -4.76729,-1.7664 -1.78672,-0.36199 -3.75169,-0.47615 -5.82322,-0.29097 -2.07153,0.18518 -4.05358,0.65136 -5.84566,1.3298 -1.79207,0.67844 -3.39432,1.56902 -4.69144,2.60198 -1.29713,1.03296 -2.28898,2.20893 -2.84443,3.45293 -0.55546,1.24399 -0.67186,2.55593 -0.21954,3.84888 z"
|
||||
id="path4648"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssssssssssss" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer12"
|
||||
inkscape:label="gopher-hands"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<g
|
||||
id="g4533"
|
||||
transform="matrix(-0.28489616,-0.34500545,-0.42832103,0.44649678,715.99765,474.46827)">
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssssssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="ellipse4523"
|
||||
d="m 423.50332,581.83521 c -0.004,4.40048 -1.19837,7.58856 -3.37524,9.82844 -2.17687,2.23987 -5.33154,3.55156 -9.14619,4.44292 -3.81465,0.89135 -8.28246,1.39523 -13.05675,1.83828 -4.77428,0.44304 -9.85163,0.79076 -14.95001,1.09928 -5.09838,0.30851 -9.94541,0.34741 -14.40217,0.0862 -4.45676,-0.26122 -8.52354,-0.79908 -11.99271,-1.71189 -3.46915,-0.91282 -6.33736,-2.21356 -8.3562,-4.09288 -2.01885,-1.87935 -3.18709,-4.34475 -3.25466,-7.51083 -0.0676,-3.16607 0.9983,-5.4859 2.92534,-7.0838 1.92703,-1.5979 4.71248,-2.46394 8.09977,-2.84688 3.38729,-0.38293 7.37282,-0.28336 11.77044,-0.16051 4.39762,0.12284 9.21051,0.23456 14.33166,-0.12202 5.12115,-0.35659 10.27171,-1.47349 15.16022,-2.54099 4.88852,-1.06749 9.50395,-2.05149 13.43823,-2.27114 3.9343,-0.21967 7.17754,0.32322 9.39823,2.04598 2.22069,1.72276 3.41425,4.59936 3.41004,8.99986 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4273);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="ssscsscssssssssssssssssssssccsss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4521"
|
||||
d="m 411.91406,568.54883 c -3.75011,-0.0271 -8.08701,0.53975 -12.76172,1.28711 -5.34251,0.85413 -11.10706,1.92059 -17.00976,2.32617 -5.9027,0.40562 -11.41103,0.38326 -16.44727,0.41406 -5.03624,0.0309 -9.6045,0.1607 -13.50781,0.85938 -3.9033,0.69867 -7.13503,1.96743 -9.4082,3.96875 -2.27316,2.00131 -3.58535,4.71676 -3.65235,8.17578 -0.067,3.45901 1.21821,6.3073 3.54297,8.58008 2.32476,2.27278 5.68789,3.9795 9.76172,5.25 4.07385,1.27051 8.85237,2.11894 14.05664,2.59765 5.20427,0.47871 10.83381,0.56134 16.70313,0.22266 5.86931,-0.33868 11.47146,-0.78653 16.60547,-1.34961 5.13399,-0.56309 9.79334,-1.22365 13.70703,-2.34375 1.48913,-0.4262 2.86677,-0.9287 4.12695,-1.51953 2.54507,-1.19325 2.05015,-6.17249 -0.0996,-4.54102 -1.99172,1.51153 -4.55969,2.50355 -7.57031,3.20703 -3.66893,0.85731 -7.96668,1.34146 -12.5586,1.76758 -4.59191,0.42612 -9.47527,0.75991 -14.3789,1.05664 -4.90363,0.29673 -9.56506,0.33523 -13.85156,0.084 -4.28652,-0.25124 -8.19851,-0.76855 -11.53516,-1.64649 -3.33664,-0.87795 -6.09539,-2.12996 -8.03711,-3.9375 -1.94173,-1.80756 -3.06587,-4.17751 -3.13086,-7.22265 -0.065,-3.04513 0.96102,-5.2776 2.81445,-6.81446 1.85342,-1.53686 4.53117,-2.36997 7.78907,-2.73828 3.2579,-0.36831 7.09262,-0.27244 11.32226,-0.1543 4.22963,0.11816 8.85767,0.22578 13.7832,-0.11718 4.92553,-0.34297 9.88026,-1.41664 14.58204,-2.44336 4.70178,-1.02671 9.13982,-1.97234 12.92382,-2.1836 0.473,-0.0264 0.93707,-0.0422 1.38868,-0.0449 1.16046,-0.007 2.25007,0.0442 3.25,0.23633 1.15313,0.22156 2.31543,-2.86146 -0.83789,-2.92773 -0.51177,-0.0108 -1.03459,-0.045 -1.57032,-0.0488 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#gopher-lines);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer3"
|
||||
inkscape:label="cape-front"
|
||||
style="display:inline"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<path
|
||||
sodipodi:nodetypes="cssscscc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4248"
|
||||
d="m 250.62773,531.91504 c -9.09672,21.35801 -15.29674,29.07226 -30.27188,44.83759 -11.50237,12.10933 -28.85117,24.46609 -43.81134,39.61682 -13.55246,13.72509 -26.12338,21.00434 -64.22257,32.01103 -11.97434,3.45934 -44.031036,6.55017 -51.472472,37.30246 C 107.21772,654.7909 183.17617,662.32228 228.40418,636.09787 266.34279,614.10005 317.82474,552.6315 355.9453,547.7268 284.49621,547.05928 263.34291,542.49874 250.62773,531.91504 Z"
|
||||
style="display:inline;fill:#019833;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:#019833;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 473.29262,543.99873 73.7751,-5.10117 c 0,0 2.29258,1.0455 2.68673,2.11494 7.36409,19.98076 -12.72148,60.84328 -12.72148,60.84328 0,-2.97132 13.53121,-43.94425 -5.91529,-53.46522 -16.4456,-8.05173 -38.16124,-2.06803 -57.82506,-4.39183 z"
|
||||
id="path4265"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccscsc" />
|
||||
<path
|
||||
style="display:inline;fill:#019432;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 249.90625,533.57227 c -8.70868,20.08478 -14.97837,27.83833 -29.55078,43.17968 -11.50237,12.10933 -28.85038,24.46646 -43.81055,39.61719 -13.55246,13.72509 -26.12346,21.00503 -64.22265,32.01172 -10.63128,3.07133 -37.077893,5.86957 -48.087895,27.97656 2.731585,-3.48747 7.206694,-4.8761 9.881319,-8.70029 4.506995,-6.44411 60.824806,-11.61546 75.673426,-21.06752 9.77176,-6.22033 32.61216,-17.69963 44.08393,-25.40211 11.47178,-7.70248 50.16856,-39.82139 59.98047,-41.62695 30.99143,-5.70295 56.04882,-31.95703 56.04882,-31.95703 0,0 -5.76873,-1.34099 -7.30468,-1.69727 -26.4653,-1.9743 -39.57284,-5.58234 -48.29883,-11.28125 -1.77957,-0.42346 -3.78649,-0.89828 -4.39258,-1.05273 z"
|
||||
id="path4280"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssscsssscccc" />
|
||||
<path
|
||||
style="fill:#01a939;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 250.88543,527.29897 c 4.9284,1.23444 7.57648,5.23948 12.39942,6.83706 14.83134,4.91283 28.22069,8.13985 43.80356,9.2706 19.18619,1.39223 40.09821,1.50171 59.33179,1.15882 36.63136,-0.65304 73.4946,-1.92414 110.08831,-3.70824 19.9513,-0.97271 40.58394,-2.2893 60.49061,-3.94 3.86874,-0.3208 7.97563,-6.05622 11.58825,-4.6353 2.39418,0.94168 2.01049,3.29975 2.64058,5.79412 2.44082,4.93143 0.14511,6.64447 -5.65353,7.64824 -19.43937,3.05253 -39.20884,3.55847 -58.86827,4.40354 -48.01128,2.06378 -96.10464,2.11621 -144.15772,1.62235 -17.00379,-0.17475 -34.11943,0.52285 -50.98827,-1.62235 -13.27515,-1.68819 -26.90453,-3.45163 -39.16825,-8.80707 -4.12399,-1.80091 -7.99437,-2.72852 -8.97266,-7.12095 -0.30759,-1.38101 1.19417,-2.17728 1.88173,-3.29956 0.57446,-0.93767 0.21317,-2.26036 1.23886,-2.84803 1.34064,-0.76812 2.84679,-1.12864 4.34559,-0.75323 z"
|
||||
id="path4267"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssssccssssssss" />
|
||||
<path
|
||||
style="fill:#019d35;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 245.9043,528.82812 c -0.24767,0.63868 -0.21658,1.44068 -0.60352,2.07227 -0.68756,1.12228 -2.18845,1.91782 -1.88086,3.29883 0.97829,4.39243 4.84867,5.32018 8.97266,7.12109 12.26372,5.35544 25.89282,7.11845 39.16797,8.80664 16.86884,2.1452 33.98449,1.4483 50.98828,1.62305 48.05308,0.49386 96.14692,0.44073 144.1582,-1.62305 19.65943,-0.84507 39.42782,-1.34981 58.86719,-4.40234 5.79864,-1.00377 8.09512,-2.71701 5.6543,-7.64844 -0.0557,-0.22031 -0.0962,-0.43699 -0.13868,-0.65429 0.48647,4.64963 -6.66572,4.9037 -11.87478,5.92187 -33.64204,6.57569 -68.48165,3.5437 -102.75586,4.0957 -42.87828,0.69057 -93.34812,6.52037 -135.57053,-0.98242 -17.79033,-3.16129 -43.90403,-10.17243 -54.98437,-17.62891 z"
|
||||
id="path4340"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssscccsssc" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer8"
|
||||
inkscape:label="vim"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<g
|
||||
id="g4330">
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#005d04;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4293"
|
||||
width="194.71968"
|
||||
height="194.71968"
|
||||
x="-29.381023"
|
||||
y="744.44128"
|
||||
transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)" />
|
||||
<rect
|
||||
transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"
|
||||
y="753.35699"
|
||||
x="-20.465342"
|
||||
height="176.88821"
|
||||
width="176.88821"
|
||||
id="rect4283"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#019833;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<g
|
||||
id="text4285"
|
||||
style="font-style:normal;font-weight:normal;font-size:203.27047729px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#fefefe;fill-opacity:1;stroke:#005d04;stroke-width:4;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
transform="matrix(1.0880646,0,-0.29154603,1.0880646,-528.83975,-369.0604)">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccccccccsc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4324"
|
||||
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-family:Eczar;-inkscape-font-specification:'Eczar Ultra-Bold';fill:#fefefe;fill-opacity:1;stroke:#005d04;stroke-width:5.01092911;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 202.34975,1029.0537 -56.02157,-157.11507 -17.82505,-3.05571 0.25466,-14.0054 89.88914,0 1.52787,8.1486 c -2.7162,2.2069 -5.77193,4.32893 -9.16717,6.36609 -3.22549,2.03714 -6.70561,3.98941 -10.44038,5.85679 l 26.38345,87.17129 39.56921,-89.71773 -21.89934,-3.81964 0.25464,-14.0054 72.06411,0 -68.4991,168.82868 0.25465,0.2547 c -6.28122,1.0184 -13.49612,1.9522 -21.6447,2.8011 -8.14859,0.8487 -16.38207,1.6126 -24.70042,2.2917 z" />
|
||||
</g>
|
||||
</g>
|
||||
<use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#g4330"
|
||||
id="use4338"
|
||||
transform="matrix(0.4546439,-0.10745401,-0.02175104,0.44922994,711.99298,282.73776)"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer4"
|
||||
inkscape:label="palette"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true"
|
||||
transform="translate(-15.732722,-256.54886)">
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4168);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4162"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="779.60529"
|
||||
y="21.967466" />
|
||||
<rect
|
||||
y="21.967466"
|
||||
x="824.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4170"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4180);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052742;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#bce8ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4208"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="779.60529"
|
||||
y="86.967468" />
|
||||
<rect
|
||||
y="-127.75694"
|
||||
x="824.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4223"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#abccd9;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
transform="scale(1,-1)" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c3b0cb;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4227"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="779.60529"
|
||||
y="131.96747" />
|
||||
<rect
|
||||
y="131.96747"
|
||||
x="824.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4231"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e1d0cb;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#f5c3d2;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4233"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="869.60529"
|
||||
y="131.96747" />
|
||||
<rect
|
||||
y="176.96747"
|
||||
x="779.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4248"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#cec4ad;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<rect
|
||||
transform="scale(1,-1)"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#96d6ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4263"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="869.60529"
|
||||
y="-127.75694" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#f2f2ce;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4267"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="824.60529"
|
||||
y="176.96747" />
|
||||
<rect
|
||||
y="-327.75693"
|
||||
x="779.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4280"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#24b8eb;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
transform="scale(1,-1)" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8aa9ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4284"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="824.60529"
|
||||
y="286.96747" />
|
||||
<rect
|
||||
y="331.96747"
|
||||
x="779.60529"
|
||||
height="40.789474"
|
||||
width="40.789474"
|
||||
id="rect4297"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#d4edf1;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#394d54;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4301"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="779.60529"
|
||||
y="241.96747" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#d6e2ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:9.21052647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4303"
|
||||
width="40.789474"
|
||||
height="40.789474"
|
||||
x="824.60529"
|
||||
y="331.96747" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 84 KiB |
|
@ -14,12 +14,12 @@ else
|
|||
let g:ctrlp_ext_vars = [s:go_decls_var]
|
||||
endif
|
||||
|
||||
function! ctrlp#decls#init()
|
||||
function! ctrlp#decls#init() abort
|
||||
cal s:enable_syntax()
|
||||
return s:decls
|
||||
endfunction
|
||||
|
||||
function! ctrlp#decls#exit()
|
||||
function! ctrlp#decls#exit() abort
|
||||
unlet! s:decls s:current_dir s:target
|
||||
endfunction
|
||||
|
||||
|
@ -28,7 +28,7 @@ endfunction
|
|||
" a:mode the mode that has been chosen by pressing <cr> <c-v> <c-t> or <c-x>
|
||||
" the values are 'e', 'v', 't' and 'h', respectively
|
||||
" a:str the selected string
|
||||
function! ctrlp#decls#accept(mode, str)
|
||||
function! ctrlp#decls#accept(mode, str) abort
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
|
||||
let dir = getcwd()
|
||||
try
|
||||
|
@ -56,7 +56,7 @@ function! ctrlp#decls#accept(mode, str)
|
|||
endtry
|
||||
endfunction
|
||||
|
||||
function! ctrlp#decls#enter()
|
||||
function! ctrlp#decls#enter() abort
|
||||
let s:current_dir = fnameescape(expand('%:p:h'))
|
||||
let s:decls = []
|
||||
|
||||
|
@ -130,7 +130,7 @@ function! ctrlp#decls#enter()
|
|||
endfor
|
||||
endfunc
|
||||
|
||||
function! s:enable_syntax()
|
||||
function! s:enable_syntax() abort
|
||||
if !(has('syntax') && exists('g:syntax_on'))
|
||||
return
|
||||
endif
|
||||
|
@ -148,7 +148,7 @@ endfunction
|
|||
|
||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
||||
|
||||
function! ctrlp#decls#cmd(mode, ...)
|
||||
function! ctrlp#decls#cmd(mode, ...) abort
|
||||
let s:mode = a:mode
|
||||
if a:0 && !empty(a:1)
|
||||
let s:target = a:1
|
||||
|
|
|
@ -4,7 +4,7 @@ if !exists("g:go_alternate_mode")
|
|||
endif
|
||||
|
||||
" Test alternates between the implementation of code and the test code.
|
||||
function! go#alternate#Switch(bang, cmd)
|
||||
function! go#alternate#Switch(bang, cmd) abort
|
||||
let file = expand('%')
|
||||
if empty(file)
|
||||
call go#util#EchoError("no buffer name")
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"
|
||||
" Options:
|
||||
"
|
||||
" g:go_asmfmt_autosave [default=1]
|
||||
" g:go_asmfmt_autosave [default=0]
|
||||
"
|
||||
" Flag to automatically call :Fmt when file is saved.
|
||||
|
||||
|
@ -19,7 +19,7 @@ let s:got_fmt_error = 0
|
|||
|
||||
" This is a trimmed-down version of the logic in fmt.vim.
|
||||
|
||||
function! go#asmfmt#Format()
|
||||
function! go#asmfmt#Format() abort
|
||||
" Save state.
|
||||
let l:curw = winsaveview()
|
||||
|
||||
|
@ -41,7 +41,11 @@ function! go#asmfmt#Format()
|
|||
|
||||
" Replace the current file with the temp file; then reload the buffer.
|
||||
let old_fileformat = &fileformat
|
||||
" save old file permissions
|
||||
let original_fperm = getfperm(expand('%'))
|
||||
call rename(l:tmpname, expand('%'))
|
||||
" restore old file permissions
|
||||
call setfperm(expand('%'), original_fperm)
|
||||
silent edit!
|
||||
let &fileformat = old_fileformat
|
||||
let &syntax = &syntax
|
||||
|
@ -51,4 +55,15 @@ function! go#asmfmt#Format()
|
|||
call winrestview(l:curw)
|
||||
endfunction
|
||||
|
||||
function! go#asmfmt#ToggleAsmFmtAutoSave() abort
|
||||
if get(g:, "go_asmfmt_autosave", 0)
|
||||
let g:go_asmfmt_autosave = 1
|
||||
call go#util#EchoProgress("auto asmfmt enabled")
|
||||
return
|
||||
end
|
||||
|
||||
let g:go_asmfmt_autosave = 0
|
||||
call go#util#EchoProgress("auto asmfmt disabled")
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
|
|
@ -1,32 +1,38 @@
|
|||
if !exists("g:go_dispatch_enabled")
|
||||
let g:go_dispatch_enabled = 0
|
||||
endif
|
||||
|
||||
function! go#cmd#autowrite()
|
||||
function! go#cmd#autowrite() abort
|
||||
if &autowrite == 1
|
||||
silent wall
|
||||
silent! wall
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" Build builds the source code without producting any output binary. We live in
|
||||
" an editor so the best is to build it to catch errors and fix them. By
|
||||
" default it tries to call simply 'go build', but it first tries to get all
|
||||
" dependent files for the current folder and passes it to go build.
|
||||
function! go#cmd#Build(bang, ...)
|
||||
function! go#cmd#Build(bang, ...) abort
|
||||
" expand all wildcards(i.e: '%' to the current file name)
|
||||
let goargs = map(copy(a:000), "expand(v:val)")
|
||||
|
||||
" escape all shell arguments before we pass it to make
|
||||
let goargs = go#util#Shelllist(goargs, 1)
|
||||
|
||||
if !has('nvim')
|
||||
let goargs = go#util#Shelllist(goargs, 1)
|
||||
endif
|
||||
" create our command arguments. go build discards any results when it
|
||||
" compiles multiple packages. So we pass the `errors` package just as an
|
||||
" placeholder with the current folder (indicated with '.')
|
||||
let args = ["build"] + goargs + [".", "errors"]
|
||||
|
||||
" if we have nvim, call it asynchronously and return early ;)
|
||||
if has('nvim')
|
||||
if go#util#has_job()
|
||||
if get(g:, 'go_echo_command_info', 1)
|
||||
call go#util#EchoProgress("building dispatched ...")
|
||||
endif
|
||||
|
||||
call s:cmd_job({
|
||||
\ 'cmd': ['go'] + args,
|
||||
\ 'bang': a:bang,
|
||||
\})
|
||||
return
|
||||
elseif has('nvim')
|
||||
" if we have nvim, call it asynchronously and return early ;)
|
||||
call go#util#EchoProgress("building dispatched ...")
|
||||
call go#jobcontrol#Spawn(a:bang, "build", args)
|
||||
return
|
||||
|
@ -44,10 +50,7 @@ function! go#cmd#Build(bang, ...)
|
|||
let dir = getcwd()
|
||||
try
|
||||
execute cd . fnameescape(expand("%:p:h"))
|
||||
if g:go_dispatch_enabled && exists(':Make') == 2
|
||||
call go#util#EchoProgress("building dispatched ...")
|
||||
silent! exe 'Make'
|
||||
elseif l:listtype == "locationlist"
|
||||
if l:listtype == "locationlist"
|
||||
silent! exe 'lmake!'
|
||||
else
|
||||
silent! exe 'make!'
|
||||
|
@ -59,11 +62,8 @@ function! go#cmd#Build(bang, ...)
|
|||
|
||||
let errors = go#list#Get(l:listtype)
|
||||
call go#list#Window(l:listtype, len(errors))
|
||||
|
||||
if !empty(errors)
|
||||
if !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
endif
|
||||
if !empty(errors) && !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
else
|
||||
call go#util#EchoSuccess("[build] SUCCESS")
|
||||
endif
|
||||
|
@ -74,7 +74,7 @@ endfunction
|
|||
|
||||
|
||||
" Run runs the current file (and their dependencies if any) in a new terminal.
|
||||
function! go#cmd#RunTerm(bang, mode, files)
|
||||
function! go#cmd#RunTerm(bang, mode, files) abort
|
||||
if empty(a:files)
|
||||
let cmd = "go run ". go#util#Shelljoin(go#tool#Files())
|
||||
else
|
||||
|
@ -87,12 +87,18 @@ endfunction
|
|||
" This is intented to test small programs and play with them. It's not
|
||||
" suitable for long running apps, because vim is blocking by default and
|
||||
" calling long running apps will block the whole UI.
|
||||
function! go#cmd#Run(bang, ...)
|
||||
function! go#cmd#Run(bang, ...) abort
|
||||
if has('nvim')
|
||||
call go#cmd#RunTerm(a:bang, '', a:000)
|
||||
return
|
||||
endif
|
||||
|
||||
if go#util#has_job()
|
||||
" NOTE(arslan): 'term': 'open' case is not implement for +jobs. This means
|
||||
" executions waiting for stdin will not work. That's why we don't do
|
||||
" anything. Once this is implemented we're going to make :GoRun async
|
||||
endif
|
||||
|
||||
let old_gopath = $GOPATH
|
||||
let $GOPATH = go#path#Detect()
|
||||
|
||||
|
@ -118,9 +124,7 @@ function! go#cmd#Run(bang, ...)
|
|||
|
||||
let l:listtype = go#list#Type("quickfix")
|
||||
|
||||
if g:go_dispatch_enabled && exists(':Make') == 2
|
||||
silent! exe 'Make'
|
||||
elseif l:listtype == "locationlist"
|
||||
if l:listtype == "locationlist"
|
||||
exe 'lmake!'
|
||||
else
|
||||
exe 'make!'
|
||||
|
@ -129,7 +133,7 @@ function! go#cmd#Run(bang, ...)
|
|||
let items = go#list#Get(l:listtype)
|
||||
let errors = go#tool#FilterValids(items)
|
||||
|
||||
call go#list#Populate(l:listtype, errors)
|
||||
call go#list#Populate(l:listtype, errors, &makeprg)
|
||||
call go#list#Window(l:listtype, len(errors))
|
||||
if !empty(errors) && !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
|
@ -140,9 +144,30 @@ function! go#cmd#Run(bang, ...)
|
|||
endfunction
|
||||
|
||||
" Install installs the package by simple calling 'go install'. If any argument
|
||||
" is given(which are passed directly to 'go install') it tries to install those
|
||||
" packages. Errors are populated in the location window.
|
||||
function! go#cmd#Install(bang, ...)
|
||||
" is given(which are passed directly to 'go install') it tries to install
|
||||
" those packages. Errors are populated in the location window.
|
||||
function! go#cmd#Install(bang, ...) abort
|
||||
" use vim's job functionality to call it asynchronously
|
||||
if go#util#has_job()
|
||||
" expand all wildcards(i.e: '%' to the current file name)
|
||||
let goargs = map(copy(a:000), "expand(v:val)")
|
||||
|
||||
" escape all shell arguments before we pass it to make
|
||||
let goargs = go#util#Shelllist(goargs, 1)
|
||||
|
||||
if get(g:, 'go_echo_command_info', 1)
|
||||
call go#util#EchoProgress("installing dispatched ...")
|
||||
endif
|
||||
|
||||
call s:cmd_job({
|
||||
\ 'cmd': ['go', 'install'] + goargs,
|
||||
\ 'bang': a:bang,
|
||||
\})
|
||||
return
|
||||
endif
|
||||
|
||||
let old_gopath = $GOPATH
|
||||
let $GOPATH = go#path#Detect()
|
||||
let default_makeprg = &makeprg
|
||||
|
||||
" :make expands '%' and '#' wildcards, so they must also be escaped
|
||||
|
@ -156,10 +181,7 @@ function! go#cmd#Install(bang, ...)
|
|||
let dir = getcwd()
|
||||
try
|
||||
execute cd . fnameescape(expand("%:p:h"))
|
||||
if g:go_dispatch_enabled && exists(':Make') == 2
|
||||
call go#util#EchoProgress("building dispatched ...")
|
||||
silent! exe 'Make'
|
||||
elseif l:listtype == "locationlist"
|
||||
if l:listtype == "locationlist"
|
||||
silent! exe 'lmake!'
|
||||
else
|
||||
silent! exe 'make!'
|
||||
|
@ -171,21 +193,20 @@ function! go#cmd#Install(bang, ...)
|
|||
|
||||
let errors = go#list#Get(l:listtype)
|
||||
call go#list#Window(l:listtype, len(errors))
|
||||
if !empty(errors)
|
||||
if !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
endif
|
||||
if !empty(errors) && !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
else
|
||||
redraws! | echon "vim-go: " | echohl Function | echon "installed to ". $GOPATH | echohl None
|
||||
call go#util#EchoSuccess("installed to ". $GOPATH)
|
||||
endif
|
||||
|
||||
let $GOPATH = old_gopath
|
||||
let &makeprg = default_makeprg
|
||||
endfunction
|
||||
|
||||
" Test runs `go test` in the current directory. If compile is true, it'll
|
||||
" compile the tests instead of running them (useful to catch errors in the
|
||||
" test files). Any other argument is appendend to the final `go test` command
|
||||
function! go#cmd#Test(bang, compile, ...)
|
||||
function! go#cmd#Test(bang, compile, ...) abort
|
||||
let args = ["test"]
|
||||
|
||||
" don't run the test, only compile it. Useful to capture and fix errors.
|
||||
|
@ -195,9 +216,15 @@ function! go#cmd#Test(bang, compile, ...)
|
|||
endif
|
||||
|
||||
if a:0
|
||||
" expand all wildcards(i.e: '%' to the current file name)
|
||||
let goargs = map(copy(a:000), "expand(v:val)")
|
||||
if !has('nvim')
|
||||
let goargs = a:000
|
||||
|
||||
" do not expand for coverage mode as we're passing the arg ourself
|
||||
if a:1 != '-coverprofile'
|
||||
" expand all wildcards(i.e: '%' to the current file name)
|
||||
let goargs = map(copy(a:000), "expand(v:val)")
|
||||
endif
|
||||
|
||||
if !(has('nvim') || go#util#has_job())
|
||||
let goargs = go#util#Shelllist(goargs, 1)
|
||||
endif
|
||||
|
||||
|
@ -208,13 +235,29 @@ function! go#cmd#Test(bang, compile, ...)
|
|||
call add(args, printf("-timeout=%s", timeout))
|
||||
endif
|
||||
|
||||
if a:compile
|
||||
echon "vim-go: " | echohl Identifier | echon "compiling tests ..." | echohl None
|
||||
else
|
||||
echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None
|
||||
if get(g:, 'go_echo_command_info', 1)
|
||||
if a:compile
|
||||
echon "vim-go: " | echohl Identifier | echon "compiling tests ..." | echohl None
|
||||
else
|
||||
echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('nvim')
|
||||
if go#util#has_job()
|
||||
" use vim's job functionality to call it asynchronously
|
||||
let job_args = {
|
||||
\ 'cmd': ['go'] + args,
|
||||
\ 'bang': a:bang,
|
||||
\ }
|
||||
|
||||
if a:compile
|
||||
let job_args['custom_cb'] = function('s:test_compile', [compile_file])
|
||||
endif
|
||||
|
||||
call s:cmd_job(job_args)
|
||||
return
|
||||
elseif has('nvim')
|
||||
" use nvims's job functionality
|
||||
if get(g:, 'go_term_enabled', 0)
|
||||
let id = go#term#new(a:bang, ["go"] + args)
|
||||
else
|
||||
|
@ -248,7 +291,7 @@ function! go#cmd#Test(bang, compile, ...)
|
|||
let errors = go#tool#ParseErrors(split(out, '\n'))
|
||||
let errors = go#tool#FilterValids(errors)
|
||||
|
||||
call go#list#Populate(l:listtype, errors)
|
||||
call go#list#Populate(l:listtype, errors, command)
|
||||
call go#list#Window(l:listtype, len(errors))
|
||||
if !empty(errors) && !a:bang
|
||||
call go#list#JumpToFirst(l:listtype)
|
||||
|
@ -272,7 +315,7 @@ endfunction
|
|||
|
||||
" Testfunc runs a single test that surrounds the current cursor position.
|
||||
" Arguments are passed to the `go test` command.
|
||||
function! go#cmd#TestFunc(bang, ...)
|
||||
function! go#cmd#TestFunc(bang, ...) abort
|
||||
" search flags legend (used only)
|
||||
" 'b' search backward instead of forward
|
||||
" 'c' accept a match at the cursor position
|
||||
|
@ -300,7 +343,7 @@ function! go#cmd#TestFunc(bang, ...)
|
|||
endfunction
|
||||
|
||||
" Generate runs 'go generate' in similar fashion to go#cmd#Build()
|
||||
function! go#cmd#Generate(bang, ...)
|
||||
function! go#cmd#Generate(bang, ...) abort
|
||||
let default_makeprg = &makeprg
|
||||
|
||||
let old_gopath = $GOPATH
|
||||
|
@ -318,9 +361,7 @@ function! go#cmd#Generate(bang, ...)
|
|||
let l:listtype = go#list#Type("quickfix")
|
||||
|
||||
echon "vim-go: " | echohl Identifier | echon "generating ..."| echohl None
|
||||
if g:go_dispatch_enabled && exists(':Make') == 2
|
||||
silent! exe 'Make'
|
||||
elseif l:listtype == "locationlist"
|
||||
if l:listtype == "locationlist"
|
||||
silent! exe 'lmake!'
|
||||
else
|
||||
silent! exe 'make!'
|
||||
|
@ -342,12 +383,79 @@ function! go#cmd#Generate(bang, ...)
|
|||
endfunction
|
||||
|
||||
|
||||
" ---------------------
|
||||
" | Vim job callbacks |
|
||||
" ---------------------
|
||||
|
||||
function s:cmd_job(args) abort
|
||||
let status_dir = expand('%:p:h')
|
||||
let started_at = reltime()
|
||||
|
||||
call go#statusline#Update(status_dir, {
|
||||
\ 'desc': "current status",
|
||||
\ 'type': a:args.cmd[1],
|
||||
\ 'state': "started",
|
||||
\})
|
||||
|
||||
" autowrite is not enabled for jobs
|
||||
call go#cmd#autowrite()
|
||||
|
||||
function! s:error_info_cb(job, exit_status, data) closure abort
|
||||
let status = {
|
||||
\ 'desc': 'last status',
|
||||
\ 'type': a:args.cmd[1],
|
||||
\ 'state': "success",
|
||||
\ }
|
||||
|
||||
if a:exit_status
|
||||
let status.state = "failed"
|
||||
endif
|
||||
|
||||
let elapsed_time = reltimestr(reltime(started_at))
|
||||
" strip whitespace
|
||||
let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||
let status.state .= printf(" (%ss)", elapsed_time)
|
||||
|
||||
call go#statusline#Update(status_dir, status)
|
||||
endfunction
|
||||
|
||||
let a:args.error_info_cb = function('s:error_info_cb')
|
||||
let callbacks = go#job#Spawn(a:args)
|
||||
|
||||
let start_options = {
|
||||
\ 'callback': callbacks.callback,
|
||||
\ 'close_cb': callbacks.close_cb,
|
||||
\ }
|
||||
|
||||
" modify GOPATH if needed
|
||||
let old_gopath = $GOPATH
|
||||
let $GOPATH = go#path#Detect()
|
||||
|
||||
" pre start
|
||||
let dir = getcwd()
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
|
||||
let jobdir = fnameescape(expand("%:p:h"))
|
||||
execute cd . jobdir
|
||||
|
||||
call job_start(a:args.cmd, start_options)
|
||||
|
||||
" post start
|
||||
execute cd . fnameescape(dir)
|
||||
let $GOPATH = old_gopath
|
||||
endfunction
|
||||
|
||||
|
||||
" test_compile is called when a GoTestCompile call is finished
|
||||
function! s:test_compile(test_file, job, exit_status, data) abort
|
||||
call delete(a:test_file)
|
||||
endfunction
|
||||
|
||||
" -----------------------
|
||||
" | Neovim job handlers |
|
||||
" -----------------------
|
||||
let s:test_compile_handlers = {}
|
||||
|
||||
function! s:test_compile_handler(job, exit_status, data)
|
||||
function! s:test_compile_handler(job, exit_status, data) abort
|
||||
if !has_key(s:test_compile_handlers, a:job.id)
|
||||
return
|
||||
endif
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
function! s:gocodeCurrentBuffer()
|
||||
let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix'
|
||||
|
||||
function! s:gocodeCurrentBuffer() abort
|
||||
let buf = getline(1, '$')
|
||||
if &encoding != 'utf-8'
|
||||
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
|
||||
|
@ -14,7 +16,7 @@ function! s:gocodeCurrentBuffer()
|
|||
return file
|
||||
endfunction
|
||||
|
||||
function! s:gocodeCommand(cmd, preargs, args)
|
||||
function! s:gocodeCommand(cmd, preargs, args) abort
|
||||
for i in range(0, len(a:args) - 1)
|
||||
let a:args[i] = go#util#Shellescape(a:args[i])
|
||||
endfor
|
||||
|
@ -30,11 +32,22 @@ function! s:gocodeCommand(cmd, preargs, args)
|
|||
" we might hit cache problems, as gocode doesn't handle well different
|
||||
" GOPATHS: https://github.com/nsf/gocode/issues/239
|
||||
let old_gopath = $GOPATH
|
||||
let old_goroot = $GOROOT
|
||||
let $GOPATH = go#path#Detect()
|
||||
let $GOROOT = go#util#env("goroot")
|
||||
|
||||
let result = go#util#System(printf('%s %s %s %s', go#util#Shellescape(bin_path), join(a:preargs), go#util#Shellescape(a:cmd), join(a:args)))
|
||||
let socket_type = get(g:, 'go_gocode_socket_type', s:sock_type)
|
||||
let cmd = printf('%s -sock %s %s %s %s',
|
||||
\ go#util#Shellescape(bin_path),
|
||||
\ socket_type,
|
||||
\ join(a:preargs),
|
||||
\ go#util#Shellescape(a:cmd),
|
||||
\ join(a:args)
|
||||
\ )
|
||||
|
||||
let result = go#util#System(cmd)
|
||||
let $GOPATH = old_gopath
|
||||
let $GOROOT = old_goroot
|
||||
|
||||
if go#util#ShellError() != 0
|
||||
return "[\"0\", []]"
|
||||
|
@ -46,12 +59,12 @@ function! s:gocodeCommand(cmd, preargs, args)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! s:gocodeCurrentBufferOpt(filename)
|
||||
function! s:gocodeCurrentBufferOpt(filename) abort
|
||||
return '-in=' . a:filename
|
||||
endfunction
|
||||
|
||||
let s:optionsEnabled = 0
|
||||
function! s:gocodeEnableOptions()
|
||||
function! s:gocodeEnableOptions() abort
|
||||
if s:optionsEnabled
|
||||
return
|
||||
endif
|
||||
|
@ -65,13 +78,14 @@ function! s:gocodeEnableOptions()
|
|||
|
||||
call go#util#System(printf('%s set propose-builtins %s', go#util#Shellescape(bin_path), s:toBool(get(g:, 'go_gocode_propose_builtins', 1))))
|
||||
call go#util#System(printf('%s set autobuild %s', go#util#Shellescape(bin_path), s:toBool(get(g:, 'go_gocode_autobuild', 1))))
|
||||
call go#util#System(printf('%s set unimported-packages %s', go#util#Shellescape(bin_path), s:toBool(get(g:, 'go_gocode_unimported_packages', 0))))
|
||||
endfunction
|
||||
|
||||
function! s:toBool(val)
|
||||
function! s:toBool(val) abort
|
||||
if a:val | return 'true ' | else | return 'false' | endif
|
||||
endfunction
|
||||
|
||||
function! s:gocodeAutocomplete()
|
||||
function! s:gocodeAutocomplete() abort
|
||||
call s:gocodeEnableOptions()
|
||||
|
||||
let filename = s:gocodeCurrentBuffer()
|
||||
|
@ -82,7 +96,7 @@ function! s:gocodeAutocomplete()
|
|||
return result
|
||||
endfunction
|
||||
|
||||
function! go#complete#GetInfo()
|
||||
function! go#complete#GetInfo() abort
|
||||
let offset = go#util#OffsetCursor()+1
|
||||
let filename = s:gocodeCurrentBuffer()
|
||||
let result = s:gocodeCommand('autocomplete',
|
||||
|
@ -123,7 +137,7 @@ function! go#complete#GetInfo()
|
|||
return ""
|
||||
endfunction
|
||||
|
||||
function! go#complete#Info(auto)
|
||||
function! go#complete#Info(auto) abort
|
||||
" auto is true if we were called by g:go_auto_type_info's autocmd
|
||||
let result = go#complete#GetInfo()
|
||||
if !empty(result)
|
||||
|
@ -133,12 +147,12 @@ function! go#complete#Info(auto)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! s:trim_bracket(val)
|
||||
function! s:trim_bracket(val) abort
|
||||
let a:val.word = substitute(a:val.word, '[(){}\[\]]\+$', '', '')
|
||||
return a:val
|
||||
endfunction
|
||||
|
||||
function! go#complete#Complete(findstart, base)
|
||||
function! go#complete#Complete(findstart, base) abort
|
||||
"findstart = 1 when we need to get the text length
|
||||
if a:findstart == 1
|
||||
execute "silent let g:gocomplete_completions = " . s:gocodeAutocomplete()
|
||||
|
@ -153,4 +167,16 @@ function! go#complete#Complete(findstart, base)
|
|||
endif
|
||||
endf
|
||||
|
||||
function! go#complete#ToggleAutoTypeInfo() abort
|
||||
if get(g:, "go_auto_type_info", 0)
|
||||
let g:go_auto_type_info = 0
|
||||
call go#util#EchoProgress("auto type info disabled")
|
||||
return
|
||||
end
|
||||
|
||||
let g:go_auto_type_info = 1
|
||||
call go#util#EchoProgress("auto type info enabled")
|
||||
endfunction
|
||||
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
|
|
@ -3,7 +3,7 @@ let s:toggle = 0
|
|||
" Buffer creates a new cover profile with 'go test -coverprofile' and changes
|
||||
" the current buffers highlighting to show covered and uncovered sections of
|
||||
" the code. If run again it clears the annotation.
|
||||
function! go#coverage#BufferToggle(bang, ...)
|
||||
function! go#coverage#BufferToggle(bang, ...) abort
|
||||
if s:toggle
|
||||
call go#coverage#Clear()
|
||||
return
|
||||
|
@ -20,7 +20,7 @@ endfunction
|
|||
" teh current buffers highlighting to show covered and uncovered sections of
|
||||
" the code. Calling it again reruns the tests and shows the last updated
|
||||
" coverage.
|
||||
function! go#coverage#Buffer(bang, ...)
|
||||
function! go#coverage#Buffer(bang, ...) abort
|
||||
" we use matchaddpos() which was introduce with 7.4.330, be sure we have
|
||||
" it: http://ftp.vim.org/vim/patches/7.4/7.4.330
|
||||
if !exists("*matchaddpos")
|
||||
|
@ -43,8 +43,17 @@ function! go#coverage#Buffer(bang, ...)
|
|||
|
||||
let s:toggle = 1
|
||||
let l:tmpname = tempname()
|
||||
let args = [a:bang, 0, "-coverprofile", l:tmpname]
|
||||
|
||||
if go#util#has_job()
|
||||
call s:coverage_job({
|
||||
\ 'cmd': ['go', 'test', '-coverprofile', l:tmpname],
|
||||
\ 'custom_cb': function('s:coverage_callback', [l:tmpname]),
|
||||
\ 'bang': a:bang,
|
||||
\ })
|
||||
return
|
||||
endif
|
||||
|
||||
let args = [a:bang, 0, "-coverprofile", l:tmpname]
|
||||
if a:0
|
||||
call extend(args, a:000)
|
||||
endif
|
||||
|
@ -75,11 +84,8 @@ function! go#coverage#Buffer(bang, ...)
|
|||
endfunction
|
||||
|
||||
" Clear clears and resets the buffer annotation matches
|
||||
function! go#coverage#Clear()
|
||||
" only reset the syntax if the user has syntax enabled
|
||||
if !empty(&syntax)
|
||||
if exists("g:syntax_on") | syntax enable | endif
|
||||
endif
|
||||
function! go#coverage#Clear() abort
|
||||
call clearmatches()
|
||||
|
||||
if exists("s:toggle") | let s:toggle = 0 | endif
|
||||
|
||||
|
@ -87,25 +93,34 @@ function! go#coverage#Clear()
|
|||
if exists("#BufWinLeave#<buffer>")
|
||||
autocmd! BufWinLeave <buffer>
|
||||
endif
|
||||
|
||||
call clearmatches()
|
||||
endfunction
|
||||
|
||||
" Browser creates a new cover profile with 'go test -coverprofile' and opens
|
||||
" a new HTML coverage page from that profile in a new browser
|
||||
function! go#coverage#Browser(bang, ...)
|
||||
function! go#coverage#Browser(bang, ...) abort
|
||||
let l:tmpname = tempname()
|
||||
let args = [a:bang, 0, "-coverprofile", l:tmpname]
|
||||
if go#util#has_job()
|
||||
call s:coverage_job({
|
||||
\ 'cmd': ['go', 'test', '-coverprofile', l:tmpname],
|
||||
\ 'custom_cb': function('s:coverage_browser_callback', [l:tmpname]),
|
||||
\ 'bang': a:bang,
|
||||
\ })
|
||||
return
|
||||
endif
|
||||
|
||||
let args = [a:bang, 0, "-coverprofile", l:tmpname]
|
||||
if a:0
|
||||
call extend(args, a:000)
|
||||
endif
|
||||
|
||||
let id = call('go#cmd#Test', args)
|
||||
if has('nvim')
|
||||
call go#jobcontrol#AddHandler(function('s:coverage_browser_handler'))
|
||||
let s:coverage_browser_handler_jobs[id] = l:tmpname
|
||||
return
|
||||
endif
|
||||
|
||||
|
||||
if go#util#ShellError() == 0
|
||||
let openHTML = 'go tool cover -html='.l:tmpname
|
||||
call go#tool#ExecuteInDir(openHTML)
|
||||
|
@ -116,7 +131,7 @@ endfunction
|
|||
|
||||
" Parses a single line from the cover file generated via go test -coverprofile
|
||||
" and returns a single coverage profile block.
|
||||
function! go#coverage#parsegocoverline(line)
|
||||
function! go#coverage#parsegocoverline(line) abort
|
||||
" file:startline.col,endline.col numstmt count
|
||||
let mx = '\([^:]\+\):\(\d\+\)\.\(\d\+\),\(\d\+\)\.\(\d\+\)\s\(\d\+\)\s\(\d\+\)'
|
||||
let tokens = matchlist(a:line, mx)
|
||||
|
@ -133,10 +148,10 @@ endfunction
|
|||
|
||||
" Generates matches to be added to matchaddpos for the given coverage profile
|
||||
" block
|
||||
function! go#coverage#genmatch(cov)
|
||||
let color = 'covered'
|
||||
function! go#coverage#genmatch(cov) abort
|
||||
let color = 'goCoverageCovered'
|
||||
if a:cov.cnt == 0
|
||||
let color = 'uncover'
|
||||
let color = 'goCoverageUncover'
|
||||
endif
|
||||
|
||||
let matches = []
|
||||
|
@ -183,7 +198,7 @@ function! go#coverage#genmatch(cov)
|
|||
endfunction
|
||||
|
||||
" Reads the given coverprofile file and annotates the current buffer
|
||||
function! go#coverage#overlay(file)
|
||||
function! go#coverage#overlay(file) abort
|
||||
if !filereadable(a:file)
|
||||
return
|
||||
endif
|
||||
|
@ -195,16 +210,16 @@ function! go#coverage#overlay(file)
|
|||
" contains matches for matchaddpos()
|
||||
let matches = []
|
||||
|
||||
" first mark all lines as normaltext. We use a custom group to not
|
||||
" first mark all lines as goCoverageNormalText. We use a custom group to not
|
||||
" interfere with other buffers highlightings. Because the priority is
|
||||
" lower than the cover and uncover matches, it'll be overriden.
|
||||
let cnt = 1
|
||||
while cnt <= line('$')
|
||||
call add(matches, {'group': 'normaltext', 'pos': [cnt], 'priority': 1})
|
||||
call add(matches, {'group': 'goCoverageNormalText', 'pos': [cnt], 'priority': 1})
|
||||
let cnt += 1
|
||||
endwhile
|
||||
|
||||
let fname = expand('%:t')
|
||||
let fname = expand('%')
|
||||
|
||||
" when called for a _test.go file, run the coverage for the actuall file
|
||||
" file
|
||||
|
@ -221,6 +236,9 @@ function! go#coverage#overlay(file)
|
|||
exe ":edit ". fnamemodify(fname, ":p")
|
||||
endif
|
||||
|
||||
" cov.file includes only the filename itself, without full path
|
||||
let fname = fnamemodify(fname, ":t")
|
||||
|
||||
for line in lines[1:]
|
||||
let cov = go#coverage#parsegocoverline(line)
|
||||
|
||||
|
@ -233,11 +251,6 @@ function! go#coverage#overlay(file)
|
|||
call extend(matches, go#coverage#genmatch(cov))
|
||||
endfor
|
||||
|
||||
syntax manual
|
||||
highlight normaltext term=bold ctermfg=darkgrey guifg=#75715E
|
||||
highlight covered term=bold ctermfg=green guifg=#A6E22E
|
||||
highlight uncover term=bold ctermfg=red guifg=#F92672
|
||||
|
||||
" clear the matches if we leave the buffer
|
||||
autocmd BufWinLeave <buffer> call go#coverage#Clear()
|
||||
|
||||
|
@ -247,6 +260,78 @@ function! go#coverage#overlay(file)
|
|||
endfunction
|
||||
|
||||
|
||||
" ---------------------
|
||||
" | Vim job callbacks |
|
||||
" ---------------------
|
||||
"
|
||||
function s:coverage_job(args)
|
||||
" autowrite is not enabled for jobs
|
||||
call go#cmd#autowrite()
|
||||
|
||||
let status_dir = expand('%:p:h')
|
||||
function! s:error_info_cb(job, exit_status, data) closure
|
||||
let status = {
|
||||
\ 'desc': 'last status',
|
||||
\ 'type': "coverage",
|
||||
\ 'state': "finished",
|
||||
\ }
|
||||
|
||||
if a:exit_status
|
||||
let status.state = "failed"
|
||||
endif
|
||||
|
||||
call go#statusline#Update(status_dir, status)
|
||||
endfunction
|
||||
|
||||
let a:args.error_info_cb = function('s:error_info_cb')
|
||||
let callbacks = go#job#Spawn(a:args)
|
||||
|
||||
let start_options = {
|
||||
\ 'callback': callbacks.callback,
|
||||
\ 'close_cb': callbacks.close_cb,
|
||||
\ }
|
||||
|
||||
" modify GOPATH if needed
|
||||
let old_gopath = $GOPATH
|
||||
let $GOPATH = go#path#Detect()
|
||||
|
||||
" pre start
|
||||
let dir = getcwd()
|
||||
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
|
||||
let jobdir = fnameescape(expand("%:p:h"))
|
||||
execute cd . jobdir
|
||||
|
||||
call go#statusline#Update(status_dir, {
|
||||
\ 'desc': "current status",
|
||||
\ 'type': "coverage",
|
||||
\ 'state': "started",
|
||||
\})
|
||||
|
||||
call job_start(a:args.cmd, start_options)
|
||||
|
||||
" post start
|
||||
execute cd . fnameescape(dir)
|
||||
let $GOPATH = old_gopath
|
||||
endfunction
|
||||
|
||||
" coverage_callback is called when the coverage execution is finished
|
||||
function! s:coverage_callback(coverfile, job, exit_status, data)
|
||||
if a:exit_status == 0
|
||||
call go#coverage#overlay(a:coverfile)
|
||||
endif
|
||||
|
||||
call delete(a:coverfile)
|
||||
endfunction
|
||||
|
||||
function! s:coverage_browser_callback(coverfile, job, exit_status, data)
|
||||
if a:exit_status == 0
|
||||
let openHTML = 'go tool cover -html='.a:coverfile
|
||||
call go#tool#ExecuteInDir(openHTML)
|
||||
endif
|
||||
|
||||
call delete(a:coverfile)
|
||||
endfunction
|
||||
|
||||
" -----------------------
|
||||
" | Neovim job handlers |
|
||||
" -----------------------
|
||||
|
@ -254,7 +339,7 @@ endfunction
|
|||
let s:coverage_handler_jobs = {}
|
||||
let s:coverage_browser_handler_jobs = {}
|
||||
|
||||
function! s:coverage_handler(job, exit_status, data)
|
||||
function! s:coverage_handler(job, exit_status, data) abort
|
||||
if !has_key(s:coverage_handler_jobs, a:job.id)
|
||||
return
|
||||
endif
|
||||
|
@ -267,7 +352,7 @@ function! s:coverage_handler(job, exit_status, data)
|
|||
unlet s:coverage_handler_jobs[a:job.id]
|
||||
endfunction
|
||||
|
||||
function! s:coverage_browser_handler(job, exit_status, data)
|
||||
function! s:coverage_browser_handler(job, exit_status, data) abort
|
||||
if !has_key(s:coverage_browser_handler_jobs, a:job.id)
|
||||
return
|
||||
endif
|
||||
|
@ -282,4 +367,5 @@ function! s:coverage_browser_handler(job, exit_status, data)
|
|||
unlet s:coverage_browser_handler_jobs[a:job.id]
|
||||
endfunction
|
||||
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
let s:go_stack = []
|
||||
let s:go_stack_level = 0
|
||||
|
||||
function! go#def#Jump(mode)
|
||||
function! go#def#Jump(mode) abort
|
||||
let old_gopath = $GOPATH
|
||||
let $GOPATH = go#path#Detect()
|
||||
|
||||
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
|
||||
if &modified
|
||||
" Write current unsaved buffer to a temp file and use the modified content
|
||||
let l:tmpname = tempname()
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
let fname = l:tmpname
|
||||
endif
|
||||
|
||||
" so guru right now is slow for some people. previously we were using
|
||||
" godef which also has it's own quirks. But this issue come up so many
|
||||
|
@ -19,6 +13,13 @@ function! go#def#Jump(mode)
|
|||
" covers all edge cases, but now anyone can switch to godef if they wish
|
||||
let bin_name = get(g:, 'go_def_mode', 'guru')
|
||||
if bin_name == 'godef'
|
||||
if &modified
|
||||
" Write current unsaved buffer to a temp file and use the modified content
|
||||
let l:tmpname = tempname()
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
let fname = l:tmpname
|
||||
endif
|
||||
|
||||
let bin_path = go#path#CheckBinPath("godef")
|
||||
if empty(bin_path)
|
||||
let $GOPATH = old_gopath
|
||||
|
@ -26,11 +27,9 @@ function! go#def#Jump(mode)
|
|||
endif
|
||||
let command = printf("%s -f=%s -o=%s -t", bin_path, fname, go#util#OffsetCursor())
|
||||
let out = go#util#System(command)
|
||||
|
||||
" append the type information to the same line so our
|
||||
" jump_to_declaration() function can parse it. This makes it
|
||||
" compatible with guru definition as well too
|
||||
let out = join(split(out, '\n'), ':')
|
||||
if exists("l:tmpname")
|
||||
call delete(l:tmpname)
|
||||
endif
|
||||
elseif bin_name == 'guru'
|
||||
let bin_path = go#path#CheckBinPath("guru")
|
||||
if empty(bin_path)
|
||||
|
@ -38,36 +37,78 @@ function! go#def#Jump(mode)
|
|||
return
|
||||
endif
|
||||
|
||||
let flags = ""
|
||||
if exists('g:go_guru_tags')
|
||||
let tags = get(g:, 'go_guru_tags')
|
||||
let flags = printf(" -tags %s", tags)
|
||||
let cmd = [bin_path]
|
||||
let stdin_content = ""
|
||||
|
||||
if &modified
|
||||
let sep = go#util#LineEnding()
|
||||
let content = join(getline(1, '$'), sep)
|
||||
let stdin_content = fname . "\n" . strlen(content) . "\n" . content
|
||||
call add(cmd, "-modified")
|
||||
endif
|
||||
|
||||
let fname = shellescape(fname.':#'.go#util#OffsetCursor())
|
||||
let command = printf("%s %s definition %s", bin_path, flags, fname)
|
||||
let out = go#util#System(command)
|
||||
if exists('g:go_guru_tags')
|
||||
let tags = get(g:, 'go_guru_tags')
|
||||
call extend(cmd, ["-tags", tags])
|
||||
endif
|
||||
|
||||
let fname = fname.':#'.go#util#OffsetCursor()
|
||||
call extend(cmd, ["definition", fname])
|
||||
|
||||
if go#util#has_job()
|
||||
let l:spawn_args = {
|
||||
\ 'cmd': cmd,
|
||||
\ 'custom_cb': function('s:jump_to_declaration_cb', [a:mode, bin_name]),
|
||||
\ }
|
||||
|
||||
if &modified
|
||||
let l:spawn_args.input = stdin_content
|
||||
endif
|
||||
|
||||
call go#util#EchoProgress("searching declaration ...")
|
||||
|
||||
call s:def_job(spawn_args)
|
||||
return
|
||||
endif
|
||||
|
||||
let command = join(cmd, " ")
|
||||
if &modified
|
||||
let out = go#util#System(command, stdin_content)
|
||||
else
|
||||
let out = go#util#System(command)
|
||||
endif
|
||||
else
|
||||
call go#util#EchoError('go_def_mode value: '. bin_name .' is not valid. Valid values are: [godef, guru]')
|
||||
return
|
||||
endif
|
||||
|
||||
if exists("l:tmpname")
|
||||
call delete(l:tmpname)
|
||||
endif
|
||||
|
||||
if go#util#ShellError() != 0
|
||||
call go#util#EchoError(out)
|
||||
return
|
||||
endif
|
||||
|
||||
call s:jump_to_declaration(out, a:mode)
|
||||
call s:jump_to_declaration(out, a:mode, bin_name)
|
||||
let $GOPATH = old_gopath
|
||||
endfunction
|
||||
|
||||
function! s:jump_to_declaration(out, mode)
|
||||
function! s:jump_to_declaration_cb(mode, bin_name, job, exit_status, data) abort
|
||||
if a:exit_status != 0
|
||||
return
|
||||
endif
|
||||
|
||||
call s:jump_to_declaration(a:data[0], a:mode, a:bin_name)
|
||||
endfunction
|
||||
|
||||
function! s:jump_to_declaration(out, mode, bin_name) abort
|
||||
let final_out = a:out
|
||||
if a:bin_name == "godef"
|
||||
" append the type information to the same line so our we can parse it.
|
||||
" This makes it compatible with guru output.
|
||||
let final_out = join(split(a:out, '\n'), ':')
|
||||
endif
|
||||
|
||||
" strip line ending
|
||||
let out = split(a:out, go#util#LineEnding())[0]
|
||||
let out = split(final_out, go#util#LineEnding())[0]
|
||||
if go#util#IsWin()
|
||||
let parts = split(out, '\(^[a-zA-Z]\)\@<!:')
|
||||
else
|
||||
|
@ -98,24 +139,35 @@ function! s:jump_to_declaration(out, mode)
|
|||
" modes of switchbuf which we need based on the split mode
|
||||
let old_switchbuf = &switchbuf
|
||||
|
||||
" jump to existing buffer if, 1. we have enabled it, 2. the buffer is loaded
|
||||
" and 3. there is buffer window number we switch to
|
||||
if get(g:, 'go_def_reuse_buffer', 0) && bufloaded(filename) != 0 && bufwinnr(filename) != -1
|
||||
" jumpt to existing buffer if it exists
|
||||
execute bufwinnr(filename) . 'wincmd w'
|
||||
elseif a:mode == "tab"
|
||||
let &switchbuf = "usetab"
|
||||
if bufloaded(filename) == 0
|
||||
tab split
|
||||
endif
|
||||
elseif a:mode == "split"
|
||||
split
|
||||
elseif a:mode == "vsplit"
|
||||
vsplit
|
||||
endif
|
||||
normal! m'
|
||||
if filename != fnamemodify(expand("%"), ':p:gs?\\?/?')
|
||||
" jump to existing buffer if, 1. we have enabled it, 2. the buffer is loaded
|
||||
" and 3. there is buffer window number we switch to
|
||||
if get(g:, 'go_def_reuse_buffer', 0) && bufloaded(filename) != 0 && bufwinnr(filename) != -1
|
||||
" jumpt to existing buffer if it exists
|
||||
execute bufwinnr(filename) . 'wincmd w'
|
||||
else
|
||||
if &modified
|
||||
let cmd = 'hide edit'
|
||||
else
|
||||
let cmd = 'edit'
|
||||
endif
|
||||
|
||||
" open the file and jump to line and column
|
||||
exec 'edit '.filename
|
||||
if a:mode == "tab"
|
||||
let &switchbuf = "usetab"
|
||||
if bufloaded(filename) == 0
|
||||
tab split
|
||||
endif
|
||||
elseif a:mode == "split"
|
||||
split
|
||||
elseif a:mode == "vsplit"
|
||||
vsplit
|
||||
endif
|
||||
|
||||
" open the file and jump to line and column
|
||||
exec cmd filename
|
||||
endif
|
||||
endif
|
||||
call cursor(line, col)
|
||||
|
||||
" also align the line to middle of the view
|
||||
|
@ -124,7 +176,7 @@ function! s:jump_to_declaration(out, mode)
|
|||
let &switchbuf = old_switchbuf
|
||||
endfunction
|
||||
|
||||
function! go#def#SelectStackEntry()
|
||||
function! go#def#SelectStackEntry() abort
|
||||
let target_window = go#ui#GetReturnWindow()
|
||||
if empty(target_window)
|
||||
let target_window = winnr()
|
||||
|
@ -139,7 +191,7 @@ function! go#def#SelectStackEntry()
|
|||
call go#ui#CloseWindow()
|
||||
endfunction
|
||||
|
||||
function! go#def#StackUI()
|
||||
function! go#def#StackUI() abort
|
||||
if len(s:go_stack) == 0
|
||||
call go#util#EchoError("godef stack empty")
|
||||
return
|
||||
|
@ -174,12 +226,12 @@ function! go#def#StackUI()
|
|||
noremap <buffer> <silent> q :<C-U>call go#ui#CloseWindow()<CR>
|
||||
endfunction
|
||||
|
||||
function! go#def#StackClear(...)
|
||||
function! go#def#StackClear(...) abort
|
||||
let s:go_stack = []
|
||||
let s:go_stack_level = 0
|
||||
endfunction
|
||||
|
||||
function! go#def#StackPop(...)
|
||||
function! go#def#StackPop(...) abort
|
||||
if len(s:go_stack) == 0
|
||||
call go#util#EchoError("godef stack empty")
|
||||
return
|
||||
|
@ -200,7 +252,7 @@ function! go#def#StackPop(...)
|
|||
call go#def#Stack(newLevel + 1)
|
||||
endfunction
|
||||
|
||||
function! go#def#Stack(...)
|
||||
function! go#def#Stack(...) abort
|
||||
if len(s:go_stack) == 0
|
||||
call go#util#EchoError("godef stack empty")
|
||||
return
|
||||
|
@ -228,7 +280,13 @@ function! go#def#Stack(...)
|
|||
let target = s:go_stack[s:go_stack_level]
|
||||
|
||||
" jump
|
||||
exec 'edit '.target["file"]
|
||||
if expand('%:p') != target["file"]
|
||||
if &modified
|
||||
exec 'hide edit' target["file"]
|
||||
else
|
||||
exec 'edit' target["file"]
|
||||
endif
|
||||
endif
|
||||
call cursor(target["line"], target["col"])
|
||||
normal! zz
|
||||
else
|
||||
|
@ -236,4 +294,27 @@ function! go#def#Stack(...)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function s:def_job(args) abort
|
||||
function! s:error_info_cb(job, exit_status, data) closure
|
||||
" do not print anything during async definition search&jump
|
||||
endfunction
|
||||
|
||||
let a:args.error_info_cb = function('s:error_info_cb')
|
||||
let callbacks = go#job#Spawn(a:args)
|
||||
|
||||
let start_options = {
|
||||
\ 'callback': callbacks.callback,
|
||||
\ 'close_cb': callbacks.close_cb,
|
||||
\ }
|
||||
|
||||
if &modified
|
||||
let l:tmpname = tempname()
|
||||
call writefile(split(a:args.input, "\n"), l:tmpname, "b")
|
||||
let l:start_options.in_io = "file"
|
||||
let l:start_options.in_name = l:tmpname
|
||||
endif
|
||||
|
||||
call job_start(a:args.cmd, start_options)
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
|
|
@ -12,57 +12,39 @@ if !exists("g:go_doc_options")
|
|||
let g:go_doc_options = ""
|
||||
endif
|
||||
|
||||
" returns the package and exported name. exported name might be empty.
|
||||
" ie: fmt and Println
|
||||
" ie: github.com/fatih/set and New
|
||||
function! s:godocWord(args)
|
||||
if !executable('godoc')
|
||||
let msg = "godoc command not found."
|
||||
let msg .= " install with: go get golang.org/x/tools/cmd/godoc"
|
||||
call go#util#EchoWarning(msg)
|
||||
return []
|
||||
function! go#doc#OpenBrowser(...) abort
|
||||
" check if we have gogetdoc as it gives us more and accurate information.
|
||||
" Only supported if we have json_decode as it's not worth to parse the plain
|
||||
" non-json output of gogetdoc
|
||||
let bin_path = go#path#CheckBinPath('gogetdoc')
|
||||
if !empty(bin_path) && exists('*json_decode')
|
||||
let json_out = s:gogetdoc(1)
|
||||
if go#util#ShellError() != 0
|
||||
call go#util#EchoError(json_out)
|
||||
return
|
||||
endif
|
||||
|
||||
let out = json_decode(json_out)
|
||||
if type(out) != type({})
|
||||
call go#util#EchoError("gogetdoc output is malformed")
|
||||
endif
|
||||
|
||||
let import = out["import"]
|
||||
let name = out["name"]
|
||||
|
||||
" if import is empty, it means we selected a package name
|
||||
if import ==# ""
|
||||
let godoc_url = "https://godoc.org/" . name
|
||||
else
|
||||
let godoc_url = "https://godoc.org/" . import . "#" . name
|
||||
endif
|
||||
|
||||
echo godoc_url
|
||||
|
||||
call go#tool#OpenBrowser(godoc_url)
|
||||
return
|
||||
endif
|
||||
|
||||
if !len(a:args)
|
||||
let oldiskeyword = &iskeyword
|
||||
setlocal iskeyword+=.
|
||||
let word = expand('<cword>')
|
||||
let &iskeyword = oldiskeyword
|
||||
let word = substitute(word, '[^a-zA-Z0-9\\/._~-]', '', 'g')
|
||||
let words = split(word, '\.\ze[^./]\+$')
|
||||
else
|
||||
let words = a:args
|
||||
endif
|
||||
|
||||
if !len(words)
|
||||
return []
|
||||
endif
|
||||
|
||||
let pkg = words[0]
|
||||
if len(words) == 1
|
||||
let exported_name = ""
|
||||
else
|
||||
let exported_name = words[1]
|
||||
endif
|
||||
|
||||
let packages = go#tool#Imports()
|
||||
|
||||
if has_key(packages, pkg)
|
||||
let pkg = packages[pkg]
|
||||
endif
|
||||
|
||||
return [pkg, exported_name]
|
||||
endfunction
|
||||
|
||||
function! s:godocNotFound(content)
|
||||
if len(a:content) == 0
|
||||
return 1
|
||||
endif
|
||||
|
||||
return a:content =~# '^.*: no such file or directory\n$'
|
||||
endfunction
|
||||
|
||||
function! go#doc#OpenBrowser(...)
|
||||
let pkgs = s:godocWord(a:000)
|
||||
if empty(pkgs)
|
||||
return
|
||||
|
@ -76,7 +58,7 @@ function! go#doc#OpenBrowser(...)
|
|||
call go#tool#OpenBrowser(godoc_url)
|
||||
endfunction
|
||||
|
||||
function! go#doc#Open(newmode, mode, ...)
|
||||
function! go#doc#Open(newmode, mode, ...) abort
|
||||
if len(a:000)
|
||||
" check if we have 'godoc' and use it automatically
|
||||
let bin_path = go#path#CheckBinPath('godoc')
|
||||
|
@ -85,21 +67,11 @@ function! go#doc#Open(newmode, mode, ...)
|
|||
endif
|
||||
|
||||
let command = printf("%s %s", bin_path, join(a:000, ' '))
|
||||
let out = go#util#System(command)
|
||||
else
|
||||
" check if we have 'gogetdoc' and use it automatically
|
||||
let bin_path = go#path#CheckBinPath('gogetdoc')
|
||||
if empty(bin_path)
|
||||
return
|
||||
endif
|
||||
|
||||
let offset = go#util#OffsetCursor()
|
||||
let fname = expand("%:p:gs!\\!/!")
|
||||
let pos = shellescape(fname.':#'.offset)
|
||||
|
||||
let command = printf("%s -pos %s", bin_path, pos)
|
||||
let out = s:gogetdoc(0)
|
||||
endif
|
||||
|
||||
let out = go#util#System(command)
|
||||
if go#util#ShellError() != 0
|
||||
call go#util#EchoError(out)
|
||||
return
|
||||
|
@ -108,7 +80,7 @@ function! go#doc#Open(newmode, mode, ...)
|
|||
call s:GodocView(a:newmode, a:mode, out)
|
||||
endfunction
|
||||
|
||||
function! s:GodocView(newposition, position, content)
|
||||
function! s:GodocView(newposition, position, content) abort
|
||||
" reuse existing buffer window if it exists otherwise create a new one
|
||||
if !bufexists(s:buf_nr)
|
||||
execute a:newposition
|
||||
|
@ -152,4 +124,96 @@ function! s:GodocView(newposition, position, content)
|
|||
noremap <buffer> <silent> <Esc> :<C-U>close<CR>
|
||||
endfunction
|
||||
|
||||
function! s:gogetdoc(json) abort
|
||||
" check if we have 'gogetdoc' and use it automatically
|
||||
let bin_path = go#path#CheckBinPath('gogetdoc')
|
||||
if empty(bin_path)
|
||||
return -1
|
||||
endif
|
||||
|
||||
let cmd = [bin_path]
|
||||
|
||||
let offset = go#util#OffsetCursor()
|
||||
let fname = expand("%:p:gs!\\!/!")
|
||||
let pos = shellescape(fname.':#'.offset)
|
||||
|
||||
let cmd += ["-pos", pos]
|
||||
if a:json
|
||||
let cmd += ["-json"]
|
||||
endif
|
||||
|
||||
let command = join(cmd, " ")
|
||||
|
||||
if &modified
|
||||
" gogetdoc supports the same archive format as guru for dealing with
|
||||
" modified buffers.
|
||||
" use the -modified flag
|
||||
" write each archive entry on stdin as:
|
||||
" filename followed by newline
|
||||
" file size followed by newline
|
||||
" file contents
|
||||
let in = ""
|
||||
let sep = go#util#LineEnding()
|
||||
let content = join(getline(1, '$'), sep)
|
||||
let in = fname . "\n" . strlen(content) . "\n" . content
|
||||
let command .= " -modified"
|
||||
let out = go#util#System(command, in)
|
||||
else
|
||||
let out = go#util#System(command)
|
||||
endif
|
||||
|
||||
return out
|
||||
endfunction
|
||||
|
||||
" returns the package and exported name. exported name might be empty.
|
||||
" ie: fmt and Println
|
||||
" ie: github.com/fatih/set and New
|
||||
function! s:godocWord(args) abort
|
||||
if !executable('godoc')
|
||||
let msg = "godoc command not found."
|
||||
let msg .= " install with: go get golang.org/x/tools/cmd/godoc"
|
||||
call go#util#EchoWarning(msg)
|
||||
return []
|
||||
endif
|
||||
|
||||
if !len(a:args)
|
||||
let oldiskeyword = &iskeyword
|
||||
setlocal iskeyword+=.
|
||||
let word = expand('<cword>')
|
||||
let &iskeyword = oldiskeyword
|
||||
let word = substitute(word, '[^a-zA-Z0-9\\/._~-]', '', 'g')
|
||||
let words = split(word, '\.\ze[^./]\+$')
|
||||
else
|
||||
let words = a:args
|
||||
endif
|
||||
|
||||
if !len(words)
|
||||
return []
|
||||
endif
|
||||
|
||||
let pkg = words[0]
|
||||
if len(words) == 1
|
||||
let exported_name = ""
|
||||
else
|
||||
let exported_name = words[1]
|
||||
endif
|
||||
|
||||
let packages = go#tool#Imports()
|
||||
|
||||
if has_key(packages, pkg)
|
||||
let pkg = packages[pkg]
|
||||
endif
|
||||
|
||||
return [pkg, exported_name]
|
||||
endfunction
|
||||
|
||||
function! s:godocNotFound(content) abort
|
||||
if len(a:content) == 0
|
||||
return 1
|
||||
endif
|
||||
|
||||
return a:content =~# '^.*: no such file or directory\n$'
|
||||
endfunction
|
||||
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue