mirror of
https://github.com/rizzatti/dash.vim.git
synced 2026-03-03 18:24:03 +01:00
38 lines
908 B
VimL
38 lines
908 B
VimL
" Description: Search Dash.app from vim
|
|
" Author: Zeh Rizzatti <zehrizzatti@gmail.com>
|
|
" License: MIT
|
|
|
|
if exists('loaded_dash') || &compatible || v:version < 700
|
|
finish
|
|
endif
|
|
|
|
if has('win32') || match(system('uname'), 'Darwin') == -1
|
|
finish
|
|
endif
|
|
let loaded_dash = 1
|
|
|
|
let s:save_cpoptions = &cpoptions
|
|
set cpoptions&vim
|
|
|
|
"{{{ dash commands
|
|
if exists(':Dash') == 2
|
|
echohl WarningMsg
|
|
echomsg 'dash.vim: could not create command Dash'
|
|
echohl None
|
|
else
|
|
let definition = 'command -bang -complete=filetype -nargs=* Dash '
|
|
let callee = 'call dash#run("<bang>", <f-args>)'
|
|
execute definition callee
|
|
|
|
"{{{ <Plug> mappings
|
|
noremap <script> <unique> <Plug>DashFiletype <SID>DashFiletype
|
|
noremap <SID>DashFiletype :Dash<CR>
|
|
noremap <script> <unique> <Plug>DashGlobal <SID>DashGlobal
|
|
noremap <SID>DashGlobal :Dash!<CR>
|
|
"}}}
|
|
endif
|
|
"}}}
|
|
|
|
let &cpoptions = s:save_cpoptions
|
|
unlet s:save_cpoptions
|