This commit is contained in:
grimhilt
2025-04-20 14:07:40 +02:00
parent 41130c69bc
commit 88bd1246e3
4 changed files with 82 additions and 13 deletions

View File

@@ -64,9 +64,10 @@ u.nmap("<C-u>", "<C-u>zz")
u.nmap("<leader>ri", ":lua vim.lsp.inlay_hint(0)<CR>")
u.nmap("<leader>rl", ":RustFmt<CR>")
-- vim.keymap.set("n", "<leader>ri", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end)
vim.keymap.set("n", "<leader>ri", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end)
u.nmap("<leader>d", ":lua vim.lsp.buf.hover()<CR>")
require("telescope-config")
require("minifiles-config")
require("vimtex-config")

View File

@@ -20,6 +20,25 @@ return {
-- Git
"tpope/vim-fugitive",
"tpope/vim-rhubarb",
"linrongbin16/gitlinker.nvim",
cmd = "GitLink",
opts = {},
keys = {
{ "<leader>gy", "<cmd>GitLink<cr>", mode = { "n", "v" }, desc = "Yank git link" },
{ "<leader>gY", "<cmd>GitLink!<cr>", mode = { "n", "v" }, desc = "Open git link" },
},
-- Vim
{
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
init = function()
-- VimTeX configuration goes here, e.g.
vim.g.vimtex_view_method = "zathura"
end
},
"tpope/vim-commentary",
"tpope/vim-surround",

47
lua/vimtex-config.lua Normal file
View File

@@ -0,0 +1,47 @@
-- " This is necessary for VimTeX to load properly. The "indent" is optional.
-- " Note: Most plugin managers will do this automatically!
-- filetype plugin indent on
-- " This enables Vim's and neovim's syntax-related features. Without this, some
-- " VimTeX features will not work (see ":help vimtex-requirements" for more
-- " info).
-- " Note: Most plugin managers will do this automatically!
-- syntax enable
-- " Viewer options: One may configure the viewer either by specifying a built-in
-- " viewer method:
-- let g:vimtex_view_method = 'zathura'
-- " Or with a generic interface:
-- let g:vimtex_view_general_viewer = 'okular'
-- let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
-- " VimTeX uses latexmk as the default compiler backend. If you use it, which is
-- " strongly recommended, you probably don't need to configure anything. If you
-- " want another compiler backend, you can change it as follows. The list of
-- " supported backends and further explanation is provided in the documentation,
-- " see ":help vimtex-compiler".
-- let g:vimtex_compiler_method = 'latexrun'
-- " Most VimTeX mappings rely on localleader and this can be changed with the
-- " following line. The default is usually fine and is the symbol "\".
vim.cmd("filetype plugin indent on")
vim.cmd("syntax enable")
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_compiler_method = 'latexrun'
vim.g.mapleader = " "
vim.g.vimtex_toc_config = {
name = 'TOC',
layers = { 'content', 'todo', 'include' },
resize = 1,
split_width = 50,
todo_sorted = 0,
show_help = 1,
show_numbers = 1,
mode = 2,
}
-- Key mappings
vim.api.nvim_set_keymap('n', '<leader>m', ':VimtexTocOpen<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>v', ':VimtexView<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>c', ':VimtexCompile<CR>', { noremap = true, silent = true })