X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fpack%2Fstargrave%2Fstart%2Fzshfe%2Fplugin%2Fzshfe.vim;h=cb05d99e930bf5d390446f5b1866e2a01e54c379;hb=9cbfa59ca421fac5422cbf0c2c52f48f8f2adb4c;hp=af3540bb7b6377acdb1d92fc978f2ae00bd68e72;hpb=c571224ad14b80a040c164399e7dede5dd31ebd0;p=dotfiles.git diff --git a/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim b/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim index af3540b..cb05d99 100644 --- a/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim +++ b/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim @@ -1,19 +1,17 @@ -" zsh file completion caller -" Maintainer: Sergey Matveev -" License: GNU General Public License version 3 of the License or later +vim9script -if exists("*zshfe") | finish | endif -if !exists("g:zshfe_path") | let g:zshfe_path=expand("~/.vim/plugin/zshfe.zsh") | endif +# zsh file completion caller +# Maintainer: Sergey Matveev +# License: GNU General Public License version 3 of the License or later -function! s:zshfe(query, opencmd) - silent let result = systemlist(g:zshfe_path . " " . a:query) - if len(result) == 0 | return | endif - exec a:opencmd . " " . result[0][:-2] -endfunction +if exists("*zshfe#Do") | finish | endif +if !exists("g:zshfe_path") + g:zshfe_path = expand(":p:h") .. "/zshfe.zsh" +endif -command! -nargs=1 Fe call s:zshfe(, "edit") -command! -nargs=1 Fsp call s:zshfe(, "split") -command! -nargs=1 Fvs call s:zshfe(, "vsplit") +command! -nargs=1 Fe call zshfe#Do(, "edit") +command! -nargs=1 Fsp call zshfe#Do(, "split") +command! -nargs=1 Fvs call zshfe#Do(, "vsplit") nmap e :Fe nmap :Fsp