Created
April 14, 2015 09:26
-
-
Save esnya/736a06dbca347c6cc52b to your computer and use it in GitHub Desktop.
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
"NeoBundle Scripts----------------------------- | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=/Users/u_yamada/.vim/bundle/neobundle.vim/ | |
endif | |
" Required: | |
call neobundle#begin(expand('$HOME/.vim/bundle')) | |
" Let NeoBundle manage NeoBundle | |
" Required: | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
" Add or remove your Bundles here: | |
NeoBundle 'Shougo/neosnippet.vim' | |
NeoBundle 'Shougo/neosnippet-snippets' | |
NeoBundle 'tpope/vim-fugitive' | |
NeoBundle 'ctrlpvim/ctrlp.vim' | |
NeoBundle 'flazz/vim-colorschemes' | |
NeoBundle 'Shougo/vimproc.vim', { | |
\ 'build' : { | |
\ 'windows' : 'tools\\update-dll-mingw', | |
\ 'cygwin' : 'make -f make_cygwin.mak', | |
\ 'mac' : 'make -f make_mac.mak', | |
\ 'linux' : 'make', | |
\ 'unix' : 'gmake', | |
\ }, | |
\ } | |
NeoBundle 'Shougo/vimshell' | |
NeoBundle 'Shougo/neocomplete.vim' | |
NeoBundleLazy 'Hackerpilot/DCD', {'autoload': {'filetypes': ['d']}, | |
\ 'build' : { | |
\ 'windows' : 'git submodule update --init && build.bat', | |
\ 'unix' : 'git submodule update --init && make', | |
\ 'linux' : 'git submodule update --init && make', | |
\ }, | |
\ } | |
NeoBundleLazy 'Hackerpilot/Dscanner', {'autoload': {'filetypes': ['d']}, | |
\ 'build' : { | |
\ 'windows' : 'build.bat', | |
\ 'unix' : 'make', | |
\ 'linux' : 'make', | |
\ }, | |
\ } | |
"NeoBundleLazy 'idanarye/vim-dutyl', {'autoload': {'filetypes': ['d']}} | |
NeoBundleLazy 'kyouryuukunn/vim-dutyl', {'autoload': {'filetypes': ['d']}} | |
NeoBundle 'thinca/vim-quickrun' | |
NeoBundle 'osyo-manga/shabadou.vim' | |
NeoBundle 'osyo-manga/vim-watchdogs' | |
NeoBundle 'jceb/vim-hier' | |
NeoBundle 'w0ng/vim-hybrid' | |
NeoBundle 'Shougo/unite.vim' | |
" Required: | |
call neobundle#end() | |
" Required: | |
filetype plugin indent on | |
" If there are uninstalled bundles found on startup, | |
" this will conveniently prompt you to install them. | |
NeoBundleCheck | |
"End NeoBundle Scripts------------------------- | |
" NeoComplete | |
let g:neocomplete#enable_at_startup = 1 | |
" dutyl {{{ | |
" ライブラリへのパスを設定 | |
"let g:dutyl_stdImportPaths=['E:/D/dmd2/src/phobos','E:/D/dmd2/src/druntime/import'] | |
"" 各種実行ファイルへのパスを登録、パスが通っているなら必要ないです。 | |
call dutyl#register#tool('dcd-client', $HOME.'/.vim/bundle/DCD/bin/dcd-client') | |
call dutyl#register#tool('dcd-server', $HOME.'/.vim/bundle/DCD/bin/dcd-server') | |
call dutyl#register#tool('dscanner', $HOME.'/.vim/bundle/Dscanner/bin/dscanner') | |
" }}} | |
" neocompleteと併用する場合の設定 | |
if !exists("g:neocomplete#force_omni_input_patterns") | |
let g:neocomplete#force_omni_input_patterns = {} | |
endif | |
let g:neocomplete#force_omni_input_patterns.d = '[^.[:digit:] *\t]\%(\.\|->\)\|::' | |
augroup dutyl | |
autocmd! | |
autocmd FileType d setlocal omnifunc=dutyl#dComplete | |
" <F1>でドキュメントを開く | |
autocmd FileType d nnoremap <buffer> <F1> :DUddoc<CR> | |
" \dで定義元にジャンプ | |
autocmd FileType d nnoremap <buffer> \d :DUjump<CR> | |
" server起動が面倒なので自動起動、終了するようにする | |
autocmd BufAdd *.d DUDCDstartServer | |
autocmd BufDelete *.d DUDCDstopServer | |
augroup END | |
" Quickrun | |
let g:quickrun_config = { | |
\ "_": { | |
\ "runner": "vimproc", | |
\ "runner/vimproc/updatetime": 100, | |
\ }, | |
\} | |
" Watchdogs | |
let g:watchdogs_check_BufWritePost_enable = 1 | |
let g:watchdogs_check_CursorHold_enable = 1 | |
function! SetWatchdogsDMD() | |
if has('win32') | |
let l:enc = 'sjis' | |
else | |
let l:enc = 'utf8' | |
end | |
let l:file = expand("%") | |
let l:src = strpart(l:file, 0, matchend(l:file, '^.*\(source\|src\)')) | |
let l:dir = fnamemodify(l:src, ':p:h:h') | |
let l:dub = l:dir . '/dub.json' | |
let l:pos = getpos(".") | |
if filereadable(l:dub) | |
let g:quickrun_config["watchdogs_checker/dmd"] = { | |
\ "command": "dub", | |
\ "exec": "%c test", | |
\ "hook/cd/enable" : 1, | |
\ "hook/cd/directory" : l:dir, | |
\ "hook/output_encode/enable": 1, | |
\ "hook/output_encode/encoding": l:enc | |
\} | |
elseif search("void main(") == 0 | |
let g:quickrun_config["watchdogs_checker/dmd"] = { | |
\ "command": "rdmd", | |
\ "exec": "%c -debug -g -w -unittest -main %o %s:p", | |
\ "hook/output_encode/enable": 1, | |
\ "hook/output_encode/encoding": l:enc | |
\} | |
else | |
let g:quickrun_config["watchdogs_checker/dmd"] = { | |
\ "command": "dmd", | |
\ "exec": "%c -debug -g -w -unittest -c -o- %o %s:p", | |
\ "hook/output_encode/enable": 1, | |
\ "hook/output_encode/encoding": l:enc | |
\} | |
endif | |
call setpos('.', l:pos) | |
call watchdogs#setup(g:quickrun_config) | |
endfunction | |
augroup dlang | |
autocmd! | |
autocmd FileType d call SetWatchdogsDMD() | |
autocmd BufAdd,BufWritePre *.d call SetWatchdogsDMD() | |
autocmd FileType d setlocal include=import | |
autocmd FileType d setlocal includeexpr=substitute(v:fname,'\\.','/','g') | |
autocmd FileType d setlocal suffixesadd=.d | |
autocmd FileType d setlocal errorformat=%s\@%f(%l):%m,%f(%l):\ Error:\ %m | |
autocmd FileType d setlocal path+=/usr/include/dmd/phobos | |
autocmd FileType d setlocal path+=/usr/include/dmd/druntime | |
augroup END | |
" 共通設定 | |
set hlsearch | |
set number | |
set shiftwidth=4 | |
set tabstop=4 | |
set noswapfile | |
colorscheme hybrid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment