nix-config/modules/home-manager/coding/neovim/config/after/ftplugin/rst.lua
Oliver Davies 2e6f381772 Add rst keymaps for adding text annotations/notes
Used for adding speaker notes to presentation slides with rst2pdf.
2025-05-09 22:16:31 +01:00

20 lines
630 B
Lua

local opt = vim.opt_local
opt.spell = true
opt.wrap = true
local cmp = require "cmp"
local sources = cmp.get_config().sources
-- TODO: confirm these aren't aleady in the list of sources to avoid duplicate suggestions.
table.insert(sources, { name = "buffer" })
table.insert(sources, { name = "path" })
cmp.setup.buffer { sources = sources }
-- Convert lines into a list.
vim.keymap.set("n", "<leader>l", "vip:norm I* <CR>")
vim.keymap.set("v", "<leader>l", ":norm I* <CR>")
vim.keymap.set("n", "<leader>ta", '_iTextAnnotation "<Esc>A"<Esc>j')
vim.keymap.set("v", "<leader>ta", ':norm ITextAnnotation "<Esc>gv:norm A"<Esc>')