Dane Sabo 43d6abad48 Split markdown_and_tex into per-language modules; add cadquery autorun
- Split lua/custom/language_specific_commands/markdown_and_tex.lua into
  markdown.lua, tex.lua, and a shared nabla_setup.lua
- Add cadquery.lua: auto-render on save for ~/Documents/cad scripts via
  the project venv, with notifications and a <leader>cr manual trigger
- tex.lua: add \textcolor{blue|red|green}{...} operator + visual maps
  (<leader>t{b,r,g}, <leader>tx to remove); set textwidth=80, spell on
- markdown.lua: spell on, textwidth=60, nabla setup hook
- vimtex: switch to latexmk + lualatex with continuous compile and
  synctex; PDF viewer = skim with sync/activate
- lspconfig: enable julia_ls and texlab; add julialsp + texlab to Mason
  ensure_installed
- chadrc: theme -> ayu_dark
- init.lua: ghcup PATH to macOS location; load cadquery module;
  comment out taskwarrior (replaced by openclaw agent); add updatetime
  and sessionoptions for CursorHold + auto-session
2026-05-20 10:59:08 -04:00

46 lines
1.3 KiB
Lua

-- ~/.config/nvim/lua/custom/language_specific_commands/nabla_setup.lua
local M = {}
-- Setup Nabla for a buffer
function M.setup(bufnr)
-- Skip if already set up
if vim.b[bufnr].nabla_keys then
return
end
-- Buffer-local conceal settings (disabled so you always see raw LaTeX)
vim.opt_local.conceallevel = 0
vim.opt_local.concealcursor = "" -- always reveal when cursor is on line
-- Try to load Nabla
local ok_nabla, nabla = pcall(require, "nabla")
if not ok_nabla then
return
end
local bufopts = { buffer = bufnr, silent = true }
-- Toggle keymap - turns Nabla rendering on/off
vim.keymap.set("n", "<leader>mnt", function()
if vim.b[bufnr].nabla_enabled then
nabla.disable_virt()
vim.b[bufnr].nabla_enabled = false
else
nabla.enable_virt()
vim.b[bufnr].nabla_enabled = true
end
end, vim.tbl_extend("force", bufopts, { desc = "Nabla: toggle math rendering" }))
-- Popup for spot-checking (great for multi-line math)
vim.keymap.set("n", "<leader>mnp", function()
nabla.popup()
end, vim.tbl_extend("force", bufopts, { desc = "Nabla: popup under cursor" }))
-- Don't auto-enable, let user toggle when needed
vim.b[bufnr].nabla_enabled = false
vim.b[bufnr].nabla_keys = true
end
return M