| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | " Vim filetype plugin. | 
					
						
							|  |  |  | " Language:     Hare | 
					
						
							|  |  |  | " Maintainer:   Amelia Clarke <selene@perilune.dev> | 
					
						
							|  |  |  | " Last Updated: 2024-05-10 | 
					
						
							|  |  |  | " Upstream:     https://git.sr.ht/~sircmpwn/hare.vim | 
					
						
							| 
									
										
										
										
											2022-09-27 17:30:34 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | if exists('b:did_ftplugin') | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | let b:did_ftplugin = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Set the default compiler. | 
					
						
							|  |  |  | compiler hare | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | " Formatting settings. | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | setlocal comments=:// | 
					
						
							| 
									
										
										
										
											2022-09-27 17:30:34 +01:00
										 |  |  | setlocal commentstring=//\ %s | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | setlocal formatlistpat=^\ \\?-\  | 
					
						
							|  |  |  | setlocal formatoptions+=croqnlj/ formatoptions-=t | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Search for Hare modules. | 
					
						
							|  |  |  | setlocal include=^\\s*use\\> | 
					
						
							|  |  |  | setlocal includeexpr=hare#FindModule(v:fname) | 
					
						
							|  |  |  | setlocal isfname+=: | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | setlocal suffixesadd=.ha | 
					
						
							| 
									
										
										
										
											2022-09-27 17:30:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | " Add HAREPATH to the default search paths. | 
					
						
							|  |  |  | setlocal path-=/usr/include,, | 
					
						
							|  |  |  | let &l:path .= ',' .. hare#GetPath() .. ',,' | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | let b:undo_ftplugin = 'setl cms< com< flp< fo< inc< inex< isf< pa< sua< mp<' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Follow the Hare style guide by default. | 
					
						
							|  |  |  | if get(g:, 'hare_recommended_style', 1) | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  |   setlocal noexpandtab | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  |   setlocal shiftwidth=0 | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  |   setlocal softtabstop=0 | 
					
						
							|  |  |  |   setlocal tabstop=8 | 
					
						
							|  |  |  |   setlocal textwidth=80 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  |   let b:undo_ftplugin .= ' et< sts< sw< ts< tw<' | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2022-09-27 17:30:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | augroup hare.vim | 
					
						
							|  |  |  |   autocmd! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Highlight whitespace errors by default. | 
					
						
							|  |  |  |   if get(g:, 'hare_space_error', 1) | 
					
						
							|  |  |  |     autocmd InsertEnter * hi link hareSpaceError NONE | 
					
						
							|  |  |  |     autocmd InsertLeave * hi link hareSpaceError Error | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save | 
					
						
							| 
									
										
										
										
											2023-08-29 05:32:27 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 08:05:00 +02:00
										 |  |  | " vim: et sts=2 sw=2 ts=8 |