-
-
Save pbackus/12e407ae96a54ced6ea9b3f72be25264 to your computer and use it in GitHub Desktop.
Vim config for D programming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ftplugin/d.vim | |
setlocal formatoptions+=ro | |
if len(glob("[Mm]akefile")) || len(glob("*.mak")) | |
compiler dmd | |
elseif filereadable("dub.sdl") || filereadable("dub.json") | |
compiler dub | |
else | |
compiler dmd | |
endif | |
if executable('xdg-open') | |
command -buffer -nargs=1 Dpldocs | |
\ execute 'silent !xdg-open "http://search.dpldocs.info/locate?q=<args>"' | redraw! | |
setlocal keywordprg=:Dpldocs | |
endif | |
setlocal include=^\\(\\s*static\\)\\?\\s*import\\s\\+\\([[:lower:][:upper:][:digit:]_]\\+\\s*=\\s*\\)\\?\\zs[[:lower:][:upper:][:digit:]_.]\\+\\ze | |
setlocal includeexpr=substitute(v:fname,'\\.','/','g') | |
setlocal suffixesadd=.d,.di |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" compiler/dmd.vim | |
" Compiler plugin for the Digital Mars D compiler | |
let current_compiler = "dmd" | |
" For compatibility with old versions of Vim | |
if exists(":CompilerSet") != 2 | |
command -nargs=* CompilerSet setlocal <args> | |
endif | |
" errorformat entries: | |
" - Errors from -verrors=spec (ignored) | |
" - Uncaught exceptions (e.g., from unit tests) | |
" - Errors in string mixins | |
" - Normal compile errors | |
CompilerSet errorformat= | |
\%-G\(spec:%*[0-9]\)\ %m, | |
\%*[^@]@%f\(%l\):\ %m, | |
\%f-mixin-%*[0-9]\(%l\\,%c\):\ %m, | |
\%f-mixin-%*[0-9]\(%l\):\ %m, | |
\%f\(%l\\,%c\):\ %m, | |
\%f\(%l\):\ %m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" compiler/dub.vim | |
" Compiler plugin for DUB | |
runtime compiler/dmd.vim | |
let current_compiler = "dub" | |
" For compatibility with old versions of Vim | |
if exists(":CompilerSet") != 2 | |
command -nargs=* CompilerSet setlocal <args> | |
endif | |
" Suppress non-error output to avoid spurious quickfix entries | |
CompilerSet makeprg=dub\ --verror |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment