File: hare.vim

package info (click to toggle)
vim 2%3A9.1.1230-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 88,180 kB
  • sloc: ansic: 416,989; cpp: 6,324; makefile: 4,448; java: 2,226; sh: 1,861; perl: 1,419; python: 960; awk: 730; lisp: 501; cs: 458; objc: 369; xml: 247; sed: 8; csh: 6
file content (26 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
" Vim autoload file.
" Language:     Hare
" Maintainer:   Amelia Clarke <selene@perilune.dev>
" Last Updated: 2024-05-10
" Upstream:     https://git.sr.ht/~sircmpwn/hare.vim

" Attempt to find the directory for a given Hare module.
function hare#FindModule(str)
  let path = substitute(trim(a:str, ':', 2), '::', '/', 'g')
  let dir = finddir(path)
  while !empty(path) && empty(dir)
    let path = substitute(path, '/\?\h\w*$', '', '')
    let dir = finddir(path)
  endwhile
  return dir
endfunction

" Return the value of HAREPATH if it exists. Otherwise use a reasonable default.
function hare#GetPath()
  if empty($HAREPATH)
    return '/usr/src/hare/stdlib,/usr/src/hare/third-party'
  endif
  return substitute($HAREPATH, ':', ',', 'g')
endfunction

" vim: et sts=2 sw=2 ts=8