From 0843ae93e1efa37d01af9e8bc1b0ec2bb9bc2322 Mon Sep 17 00:00:00 2001 From: Steve Dunham Date: Tue, 22 Oct 2024 22:09:01 -0700 Subject: [PATCH] preliminary vim support I don't really know vim configuration --- vim/compiler/newt.vim | 4 ++++ vim/ftdetect/newt.vim | 1 + vim/ftplugin/newt.vim | 6 ++++++ vim/indent/newt.vim | 0 vim/syntax/newt.vim | 17 +++++++++++++++++ 5 files changed, 28 insertions(+) create mode 100644 vim/compiler/newt.vim create mode 100644 vim/ftdetect/newt.vim create mode 100644 vim/ftplugin/newt.vim create mode 100644 vim/indent/newt.vim create mode 100644 vim/syntax/newt.vim diff --git a/vim/compiler/newt.vim b/vim/compiler/newt.vim new file mode 100644 index 0000000..2c221ba --- /dev/null +++ b/vim/compiler/newt.vim @@ -0,0 +1,4 @@ +let current_compiler = 'newt' + +" doesn't work +CompilerSet errorformat='ERROR at (%l, %c)' diff --git a/vim/ftdetect/newt.vim b/vim/ftdetect/newt.vim new file mode 100644 index 0000000..ba1acec --- /dev/null +++ b/vim/ftdetect/newt.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.newt set filetype=newt \ No newline at end of file diff --git a/vim/ftplugin/newt.vim b/vim/ftplugin/newt.vim new file mode 100644 index 0000000..80e4e8e --- /dev/null +++ b/vim/ftplugin/newt.vim @@ -0,0 +1,6 @@ +setlocal syntax=newt +setlocal commentstring=--\ %s +setlocal expandtab +setlocal tabstop=2 + +setlocal makeprg=build/exec/newt\ % diff --git a/vim/indent/newt.vim b/vim/indent/newt.vim new file mode 100644 index 0000000..e69de29 diff --git a/vim/syntax/newt.vim b/vim/syntax/newt.vim new file mode 100644 index 0000000..4155633 --- /dev/null +++ b/vim/syntax/newt.vim @@ -0,0 +1,17 @@ +syn keyword newtInfix infix infixl infixr +syn keyword newtKW data where let in case of +syn keyword newtLet let in +syn match newtIdentifier "[a-zA-Z][a-zA-Z]*" contained +syn keyword newtStructure data import module where +syn region newtBlockComment start="/-" end="-/" contained +syn match newtLineComment "--.*$" contains=@Spell + +" no idea why this works for idris but not here +"highlight dev link newtIdentifier Identifier +highlight def link newtInfix PreProc +highlight def link newtBlockComment Comment +highlight def link newtLineComment Comment +highlight def link newtLet Structure +highlight def link newtStructure Structure + +let b:current_syntax = "newt"