feat: add vimtex

This commit is contained in:
Moritz Böhme 2024-06-27 10:12:38 +02:00
parent 1a2369c8db
commit b03934b4a3
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
6 changed files with 52 additions and 8 deletions

View file

@ -72,6 +72,22 @@
"type": "github" "type": "github"
} }
}, },
"cmp-vimtex": {
"flake": false,
"locked": {
"lastModified": 1716040164,
"narHash": "sha256-CO70M+l/9c4vqNm0XloOTzGQTmogHbSwvUFKQxYGsuw=",
"owner": "micangl",
"repo": "cmp-vimtex",
"rev": "a64b1b5eec0460144c91c4f20a45c74b8ded48ae",
"type": "github"
},
"original": {
"owner": "micangl",
"repo": "cmp-vimtex",
"type": "github"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -1164,6 +1180,7 @@
"agenix": "agenix", "agenix": "agenix",
"arkenfox-userjs": "arkenfox-userjs", "arkenfox-userjs": "arkenfox-userjs",
"asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver",
"cmp-vimtex": "cmp-vimtex",
"devshell": "devshell", "devshell": "devshell",
"disko": "disko", "disko": "disko",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",

View file

@ -45,6 +45,8 @@
hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim"; hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim";
none-ls-shellcheck-nvim.flake = false; none-ls-shellcheck-nvim.flake = false;
none-ls-shellcheck-nvim.url = "github:gbprod/none-ls-shellcheck.nvim"; none-ls-shellcheck-nvim.url = "github:gbprod/none-ls-shellcheck.nvim";
cmp-vimtex.flake = false;
cmp-vimtex.url = "github:micangl/cmp-vimtex";
# river # river
river.url = "git+https://github.com/riverwm/river?submodules=1"; river.url = "git+https://github.com/riverwm/river?submodules=1";

View file

@ -16,6 +16,11 @@ in
source = ./plugins/snippets; source = ./plugins/snippets;
}; };
home.packages = with pkgs; [
xdotool
];
programs.neovim = { programs.neovim = {
enable = true; enable = true;
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;

View file

@ -36,10 +36,17 @@ in
{ plugin = pkgs.vimPlugins.cmp-async-path; } { plugin = pkgs.vimPlugins.cmp-async-path; }
{ plugin = pkgs.vimPlugins.cmp-buffer; } { plugin = pkgs.vimPlugins.cmp-buffer; }
{ plugin = pkgs.vimPlugins.cmp-cmdline; } { plugin = pkgs.vimPlugins.cmp-cmdline; }
{ plugin = pkgs.vimPlugins.cmp-nvim-lsp; }
{ plugin = pkgs.vimPlugins.cmp_luasnip; }
{ plugin = pkgs.vimPlugins.cmp-spell; }
{ plugin = pkgs.vimPlugins.cmp-nvim-lsp-signature-help; } { plugin = pkgs.vimPlugins.cmp-nvim-lsp-signature-help; }
{ plugin = pkgs.vimPlugins.cmp-nvim-lsp; }
{ plugin = pkgs.vimPlugins.cmp-spell; }
{
plugin = pkgs.vimUtils.buildVimPlugin {
pname = "cmp-vimtex";
version = lib.my.mkVersionInput inputs.cmp-vimtex;
src = inputs.cmp-vimtex;
};
}
{ plugin = pkgs.vimPlugins.cmp_luasnip; }
{ {
plugin = pkgs.vimPlugins.copilot-cmp; plugin = pkgs.vimPlugins.copilot-cmp;
opts = { }; opts = { };
@ -211,5 +218,17 @@ in
conf = readFile ./lua/conform.lua; conf = readFile ./lua/conform.lua;
} }
{ plugin = pkgs.vimPlugins.plantuml-syntax; } { plugin = pkgs.vimPlugins.plantuml-syntax; }
{
plugin = pkgs.vimPlugins.vimtex;
lazy = false;
conf = /* lua */ ''
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_mappings_disable = vim.fn.executable("texlab") == 1 and { ["n"] = { "K" } } or {} -- disable `K` as it conflicts with LSP hover
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
'';
keys = [
{ key = "<localleader>l"; cmd = ""; desc = "+vimtex"; }
];
}
]; ];
} }

View file

@ -69,6 +69,7 @@ cmp.setup({
{ priority = 3, name = "copilot" }, { priority = 3, name = "copilot" },
{ priority = 3, name = "nvim_lsp_signature_help" }, { priority = 3, name = "nvim_lsp_signature_help" },
{ priority = 4, name = "luasnip" }, { priority = 4, name = "luasnip" },
{ priority = 4, name = "vimtex" },
}), }),
}) })

View file

@ -1,8 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
with builtins;
{ {
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [ config.home-manager.users.moritz.programs.neovim.lazy.plugins = [
( (
let let
parserDir = pkgs.symlinkJoin { parserDir = pkgs.symlinkJoin {
@ -11,13 +10,14 @@ with builtins;
}; };
in in
{ {
plugin = nvim-treesitter; plugin = pkgs.vimPlugins.nvim-treesitter;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
opts = { opts = {
sync_install = false; sync_install = false;
auto_install = false; auto_install = false;
highlight = { highlight = {
enable = true; enable = true;
disable = [ "latex" ];
}; };
textobjects = textobjects =
{ {
@ -60,8 +60,8 @@ with builtins;
''; '';
priority = 100; priority = 100;
dependencies = [ dependencies = [
{ plugin = nvim-treesitter-textobjects; } { plugin = pkgs.vimPlugins.nvim-treesitter-textobjects; }
{ plugin = nvim-ts-context-commentstring; opts = { }; } { plugin = pkgs.vimPlugins.nvim-ts-context-commentstring; opts = { }; }
]; ];
} }
) )