Amelia Clarke | 35dfe58 | 2024-05-24 08:05:00 +0200 | [diff] [blame] | 1 | *ft_hare.txt* Support for the Hare programming language |
| 2 | |
| 3 | ============================================================================== |
| 4 | CONTENTS *hare* |
| 5 | |
| 6 | 1. Introduction |hare-intro| |
| 7 | 2. Filetype plugin |hare-plugin| |
| 8 | 3. Settings |hare-settings| |
| 9 | |
| 10 | ============================================================================== |
| 11 | INTRODUCTION *hare-intro* |
| 12 | |
| 13 | This plugin provides syntax highlighting, indentation, and other functionality |
| 14 | for the Hare programming language. Support is also provided for README files |
| 15 | inside Hare modules, but this must be enabled by setting |g:filetype_haredoc|. |
| 16 | |
| 17 | ============================================================================== |
| 18 | FILETYPE PLUGIN *hare-plugin* |
| 19 | |
| 20 | This plugin automatically sets the value of 'path' to include the contents of |
| 21 | the HAREPATH environment variable, allowing commands such as |gf| to directly |
| 22 | open standard library or third-party modules. If HAREPATH is not set, it |
| 23 | defaults to the recommended paths for most Unix-like filesystems, namely |
| 24 | /usr/src/hare/stdlib and /usr/src/hare/third-party. |
| 25 | |
| 26 | ============================================================================== |
| 27 | SETTINGS *hare-settings* |
| 28 | |
| 29 | This plugin provides a small number of variables that you can define in your |
| 30 | vimrc to configure its behavior. |
| 31 | |
| 32 | *g:filetype_haredoc* |
| 33 | This plugin is able to automatically detect Hare modules and set the "haredoc" |
| 34 | filetype for any README files. As the recursive directory search used as a |
| 35 | heuristic has a minor performance impact, this feature is disabled by default |
| 36 | and must be specifically opted into: > |
| 37 | let g:filetype_haredoc = 1 |
| 38 | < |
| 39 | See |g:haredoc_search_depth| for ways to tweak the searching behavior. |
| 40 | |
| 41 | *g:hare_recommended_style* |
| 42 | The following options are set by default, in accordance with the official Hare |
| 43 | style guide: > |
| 44 | setlocal noexpandtab |
| 45 | setlocal shiftwidth=0 |
| 46 | setlocal softtabstop=0 |
| 47 | setlocal tabstop=8 |
| 48 | setlocal textwidth=80 |
| 49 | < |
| 50 | To disable this behavior: > |
| 51 | let g:hare_recommended_style = 0 |
| 52 | < |
| 53 | *g:hare_space_error* |
| 54 | By default, trailing whitespace and tabs preceded by space characters are |
| 55 | highlighted as errors. This is automatically turned off when in insert mode. |
| 56 | To disable this highlighting completely: > |
| 57 | let g:hare_space_error = 0 |
| 58 | < |
| 59 | *g:haredoc_search_depth* |
| 60 | By default, when |g:filetype_haredoc| is enabled, only the current directory |
| 61 | and its immediate subdirectories are searched for Hare files. The maximum |
| 62 | search depth may be adjusted with: > |
| 63 | let g:haredoc_search_depth = 2 |
| 64 | < |
| 65 | Value Effect~ |
| 66 | 0 Only search the current directory. |
| 67 | 1 Search the current directory and immediate |
| 68 | subdirectories. |
| 69 | 2 Search the current directory and two levels of |
| 70 | subdirectories. |
| 71 | |
| 72 | The maximum search depth can be set to any integer, but using values higher |
| 73 | than 2 is not recommended, and will likely provide no tangible benefit in most |
| 74 | situations. |
| 75 | |
| 76 | ============================================================================== |
| 77 | vim:tw=78:ts=8:noet:ft=help:norl: |