-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdochub.vim
More file actions
20 lines (17 loc) · 835 Bytes
/
Copy pathdochub.vim
File metadata and controls
20 lines (17 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if !exists('g:launcher_application')
if has('mac')
let g:launcher_application='open'
elseif has('macunix')
let g:launcher_application='open'
else
let g:launcher_application='xdg-open'
endif
endif
function! s:Searchdochub(doc_type, keyword)
let url = '"http://dochub.io/\#'.a:doc_type.'/'.a:keyword.'"'
exe 'silent !' . g:launcher_application . ' ' . url
endfunction
nnoremap <silent> <Leader>hc :call <SID>Searchdochub('css',substitute(expand('<cWORD>'),'\A*$','',''))<CR>
nnoremap <silent> <Leader>hh :call <SID>Searchdochub('html',substitute(expand('<cword>'),'\A*$','',''))<CR>
nnoremap <silent> <Leader>hjq :call <SID>Searchdochub('jquery',substitute(expand('<cword>'),'\A*$','',''))<CR>
nnoremap <silent> <Leader>hjs :call <SID>Searchdochub('javascript',substitute(expand('<cword>'),'\A*$','',''))<CR>