Skip to content

Instantly share code, notes, and snippets.

@delphinus
Last active August 12, 2018 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delphinus/0147966494aabec4d20b7b96d3da1e3c to your computer and use it in GitHub Desktop.
Save delphinus/0147966494aabec4d20b7b96d3da1e3c to your computer and use it in GitHub Desktop.
[dein.vim] hook の便利な使い方 ref: https://qiita.com/delphinus/items/cd221a450fd23506e81a
[[plugins]]
repo = 'Shougo/vimproc.vim'
hook_post_update = 'call delphinus#init#vimproc#hook_post_update()'
[[plugins]]
repo = 'tpope/vim-capslock'
hook_add = 'imap <C-L> <Plug>CapsLockToggle'
[[plugins]]
repo = 'elzr/vim-json'
hook_add = 'let g:vim_json_syntax_conceal = 0'
[[plugins]]
repo = 'Shougo/echodoc.vim'
hook_source = 'let g:echodoc_enable_at_startup = 1'
[[plugins]]
repo = 'osyo-manga/vim-watchdogs'
depends = [
'vim-hier',
'quickfixstatus',
'shabadou.vim',
'vim-quickrun',
]
# 追記参照 2016/05/09
on_event = ['FocusLost', 'CursorHold']
hook_add = '''
let g:quickrun_config = get(g:, 'quickrun_config', {})
let g:quickrun_config['watchdogs_checker/_'] = {'outputter/quickfix/open_cmd': ''}
let g:quickrun_config['watchdogs_checker/jshint'] = {'cmdopt': '--config `/.jshintrc'}
'''
hook_post_source = '''
call watchdogs#setup(g:quickrun_config)
'''
[[plugins]]
repo = 'Shougo/vimproc.vim'
build = 'make'
[[plugins]]
repo = 'Shougo/vimproc.vim'
hook_post_update = '''
if has('win32')
let cmd = 'tools\\update-dll-mingw'
elseif has('win32unix') " for Cygwin
let cmd = 'make -f make_cygwin.mak'
elseif executable('gmake')
let cmd = 'gmake'
else
let cmd = 'make'
endif
let g:dein#plugin.build = cmd
'''
function! delphinus#init#vimproc#hook_post_update() abort
if has('win32')
let cmd = 'tools\\update-dll-mingw'
elseif has('win32unix') " for Cygwin
let cmd = 'make -f make_cygwin.mak'
elseif executable('gmake')
let cmd = 'gmake'
else
let cmd = 'make'
endif
let g:dein#plugin.build = cmd
endfunction
set runtimepath+=~/.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment