Permalink
Browse files

updated plugins

  • Loading branch information...
1 parent ae4f9b9 commit cb71fa1264ca17ed5b9442104cf569853ae7c156 Kent Sibilev committed Mar 30, 2012
@@ -171,7 +171,7 @@ that are part of Git repositories).
i q, then open commit
o open commit in horizontal split
O open commit in new tab
- <CR> reblame at commit
+ - reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^[count])
@@ -186,6 +186,11 @@ that are part of Git repositories).
"git instaweb" from a terminal). If a range is given,
it is appropriately appended to the URL as an anchor.
+ To use with GitHub FI, point g:fugitive_github_domains
+ at a list of domains:
+>
+ let g:fugitive_github_domains = ['git.example.com']
+~
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
than opening it.
@@ -232,8 +232,12 @@ endfunction
function! s:repo_translate(spec) dict abort
if a:spec ==# '.' || a:spec ==# '/.'
return self.bare() ? self.dir() : self.tree()
+ elseif a:spec =~# '^/\=\.git$' && self.bare()
+ return self.dir()
+ elseif a:spec =~# '^/\=\.git/'
+ return self.dir(s:sub(a:spec, '^/=\.git/', ''))
elseif a:spec =~# '^/'
- return fnamemodify(self.dir(),':h').a:spec
+ return self.tree().a:spec
elseif a:spec =~# '^:[0-3]:'
return 'fugitive://'.self.dir().'//'.a:spec[1].'/'.a:spec[3:-1]
elseif a:spec ==# ':'
@@ -1529,6 +1533,7 @@ function! s:Blame(bang,line1,line2,count,args) abort
nnoremap <buffer> <silent> q :exe substitute('bdelete<Bar>'.bufwinnr(b:fugitive_blamed_bufnr).' wincmd w','<Bar>-1','','')<CR>
nnoremap <buffer> <silent> gq :exe substitute('bdelete<Bar>'.bufwinnr(b:fugitive_blamed_bufnr).' wincmd w<Bar>if expand("%:p") =~# "^fugitive:[\\/][\\/]"<Bar>Gedit<Bar>endif','<Bar>-1','','')<CR>
nnoremap <buffer> <silent> <CR> :<C-U>exe <SID>BlameJump('')<CR>
+ nnoremap <buffer> <silent> - :<C-U>exe <SID>BlameJump('')<CR>
nnoremap <buffer> <silent> P :<C-U>exe <SID>BlameJump('^'.v:count1)<CR>
nnoremap <buffer> <silent> ~ :<C-U>exe <SID>BlameJump('~'.v:count1)<CR>
nnoremap <buffer> <silent> i :<C-U>exe <SID>BlameCommit("exe 'norm q'<Bar>edit")<CR>
@@ -1754,11 +1759,15 @@ endfunction
function! s:github_url(repo,url,rev,commit,path,type,line1,line2) abort
let path = a:path
- let repo_path = matchstr(a:url,'^\%(https\=://\|git://\|git@\)github\.com[/:]\zs.\{-\}\ze\%(\.git\)\=$')
- if repo_path ==# ''
+ let domain_pattern = 'github\.com'
+ for domain in exists('g:fugitive_github_domains') ? g:fugitive_github_domains : []
+ let domain_pattern .= '\|' . escape(domain, '.')
+ endfor
+ let repo = matchstr(a:url,'^\%(https\=://\|git://\|git@\)\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
+ if repo ==# ''
return ''
endif
- let root = 'https://github.com/' . repo_path
+ let root = 'https://' . s:sub(repo,':','/')
if path =~# '^\.git/refs/heads/'
let branch = a:repo.git_chomp('config','branch.'.path[16:-1].'.merge')[11:-1]
if branch ==# ''
@@ -2253,7 +2262,7 @@ function! s:GF(mode) abort
endwhile
let offset += matchstr(getline(lnum), type.'\zs\d\+')
let ref = getline(search('^'.type.'\{3\} [ab]/','bnW'))[4:-1]
- let dcmd = '+'.offset.'|foldopen'
+ let dcmd = '+'.offset.'|if foldlevel(".")|foldopen!|endif'
let dref = ''
elseif getline('.') =~# '^rename from '
@@ -42,3 +42,6 @@ au BufNewFile,BufRead [tT]horfile,*.thor set filetype=ruby
" Rabl
au BufNewFile,BufRead *.rabl set filetype=ruby
+
+" jbuilder
+au BufNewFile,BufRead *.jbuilder set filetype=ruby
@@ -65,6 +65,41 @@ function! syntastic#c#GetIncludeDirs(filetype)
return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ')
endfunction
+" read additional compiler flags from the given configuration file
+" the file format and its parsing mechanism is inspired by clang_complete
+function! syntastic#c#ReadConfig(file)
+ " search in the current file's directory upwards
+ let config = findfile(a:file, '.;')
+ if config == '' || !filereadable(config) | return '' | endif
+
+ " convert filename into absolute path
+ let filepath = substitute(fnamemodify(config, ':p:h'), '\', '/', 'g')
+
+ " try to read config file
+ try
+ let lines = map(readfile(config),
+ \ 'substitute(v:val, ''\'', ''/'', ''g'')')
+ catch /E484/
+ return ''
+ endtry
+
+ let parameters = []
+ for line in lines
+ let matches = matchlist(line, '^\s*-I\s*\(\S\+\)')
+ if matches != [] && matches[1] != ''
+ " this one looks like an absolute path
+ if match(matches[1], '^\%(/\|\a:\)') != -1
+ call add(parameters, '-I' . matches[1])
+ else
+ call add(parameters, '-I' . filepath . '/' . matches[1])
+ endif
+ else
+ call add(parameters, line)
+ endif
+ endfor
+
+ return join(parameters, ' ')
+endfunction
" search the first 100 lines for include statements that are
" given in the handlers dictionary
@@ -46,6 +46,13 @@
"
" let g:syntastic_c_compiler_options = ' -ansi'
"
+" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
+" file that contains additional compiler arguments like include directories or
+" CFLAGS. The file is expected to contain one option per line. If none is
+" given the filename defaults to '.syntastic_c_config':
+"
+" let g:syntastic_c_config_file = '.config'
+"
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
" specify whether errors of files included via the g:syntastic_c_include_dirs'
" setting are removed from the result set:
@@ -68,6 +75,10 @@ if !exists('g:syntastic_c_compiler_options')
let g:syntastic_c_compiler_options = '-std=gnu99'
endif
+if !exists('g:syntastic_c_config_file')
+ let g:syntastic_c_config_file = '.syntastic_c_config'
+endif
+
function! SyntaxCheckers_c_GetLocList()
let makeprg = 'gcc -fsyntax-only '
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
@@ -113,6 +124,9 @@ function! SyntaxCheckers_c_GetLocList()
let makeprg .= b:syntastic_c_cflags
endif
+ " add optional config file parameters
+ let makeprg .= syntastic#c#ReadConfig(g:syntastic_c_config_file)
+
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
@@ -46,6 +46,13 @@
"
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
"
+" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define
+" a file that contains additional compiler arguments like include directories
+" or CFLAGS. The file is expected to contain one option per line. If none is
+" given the filename defaults to '.syntastic_cpp_config':
+"
+" let g:syntastic_cpp_config_file = '.config'
+"
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
" specify whether errors of files included via the
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
@@ -64,6 +71,10 @@ endif
let s:save_cpo = &cpo
set cpo&vim
+if !exists('g:syntastic_cpp_config_file')
+ let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
+endif
+
function! SyntaxCheckers_cpp_GetLocList()
let makeprg = 'g++ -fsyntax-only '
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
@@ -101,6 +112,9 @@ function! SyntaxCheckers_cpp_GetLocList()
let makeprg .= b:syntastic_cpp_cflags
endif
+ " add optional config file parameters
+ let makeprg .= syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
+
" process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat })
@@ -19,11 +19,16 @@ if !executable("ghc-mod")
finish
endif
+if !exists('g:syntastic_haskell_checker_args')
+ let g:syntastic_haskell_checker_args = '--hlintOpt="--language=XmlSyntax"'
+endif
+
function! SyntaxCheckers_haskell_GetLocList()
+ let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
let makeprg =
\ "{ ".
- \ "ghc-mod check ". shellescape(expand('%')) . "; " .
- \ "ghc-mod lint " . shellescape(expand('%')) . ";" .
+ \ ghcmod . " check ". shellescape(expand('%')) . "; " .
+ \ ghcmod . " lint " . shellescape(expand('%')) . ";" .
\ " }"
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,'.
@@ -40,7 +40,7 @@ function! SyntaxCheckers_php_GetLocList()
let errors = []
- let makeprg = "php -l -d error_reporting=E_PARSE -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
+ let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
@@ -26,6 +26,6 @@ endfunction
function! SyntaxCheckers_python_GetLocList()
let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
- let errorformat = '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
+ let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
View
11 vimrc
@@ -390,12 +390,13 @@ vnoremap <silent> g= :Tabularize assignment<CR>
" ctrlp settings {{{2
let g:ctrlp_extensions = ['buffertag', 'quickfix', 'dir', 'rtscript', 'undo', 'line', 'changes']
-let g:ctrlp_match_window_reversed=0
-let g:ctrlp_dotfiles=0
-let g:ctrlp_mruf_relative=0
-let g:ctrlp_open_multi='tr'
-let g:ctrlp_open_new_file='h'
+let g:ctrlp_match_window_reversed = 0
+let g:ctrlp_dotfiles = 0
+let g:ctrlp_mruf_relative = 0
+let g:ctrlp_open_multi = 'tr'
+let g:ctrlp_open_new_file = 'h'
let g:ctrlp_mruf_exclude = '\.git'
+let g:ctrlp_custom_ignore = 'tmp'
nnoremap <silent> <leader>m :CtrlPCurWD<CR>
nnoremap <silent> <leader>r :CtrlPRoot<CR>
nnoremap <silent> <leader>l :CtrlPBuffer<CR>

0 comments on commit cb71fa1

Please sign in to comment.