codekingpro/portable-devtools
114k
1*ft_hare.txt* Support for the Hare programming language2 3==============================================================================4CONTENTS *hare* *hare.vim*5 61. Introduction |ft-hare-intro|72. Filetype plugin |ft-hare-plugin|83. Haredoc filetype |ft-haredoc-plugin|94. Indentation settings |ft-hare-indent|105. Compiler support |compiler-hare|11 12==============================================================================13INTRODUCTION *ft-hare-intro*14 15This plugin provides syntax highlighting, indentation, and other supporting16functionality for the Hare programming language.17 18 19FILETYPE PLUGIN *ft-hare-plugin*20 21This plugin has a few different variables that can be defined inside your22|vimrc| to adjust its behavior.23 24 *hare-folding*25This plugin supports folding `{ }` blocks. To enable folding, add the26following to a file inside your |after-directory| (e.g.27~/.vim/after/ftplugin/hare.vim): >28 29 setlocal foldmethod=syntax30 31Because syntax-based folding tends to create many small folds, consider32setting a few related options, such as 'foldminlines' or 'foldnestmax'.33 34 *hare-symbol-operators*35Most symbolic operators do not receive any highlighting by default (with the36exception of "?", "!", and "::"). If you prefer highlighting all operators,37you can link them to your preferred highlight group inside your |vimrc|. For38example: >39 40 hi def link hareCast hareSymbolOperator41 hi def link hareSymbolOperator hareOperator42<43 *g:hare_recommended_style*44The following options are set by default, in accordance with Hare's official45style guide: >46 47 setlocal noexpandtab48 setlocal shiftwidth=849 setlocal softtabstop=050 setlocal tabstop=851 setlocal textwidth=8052 53To disable this behavior, add the following to your |vimrc|: >54 55 let g:hare_recommended_style = 056<57 *g:hare_space_error*58By default, trailing whitespace and spaces followed by <Tab> characters are59highlighted as errors. This is automatically disabled while in insert mode.60To turn off this highlighting completely, add the following to your |vimrc|: >61 62 let g:hare_space_error = 063 64 65HAREDOC FILETYPE *ft-haredoc-plugin*66 67This plugin will automatically detect README files inside Hare modules, using68a recursive directory search, and give them the "haredoc" filetype. Because69this is such a common filename, this plugin only searches for Hare source70files within the same directory by default.71 72 *g:filetype_haredoc*73The `g:filetype_haredoc` variable can be used to tweak the depth of this74search, or bypass the detection of Hare documentation files altogether:75 76 Value Effect~77 0 Search disabled78 1 Search current directory only (this is the default)79 2 Search one level of subdirectories80 81The search depth may be any positive integer, but values greater than 2 are82very unlikely to provide any tangible benefit and can impact performance.83 84 85INDENTATION SETTINGS *ft-hare-indent*86 87Unlike other settings, indentation settings may be configured on a per-buffer88basis, overriding any existing global configuration. To do so, simply prefix89the variable with |b:| instead of |g:|.90 91 *g:hare_indent_match_switch* *b:hare_indent_match_switch*92By default, the continuation lines for "match" and "switch" conditions are93only indented one level: >hare94 95 const file = match (os::create(path, 0o644,96 flag::WRONLY | flag::TRUNC)) {97 case let file: io::file =>98 yield file;99 // ...100 101If you prefer indenting them two levels, more closely resembling "if" and102"for" conditions, add the following line to your |vimrc|: >103 104 let g:hare_indent_match_switch = 2105<106 *g:hare_indent_case* *b:hare_indent_case*107By default, the continuation lines for "match" and "switch" cases are indented108two levels, to visually distinguish them from the case body: >hare109 110 case ltok::I8, ltok::I16, ltok::I32,111 ltok::I64, ltok::INT =>112 // ...113 114If you prefer a different level of indentation, you can adjust it using115`g:hare_indent_case`. The possible values are 0, 1, and 2.116 117 118COMPILER SUPPORT *compiler-hare*119 120If a Makefile is detected in the current directory, this plugin will assume121you are using "make" for your build system, and will leave 'makeprg' as-is.122Otherwise, "hare build" will be used.123 124 *g:hare_makeprg_params*125When using "hare build", additional compiler options may be appended to126'makeprg' using `g:hare_makeprg_params`. The default is "-q", to suppress127printing to stdout when building.128 129==============================================================================130 vim:tw=78:ts=8:noet:ft=help:norl:131 