-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jeff Kreeftmeijer <jeffkreeftmeijer@gmail.com>
- Loading branch information
1 parent
1f4236d
commit a817560
Showing
23 changed files
with
477 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
if has_key(g:polyglot_is_disabled, 'gleam') | ||
finish | ||
endif | ||
|
||
" Check we've not run already | ||
if exists('current_compiler') | ||
finish | ||
endif | ||
|
||
let current_compiler = "gleam" | ||
|
||
" Defined CompilerSet command if it doesn't exist. | ||
" Needed for older vim versions. | ||
if exists(":CompilerSet") != 2 | ||
command -nargs=* CompilerSet setlocal <args> | ||
endif | ||
|
||
" Tell vim to run 'gleam' when the user runs :make. So ':make build .' becomes | ||
" 'gleam build .' | ||
CompilerSet makeprg=gleam\ $* | ||
|
||
|
||
" With the compiler set, we set the errorformat which is a set of rules that | ||
" vim uses to parse the output of the current compiler program in order to | ||
" extract file, line, column & error message information so that it can | ||
" populate the quickfix list and the user can jump between the errors. | ||
" | ||
" This errorformat 'parser' will have to change if the output of the compiler | ||
" changes. | ||
" | ||
" Written with the help of: https://flukus.github.io/vim-errorformat-demystified.html | ||
" | ||
CompilerSet errorformat=%Eerror:\ %m " use 'error:' to indicate the start of a new error | ||
CompilerSet errorformat+=%C\ %#┌─%#\ %f:%l:%c\ %#-%# " pull out the file, line & column (matches optional spaces & dashes at the end in case they come back.) | ||
CompilerSet errorformat+=%C " allow empty lines within an error | ||
CompilerSet errorformat+=%C%.%#│%.%# " ignore any line with a vertial formatting pipe in it | ||
CompilerSet errorformat+=%Z%m " assume any other line contributes to the error message | ||
|
||
|
||
" Example error message | ||
" | ||
" error: Unknown variable | ||
" ┌─ /home/michael/root/projects/tutorials/gleam/try/code/src/main.gleam:19:18 | ||
" │ | ||
" 19 │ Ok(tuple(name, spot)) | ||
" │ ^^^^ did you mean `sport`? | ||
" | ||
" The name `spot` is not in scope here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
if has_key(g:polyglot_is_disabled, 'gleam') | ||
finish | ||
endif | ||
|
||
|
||
if exists("b:did_ftplugin") | ||
finish | ||
endif | ||
let b:did_ftplugin = 1 | ||
|
||
compiler gleam | ||
|
||
setlocal commentstring=//%s | ||
setlocal formatoptions-=t formatoptions+=croqnl | ||
|
||
setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:////,:///,:// | ||
|
||
" j was only added in 7.3.541, so stop complaints about its nonexistence | ||
silent! setlocal formatoptions+=j | ||
|
||
" smartindent will be overridden by indentexpr if filetype indent is on, but | ||
" otherwise it's better than nothing. | ||
setlocal smartindent nocindent | ||
|
||
setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab | ||
setlocal textwidth=79 | ||
|
||
setlocal suffixesadd=.gleam | ||
|
||
augroup gleam.vim | ||
autocmd! | ||
augroup END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.