From 2785d9fce966b9bf2a8f5e7a143f365efa6dd693 Mon Sep 17 00:00:00 2001 From: afranco Date: Thu, 20 Oct 2022 21:23:52 +0100 Subject: [PATCH] chore: Added support for lhs compile with vimtex --- .config/nvim/ftplugin/lhaskell.lua | 2 ++ .config/nvim/lua/plugins/lspconfig.lua | 5 +---- .latexmkrc | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .config/nvim/ftplugin/lhaskell.lua create mode 100644 .latexmkrc diff --git a/.config/nvim/ftplugin/lhaskell.lua b/.config/nvim/ftplugin/lhaskell.lua new file mode 100644 index 0000000..671f8d5 --- /dev/null +++ b/.config/nvim/ftplugin/lhaskell.lua @@ -0,0 +1,2 @@ +vim.bo.filetype = "tex" +vim.bo.syntax = "lhaskell" diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 8bd69d4..eb5f613 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -11,9 +11,6 @@ end capabilities = vim.lsp.protocol.make_client_capabilities() -lspconfig.hls.setup{ -on_attach = on_attach, -capabilities = capabilities -} +lspconfig.hls.setup{} lspconfig.rust_analyzer.setup{} diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..9325115 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,14 @@ +# Use subroutine to do preprocessing and running pdflatex +$pdflatex = 'internal mylatex %B %O'; +sub mylatex { + my $base = shift @_; + my $tex = "$base.tex"; + + # Run the preprocessor + system('lhs2TeX', '--poly', '-o', $tex, "$base.lhs") == 0 or return $?; + # Run pdflatex + my $return = system('pdflatex', @_, $tex); + system "echo INPUT $base.lhs >> $aux_dir1$base.fls"; + return $return; +} +