1
0
mirror of https://github.com/amix/vimrc synced 2025-07-14 15:34:59 +08:00

Added vim-commentary and updarted the plugins.

commentary:
Comment stuff out.  Use `gcc` to comment out a line (takes a count),
`gc` to comment out the target of a motion (for example, `gcap` to
comment out a paragraph), and `gc` in visual mode to comment out the
selection.  That's it.
This commit is contained in:
amix
2014-03-02 14:35:00 +00:00
parent 8c9210dca4
commit 0d8e7370bd
56 changed files with 1330 additions and 873 deletions

View File

@ -1,4 +1,4 @@
if exists("g:loaded_syntastic_checker")
if exists("g:loaded_syntastic_checker") || !exists("g:loaded_syntastic_plugin")
finish
endif
let g:loaded_syntastic_checker = 1
@ -7,7 +7,7 @@ let g:SyntasticChecker = {}
" Public methods {{{1
function! g:SyntasticChecker.New(args)
function! g:SyntasticChecker.New(args) " {{{2
let newObj = copy(self)
let newObj._filetype = a:args['filetype']
@ -34,29 +34,29 @@ function! g:SyntasticChecker.New(args)
endif
return newObj
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getFiletype()
function! g:SyntasticChecker.getFiletype() " {{{2
return self._filetype
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getName()
function! g:SyntasticChecker.getName() " {{{2
return self._name
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getExec()
function! g:SyntasticChecker.getExec() " {{{2
if exists('g:syntastic_' . self._filetype . '_' . self._name . '_exec')
return expand(g:syntastic_{self._filetype}_{self._name}_exec)
endif
return self._exec
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getExecEscaped()
function! g:SyntasticChecker.getExecEscaped() " {{{2
return syntastic#util#shescape(self.getExec())
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getLocListRaw()
function! g:SyntasticChecker.getLocListRaw() " {{{2
let name = self._filetype . '/' . self._name
try
let list = self._locListFunc()
@ -69,13 +69,13 @@ function! g:SyntasticChecker.getLocListRaw()
call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
call self._quietMessages(list)
return list
endfunction
endfunction " }}}2
function! g:SyntasticChecker.getLocList()
function! g:SyntasticChecker.getLocList() " {{{2
return g:SyntasticLoclist.New(self.getLocListRaw())
endfunction
endfunction " }}}2
function! g:SyntasticChecker.makeprgBuild(opts)
function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
let basename = self._filetype . '_' . self._name . '_'
let parts = []
@ -86,23 +86,42 @@ function! g:SyntasticChecker.makeprgBuild(opts)
call extend(parts, self._getOpt(a:opts, basename, 'tail', ''))
return join(parts)
endfunction
endfunction " }}}2
function! g:SyntasticChecker.isAvailable()
function! g:SyntasticChecker.isAvailable() " {{{2
return self._isAvailableFunc()
endfunction
endfunction " }}}2
" }}}1
" Private methods {{{1
function! g:SyntasticChecker._quietMessages(errors)
let filter = 'g:syntastic_' . self._filetype . '_' . self._name . '_quiet_messages'
if exists(filter) && type({filter}) == type({}) && !empty({filter})
call syntastic#util#dictFilter(a:errors, {filter})
call syntastic#log#debug(g:SyntasticDebugLoclist, 'filtered by ' . filter . ':', a:errors)
function! g:SyntasticChecker._quietMessages(errors) " {{{2
" wildcard quiet_messages
let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
if type(quiet_filters) != type({})
call syntastic#log#warn('ignoring invalid syntastic_quiet_messages')
unlet quiet_filters
let quiet_filters = {}
endif
endfunction
function! g:SyntasticChecker._populateHighlightRegexes(errors)
" per checker quiet_messages
let name = self._filetype . '_' . self._name
try
call extend( quiet_filters, copy(syntastic#util#var(name . '_quiet_messages', {})), 'force' )
catch /\m^Vim\%((\a\+)\)\=:E712/
call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages')
endtry
call syntastic#log#debug(g:SyntasticDebugLoclist, 'quiet_messages filter:', quiet_filters)
if !empty(quiet_filters)
call syntastic#util#dictFilter(a:errors, quiet_filters)
call syntastic#log#debug(g:SyntasticDebugLoclist, 'filtered by quiet_messages:', a:errors)
endif
endfunction " }}}2
function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
if has_key(self, '_highlightRegexFunc')
for e in a:errors
if e['valid']
@ -113,9 +132,9 @@ function! g:SyntasticChecker._populateHighlightRegexes(errors)
endif
endfor
endif
endfunction
endfunction " }}}2
function! g:SyntasticChecker._getOpt(opts, basename, name, default)
function! g:SyntasticChecker._getOpt(opts, basename, name, default) " {{{2
let user_val = syntastic#util#var(a:basename . a:name)
let ret = []
call extend( ret, self._shescape(get(a:opts, a:name . '_before', '')) )
@ -123,9 +142,9 @@ function! g:SyntasticChecker._getOpt(opts, basename, name, default)
call extend( ret, self._shescape(get(a:opts, a:name . '_after', '')) )
return ret
endfunction
endfunction " }}}2
function! g:SyntasticChecker._shescape(opt)
function! g:SyntasticChecker._shescape(opt) " {{{2
if type(a:opt) == type('') && a:opt != ''
return [a:opt]
elseif type(a:opt) == type([])
@ -133,12 +152,16 @@ function! g:SyntasticChecker._shescape(opt)
endif
return []
endfunction
endfunction " }}}2
" }}}1
" Non-method functions {{{1
function! SyntasticCheckerIsAvailableDefault() dict
function! SyntasticCheckerIsAvailableDefault() dict " {{{2
return executable(self.getExec())
endfunction
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker: