]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim
Relative path to zshfe.zsh
[dotfiles.git] / vim / .vim / pack / stargrave / start / zshfe / plugin / zshfe.vim
1 " zsh file completion caller
2 " Maintainer: Sergey Matveev <stargrave@stargrave.org>
3 " License: GNU General Public License version 3 of the License or later
4
5 if exists("*<SID>zshfe") | finish | endif
6 if !exists("g:zshfe_path")
7     let g:zshfe_path=expand("<sfile>:p:h") . "/zshfe.zsh"
8 endif
9
10 function! s:zshfe(query, opencmd)
11     silent let result = systemlist(g:zshfe_path . " " . a:query)
12     if len(result) == 0 | return | endif
13     exec a:opencmd . " " . result[0][:-2]
14 endfunction
15
16 command! -nargs=1 Fe call s:zshfe(<f-args>, "edit")
17 command! -nargs=1 Fsp call s:zshfe(<f-args>, "split")
18 command! -nargs=1 Fvs call s:zshfe(<f-args>, "vsplit")
19
20 nmap <Leader>e :Fe 
21 nmap <Leader><space> :Fsp 
22 nmap <Leader>v :Fvs