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=d85d531e07fb230ade35bc5a07d46d6613ee4fee;hpb=e21853080f5005ad6c6b548146d339abd197f28e;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 d85d531..cb05d99 100644 --- a/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim +++ b/vim/.vim/pack/stargrave/start/zshfe/plugin/zshfe.vim @@ -1,21 +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 +# zsh file completion caller +# Maintainer: Sergey Matveev +# License: GNU General Public License version 3 of the License or later + +if exists("*zshfe#Do") | finish | endif if !exists("g:zshfe_path") - let g:zshfe_path=expand(":p:h") . "/zshfe.zsh" + g:zshfe_path = expand(":p:h") .. "/zshfe.zsh" endif -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 - -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