robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
ab20681c52
master
1" Vim autoload file. 2" Language: Hare 3" Maintainer: Amelia Clarke <selene@perilune.dev> 4" Last Updated: 2024-05-10 5" Upstream: https://git.sr.ht/~sircmpwn/hare.vim 6 7" Attempt to find the directory for a given Hare module. 8function hare#FindModule ( str ) 9let path = substitute ( trim ( a: str , ':' , 2 ), '::' , '/' , 'g' ) 10let dir = finddir ( path ) 11while ! empty ( path ) && empty ( dir ) 12let path = substitute ( path , '/\?\h\w*$' , '' , '' ) 13let dir = finddir ( path ) 14endwhile 15return dir 16endfunction 17 18" Return the value of HAREPATH if it exists. Otherwise use a reasonable default. 19function hare#GetPath () 20if empty ( $ HAREPATH ) 21return '/usr/src/hare/stdlib,/usr/src/hare/third-party' 22endif 23return substitute ( $ HAREPATH , ':' , ',' , 'g' ) 24endfunction 25 26" vim: et sts=2 sw=2 ts=8