Adding vimtex support

This commit is contained in:
Eduardo Cueto-Mendoza 2024-05-02 09:48:40 +01:00
parent 3ff42bdcc1
commit 5945db5567
6 changed files with 107 additions and 5 deletions

View File

@ -0,0 +1,17 @@
CIFAR
MNIST
LeNet
MUL
BCNN
Grangegorman
Cueto
Mendoza
Maynooth
Frobenius
Neuromorphic
neuromorphic
NN
pytorch
Pytorch
SOTA

View File

@ -1,12 +1,13 @@
local lsp = require('lsp-zero') local lsp = require('lsp-zero')
--[[
local f = io.popen("uname -s") local f = io.popen("uname -s")
if (f ~= nil) then if (f ~= nil) then
MY_OS = f:read("*a") MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "") MY_OS = string.gsub(MY_OS, "%s+", "")
f:close() f:close()
end end
]]--
lsp.preset("recommended") lsp.preset("recommended")
@ -18,6 +19,7 @@ then
'clangd', 'clangd',
'julials', 'julials',
'lua_ls', 'lua_ls',
'ltex',
'ocamllsp', 'ocamllsp',
'pylsp', 'pylsp',
'rust_analyzer', 'rust_analyzer',
@ -38,6 +40,7 @@ then
'clangd', 'clangd',
'julials', 'julials',
'lua_ls', 'lua_ls',
'ltex',
'ocamllsp', 'ocamllsp',
'pylsp', 'pylsp',
'rust_analyzer', 'rust_analyzer',
@ -126,6 +129,24 @@ then
}, },
}) })
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {}
for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
require('lspconfig').ltex.setup({
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
},
},
})
require('lspconfig').ocamllsp.setup({}) require('lspconfig').ocamllsp.setup({})
require('lspconfig').pylsp.setup({}) require('lspconfig').pylsp.setup({})
@ -210,6 +231,24 @@ then
}, },
}) })
local path = vim.fn.stdpath("config") .. "/after/plugin/dictionary-gb.txt"
local words = {}
for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
require('lspconfig').ltex.setup({
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = words,
},
},
},
})
require('lspconfig').ocamllsp.setup({}) require('lspconfig').ocamllsp.setup({})
require('lspconfig').pylsp.setup({}) require('lspconfig').pylsp.setup({})

View File

@ -26,7 +26,7 @@ then
}) })
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD') elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then then
print('Should be here if on BSD') --print('Should be here if on BSD')
configs.setup({ configs.setup({
ensure_installed = { ensure_installed = {
"bash", "bash",
@ -42,7 +42,23 @@ then
}) })
elseif (MY_OS == 'Darwin') elseif (MY_OS == 'Darwin')
then then
print('Should be here if on MacOS') --print('Should be here if on MacOS')
configs.setup({
ensure_installed = {
"bash",
"c",
"julia",
"json",
"lua",
"ocaml",
"vim",
"vimdoc",
"zig",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
else else
print('Should never be here') print('Should never be here')
end end

View File

@ -2,7 +2,6 @@ require('eddie.lazy')
require('eddie.remaps') require('eddie.remaps')
require('eddie.options') require('eddie.options')
--[[
local f = io.popen("uname -s") local f = io.popen("uname -s")
if (f ~= nil) then if (f ~= nil) then
@ -11,6 +10,7 @@ if (f ~= nil) then
f:close() f:close()
end end
--[[
if (MY_OS == 'Linux') if (MY_OS == 'Linux')
then then
print('Should be here if on Linux') print('Should be here if on Linux')

View File

@ -53,6 +53,11 @@ local plugins = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
}, },
{
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
},
-- Minimal -- Minimal
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',

View File

@ -41,8 +41,33 @@ vim.diagnostic.config({
virtual_text = false virtual_text = false
}) })
-- Show line diagnostics automatically in hover window -- Show line diagnostics automatically in hover window
vim.o.updatetime = 250 vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
--vim.g.vimtex_view_method = "zathura"
--vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_view_method = "skim"
vim.g.vimtex_general_viewer = "skim"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
--vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})