#!/usr/bin/za # you'll probably need to do this manually until i have the # patience to write a generic script. feel free to contribute one! zahandler=` " Za shell scripts elseif s:name =~# '^za\>' set ft=za ` if has_start(os(),"freebsd") pathRoot="/usr/local/share/vim" else pathRoot="/usr/share/vim" ei # install for nvim nvim=is_installed("nvim") if nvim println "- Copying za.vim to nvim syntax file path" | ./install_nvim_syntax.sh exit endif # where's old vim at? allPaths=[] vim9=false foreach p in dir(pathRoot) on has_start(p.name,"vim8") do allPaths=append(allPaths,p.name) if has_start(p.name,"vim9") allPaths=append(allPaths,p.name) vim9=true ei ef if allPaths.len>0 println "allpaths: ({allPaths})" vnum=(allPaths -> "#.substr(#.len-2,2)").list_float.max newPath=join([pathRoot,"vim"+vnum],"/") println "working path: [{newPath}]" # check for scripts.vim stanza # vim9: /usr/share/vim/vim9*/autoload/dist/script.vim vfname="scripts.vim" on vim9 do vfname="script.vim" # construct script config file path infilename=join([newPath,vim9?"autoload/dist":"",vfname],"/") infile=infilename.read_file() if line_match(infile,"ft=za") println "stanza found" else println "In '{infilename}' insert this stanza manually:\n{zahandler}\n" ei | sudo cp -f za.vim {newPath}/ftplugin/ | sudo cp -f za.vim {newPath}/syntax/ | sudo chmod 755 {newPath}/{syntax,ftplugin}/za.vim ei