{pkgs, ...}: { imports = [ ./lsp.nix ./plugins.nix ./cmp.nix ]; programs.nixvim = { enable = true; colorschemes.kanagawa.enable = true; clipboard = { providers.wl-copy.enable = true; register = "unnamedplus"; }; extraPackages = with pkgs; [ tectonic texliveMedium zathura ]; opts = { number = true; relativenumber = true; tabstop = 2; shiftwidth = 2; expandtab = false; scrolloff = 5; autoindent = true; smartindent = true; copyindent = true; signcolumn = "yes"; cursorline = true; showmode = false; }; extraConfigLuaPre = '' local has_words_before = function() unpack = unpack or table.unpack local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end ''; files = { "ftplugin/nix.lua" = { options = { expandtab = true; shiftwidth = 2; tabstop = 2; }; }; "ftplugin/markdown.lua" = { options = { spell = true; }; }; "ftplugin/tex.lua" = { options = { spell = true; }; keymaps = [ { action = "TexlabBuild"; key = ""; } ]; }; }; keymaps = [ { action = "nohl"; key = ""; mode = ["n"]; options = { desc = "Remove search highlighting"; silent = true; }; } { action = "function() require(\"luasnip\").expand() end"; key = ""; mode = ["i"]; lua = true; options = { desc = "Luasnip expand"; silent = true; }; } { action = "function() require(\"luasnip\").jump(1) end"; key = ""; mode = ["i" "s"]; lua = true; options = { desc = "Luasnip jump to next"; silent = true; }; } { action = "function() require(\"luasnip\").jump(-1) end"; key = ""; mode = ["i" "s"]; lua = true; options = { desc = "Luasnip jump to previous"; silent = true; }; } { action = '' function() if require("luasnip").choice_active() then require("luasnip").change_choice(1) end end ''; key = ""; mode = ["i" "s"]; lua = true; options = { desc = "Luasnip change choice"; silent = true; }; } ]; }; }