From 7f57a289e84879976dda78c4a8c00146dc41a832 Mon Sep 17 00:00:00 2001 From: Eduardo Cueto-Mendoza Date: Fri, 21 Jul 2023 09:46:34 +0100 Subject: [PATCH] Vim for LaTeX addition --- after/plugin/lsp.lua | 54 +++++++++++++++++++++++++++++++++++++++++++ lua/eddie/options.lua | 25 +++++++++----------- lua/eddie/packer.lua | 3 +++ 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 5da1535..0bb86ac 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -16,7 +16,61 @@ lsp.ensure_installed({ 'zls' }) +--[[ + START LANGUAGE SERVERS CONFIG HERE!!! +]]-- + -- (Optional) Configure lua language server for neovim require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) + +require('lspconfig').texlab.setup({}) + +require('lspconfig').ltex.setup({ + settings = { + ltex = { + language = "en-GB", + }, + }, +}) + +require('lspconfig').pylsp.setup({}) + +--require('lspconfig').gopls.setup({ +-- on_attach = on_attach, +--}) + +require('lspconfig').julials.setup({ + --on_attach = on_attach, + symbol_cache_download = true, + --symbol_server = "https://symbol-server", + on_new_config = function(new_config, _) + local julia = vim.fn.expand("/usr/share/julia/bin/julia") + if require'lspconfig'.util.path.is_file(julia) then + vim.notify("Hello!") + new_config.cmd[1] = julia + end + end +}) + +require('lspconfig').zls.setup({}) + +require('lspconfig').bashls.setup({}) + +-- source: https://rust-analyzer.github.io/manual.html#nvim-lsp +--require('lspconfig').rust_analyzer.setup({ +-- on_attach = on_attach, +-- settings = { +-- ["rust-analyzer"] = { +-- inlayHints = { +-- closingBraceHints = true, -- Whether to show inlay hints after a closing } to indicate what item it belongs to. +-- } +-- } +-- } +--}) + +--[[ + END LANGUAGE SERVERS CONFIG HERE!!! +]]-- + lsp.setup() diff --git a/lua/eddie/options.lua b/lua/eddie/options.lua index 6cffa54..91baf79 100644 --- a/lua/eddie/options.lua +++ b/lua/eddie/options.lua @@ -63,29 +63,26 @@ vim.g.completion_enable_auto_popup = 1 vim.g.loaded_python_provider = 0 vim.g.python3_host_prog = "/usr/local/bin/python" --- PDF Viewer: --- http://manpages.ubuntu.com/manpages/trusty/man5/zathurarc.5.html -vim.g["vimtex_view_method"] = "zathura" -vim.g["vimtex_quickfix_mode"] =0 +-- Vimtex options: +vim.g.vimtex_view_method = "zathura" +vim.g.vimtex_general_viewer = "zathura" +--vim.g.vimtex_quickfix_mode = 0 --- Ignore mappings -vim.g["vimtex_mappings_enabled"] = 1 +---- Ignore mappings +--vim.g["vimtex_mappings_enabled"] = 1 --- Auto Indent -vim.g["vimtex_indent_enabled"] = 1 +---- Auto Indent +--vim.g["vimtex_indent_enabled"] = 1 --- Syntax highlighting -vim.g["vimtex_syntax_enabled"] = 1 +---- Syntax highlighting +vim.g.vimtex_syntax_enabled = 0 -- Error suppression: --- https://github.com/lervag/vimtex/blob/master/doc/vimtex.txt - -vim.g["vimtex_log_ignore"] = ({ +vim.g.vimtex_log_ignore = ({ "Underfull", "Overfull", "specifier changed to", "Token not allowed in a PDF string", }) -vim.g["vimtex_context_pdf_viewer"] = "zathura" diff --git a/lua/eddie/packer.lua b/lua/eddie/packer.lua index b14222e..4b21a31 100644 --- a/lua/eddie/packer.lua +++ b/lua/eddie/packer.lua @@ -58,6 +58,9 @@ return require('packer').startup(function(use) } } + -- Latex on NVIM + use 'lervag/vimtex' + -- :FixWhitespace use "bronson/vim-trailing-whitespace"