diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..793cc6c --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,54 @@ +{ + "LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "a025c78b147affef1aabb8aa360c92be2e0377a0" }, + "blink-copilot": { "branch": "main", "commit": "7ad8209b2f880a2840c94cdcd80ab4dc511d4f39" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "catppuccin": { "branch": "main", "commit": "193e123cdbc4dd3e86db883d55349e9587f0ded6" }, + "conform.nvim": { "branch": "master", "commit": "ffe26e8df8115c9665d24231f8a49fadb2d611ce" }, + "copilot.lua": { "branch": "master", "commit": "a064570939f23ef155698654c98c81e0fc2dc54a" }, + "crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, + "grug-far.nvim": { "branch": "main", "commit": "b58b2d65863f4ebad88b10a1ddd519e5380466e0" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c55bd8a8fb191e24176c206a7af1dd51ce7276a5" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" }, + "mini.hipatterns": { "branch": "main", "commit": "add8d8abad602787377ec5d81f6b248605828e0f" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.pairs": { "branch": "main", "commit": "472ec50092a3314ec285d2db2baa48602d71fe93" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, + "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, + "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-jdtls": { "branch": "master", "commit": "f73731b543f5971e0da9665eb1d7ceffe1fde71f" }, + "nvim-lint": { "branch": "master", "commit": "897f7771c1ca4b11659dfe372d9376acd9fe3097" }, + "nvim-lspconfig": { "branch": "master", "commit": "7af6f57d517d8cc68f249e0d27364c188a097812" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, + "nvim-treesitter": { "branch": "main", "commit": "2979e048b356cfd32dc419d5803dc356b9832adf" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "76deedf0f1cec4496ef8d49b6d1f020f6d0c6ec9" }, + "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, + "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "rustaceanvim": { "branch": "master", "commit": "0e8f01d55888f499a48af0752dae7de92ef12269" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "typst-preview.nvim": { "branch": "master", "commit": "e123a7ab64e52d836e00dea9251e85b201f38966" }, + "venv-selector.nvim": { "branch": "main", "commit": "58bae72c84b9f7f864c879ec1896e384296f9ffb" }, + "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, + "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, + "vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" }, + "vimtex": { "branch": "master", "commit": "6e1229e23c3bbe93487ef62458b1241a2d8ff6af" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "yanky.nvim": { "branch": "main", "commit": "04fc42b94305d94948c9c197f679336668af3292" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..fc8b45d --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,25 @@ +{ + "extras": [ + "lazyvim.plugins.extras.ai.copilot", + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.lang.docker", + "lazyvim.plugins.extras.lang.go", + "lazyvim.plugins.extras.lang.java", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.python", + "lazyvim.plugins.extras.lang.rust", + "lazyvim.plugins.extras.lang.sql", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.tex", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.typst", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.util.dot", + "lazyvim.plugins.extras.util.mini-hipatterns" + ], + "install_version": 8, + "news": { + "NEWS.md": "11866" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 4221e75..8c0c339 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -6,3 +6,21 @@ -- -- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) -- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") +vim.api.nvim_create_autocmd("TermOpen", { + group = vim.api.nvim_create_augroup("term_settings", { clear = true }), + callback = function() + vim.opt_local.wrap = true + -- vim.opt_local.spell = false -- Optional: disable spellcheck in terminal + end, +}) + +-- Prose/LaTeX settings: spell-checking + visual word-wrap +vim.api.nvim_create_autocmd("FileType", { + group = vim.api.nvim_create_augroup("prose_settings", { clear = true }), + pattern = { "tex", "plaintex", "markdown", "text" }, + callback = function() + vim.opt_local.spell = true + vim.opt_local.wrap = true + vim.opt_local.linebreak = true + end, +}) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7..ec5aaab 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,3 +1,45 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here + +-- This file is automatically loaded by lazyvim.config.init +local map = vim.keymap.set + +-- DAP (Debug Adapter Protocol) +-- Note: LazyVim uses d for Debugging by default, +-- but these will override/augment the defaults. +map("n", "dl", function() + require("dap").step_into() +end, { desc = "Debugger step into" }) +map("n", "dj", function() + require("dap").step_over() +end, { desc = "Debugger step over" }) +map("n", "dk", function() + require("dap").step_out() +end, { desc = "Debugger step out" }) +map("n", "dc", function() + require("dap").continue() +end, { desc = "Debugger continue" }) +map("n", "db", function() + require("dap").toggle_breakpoint() +end, { desc = "Debugger toggle breakpoint" }) +map("n", "dd", function() + require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) +end, { desc = "Debugger set conditional breakpoint" }) +map("n", "de", function() + require("dap").terminate() +end, { desc = "Debugger reset" }) +map("n", "dr", function() + require("dap").run_last() +end, { desc = "Debugger run last" }) + +-- Rustaceanvim +map("n", "dt", "RustLsp testables", { desc = "Debugger testables" }) + +-- Copilot toggle (inline suggestions + blink/cmp source) +map("n", "ua", function() + vim.g.copilot_enabled = not vim.g.copilot_enabled + require("copilot.suggestion").toggle_auto_trigger() + local state = vim.g.copilot_enabled and "enabled" or "disabled" + vim.notify("Copilot " .. state, vim.log.levels.INFO) +end, { desc = "Toggle Copilot" }) diff --git a/lua/config/options.lua b/lua/config/options.lua index 3ea1454..29ca5c3 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -1,3 +1,15 @@ -- Options are automatically loaded before lazy.nvim startup -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Add any additional options here + +-- VimTeX local leader (must be set before plugins load) +vim.g.maplocalleader = "," + +vim.diagnostic.config({ + virtual_text = false, + virtual_lines = true, +}) + +-- Spell-checking files (spell itself is enabled per filetype in autocmds.lua) +vim.opt.spelllang = { "en_us" } +vim.opt.spellfile = vim.fn.expand("~/.config/nvim/spell/en.utf-8.add") diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..5a91f38 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,39 @@ +-- Copilot is installed via the LazyVim extra, but disabled by default. +-- Use ua to toggle Copilot inline suggestions and blink/cmp source. + +vim.g.copilot_enabled = false + +return { + -- Inline suggestions are set up but not auto-triggered by default + { + "zbirenbaum/copilot.lua", + opts = { + suggestion = { + enabled = true, + auto_trigger = false, + }, + panel = { + enabled = false, + }, + }, + }, + + -- Disable copilot as a blink completion source by default + { + "saghen/blink.cmp", + optional = true, + opts = function(_, opts) + opts.sources = opts.sources or {} + opts.sources.providers = opts.sources.providers or {} + opts.sources.providers.copilot = opts.sources.providers.copilot or { + name = "copilot", + module = "blink-copilot", + score_offset = 100, + async = true, + } + opts.sources.providers.copilot.enabled = function() + return vim.g.copilot_enabled == true + end + end, + }, +} diff --git a/lua/plugins/diagnostics.lua b/lua/plugins/diagnostics.lua new file mode 100644 index 0000000..0860fad --- /dev/null +++ b/lua/plugins/diagnostics.lua @@ -0,0 +1,10 @@ +return { + { + "LazyVim/LazyVim", + opts = function(_, opts) + opts.diagnostics = opts.diagnostics or {} + opts.diagnostics.virtual_text = false + opts.diagnostics.virtual_lines = true + end, + }, +} diff --git a/lua/plugins/ltex.lua b/lua/plugins/ltex.lua new file mode 100644 index 0000000..113facd --- /dev/null +++ b/lua/plugins/ltex.lua @@ -0,0 +1,50 @@ +return { + -- Ensure ltex-ls is installed via Mason + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "ltex-ls" }) + end, + }, + + -- Configure LTeX for grammar/style/spelling in LaTeX/Markdown + { + "neovim/nvim-lspconfig", + opts = { + servers = { + ltex = { + settings = { + ltex = { + -- Change to "en-GB", "de-DE", etc. if needed + language = "en-US", + -- More thorough checks (slower but better for final drafts) + additionalRules = { + enablePickyRules = true, + }, + -- Load a shared dictionary of domain/academic words + dictionary = { + ["en-US"] = (function() + local words = {} + local dict_file = vim.fn.expand("~/.config/nvim/spell/ltex.dictionary.en-US.txt") + local ok, lines = pcall(vim.fn.readfile, dict_file) + if ok and lines then + for _, word in ipairs(lines) do + word = word:gsub("^%s+", ""):gsub("%s+$", "") + if word ~= "" and not word:match("^#") then + table.insert(words, word) + end + end + end + return words + end)(), + }, + -- Check as you type; switch to "save" if it feels too slow + checkFrequency = "edit", + }, + }, + }, + }, + }, + }, +} diff --git a/lua/plugins/rust.lua b/lua/plugins/rust.lua new file mode 100644 index 0000000..3c66f56 --- /dev/null +++ b/lua/plugins/rust.lua @@ -0,0 +1,34 @@ +return { + { + "mrcjkb/rustaceanvim", + version = "^6", -- Recommended + lazy = false, -- This plugin is already lazy + }, + + { + "mfussenegger/nvim-dap", + config = function() + local dap, dapui = require("dap"), require("dapui") + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + end, + }, + + { + "rcarriga/nvim-dap-ui", + dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, + config = function() + require("dapui").setup() + end, + }, +} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua new file mode 100644 index 0000000..f099092 --- /dev/null +++ b/lua/plugins/surround.lua @@ -0,0 +1,12 @@ +return { + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use main branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty for defaults + }) + end, + }, +} diff --git a/lua/plugins/vale.lua b/lua/plugins/vale.lua new file mode 100644 index 0000000..da2167f --- /dev/null +++ b/lua/plugins/vale.lua @@ -0,0 +1,19 @@ +return { + -- Vale is a prose linter / style checker. + -- Make sure the `vale` binary is on your $PATH (e.g. in ~/.local/bin). + { + "mfussenegger/nvim-lint", + optional = true, + opts = function(_, opts) + opts.linters_by_ft = opts.linters_by_ft or {} + + -- Run Vale on LaTeX, Markdown, and plain text files. + for _, ft in ipairs({ "tex", "plaintex", "markdown", "text" }) do + opts.linters_by_ft[ft] = opts.linters_by_ft[ft] or {} + if not vim.tbl_contains(opts.linters_by_ft[ft], "vale") then + table.insert(opts.linters_by_ft[ft], "vale") + end + end + end, + }, +} diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua new file mode 100644 index 0000000..f4a5177 --- /dev/null +++ b/lua/plugins/vimtex.lua @@ -0,0 +1,7 @@ +return { + "lervag/vimtex", + init = function() + vim.g.vimtex_view_method = "zathura" + vim.g.vimtex_compiler_method = "latexmk" + end, +} diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add new file mode 100644 index 0000000..9729890 --- /dev/null +++ b/spell/en.utf-8.add @@ -0,0 +1 @@ +Ahlgrim diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl new file mode 100644 index 0000000..0a98876 Binary files /dev/null and b/spell/en.utf-8.add.spl differ diff --git a/spell/ltex.dictionary.en-US.txt b/spell/ltex.dictionary.en-US.txt new file mode 100644 index 0000000..cc1c4d5 --- /dev/null +++ b/spell/ltex.dictionary.en-US.txt @@ -0,0 +1,184 @@ +# LTeX shared dictionary for academic/technical writing +# Add one word per line. Lines starting with # are ignored. + +# Common academic terms +algorithmic +analyte +analytes +autocorrelation +backpropagation +bandwidth +benchmarking +biclustering +biomarker +biomarkers +bioinformatics +bipartite +calibration +calibrations +classifier +classifiers +clustering +coefficient +coefficients +cofactor +cofactors +covariance +covariate +covariates +crossvalidation +dataset +datasets +decoder +decoders +deduplication +dependency +differentiable +dimensionality +eigenvalue +eigenvalues +eigenvector +eigenvectors +embeddings +encoder +encoders +endogenous +exogenous +explainability +explainable +extractor +extractors +functionalities +generalizability +generalizable +heterogeneity +heterogeneous +homoscedasticity +hyperparameter +hyperparameters +identifiability +identifiable +illposed +imputability +imputable +imputation +imputations +impute +imputed +indistinguishability +interpretability +interpretable +isomorphism +isotropic +kernel +kernels +latent +learnable +likelihood +logit +logits +manifold +manifolds +matrix +matrices +minibatch +minibatches +misspecification +misspecified +multicollinearity +multimodal +multivariate +nonconvex +nondeterministic +nonlinear +nonlinearity +nonparametric +normality +observability +observable +overfitting +overparameterization +overparameterized +parameterization +parameterize +parameterized +perceptron +perceptrons +posterior +posteriors +preprocessing +pretrained +probabilistic +quantile +quantiles +regularization +regularize +regularized +regularizer +regularizers +reproducibility +scalable +semisupervised +sparse +sparsity +stationarity +stationary +subclass +subclasses +subgradient +subgradients +submatrix +subnetwork +subnetworks +subsample +subsampled +subsampling +supervised +symmetric +symmetry +thresholding +timepoint +timepoints +timeseries +transcriptomics +transductive +transformers +univariate +unsupervised +variational +vector +vectors +wavelet +wavelets + +# Method/model names (add your own) +AdamW +Bayesian +Bert +BERT +Dropout +GPUs +ImageNet +Kubernetes +LaTeX +LanguageTool +LazyVim +LTeX +Markov +Neovim +ReLU +ResNet +RNN +Softmax +SVM +Transformer +VimTeX +Vale +XGBoost + +# Common abbreviations +w.r.t +i.e +e.g +et al +cf.