From e599a97e453c6272b77c907fa8f7affcf7c18698 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 6 May 2023 18:17:16 +0100 Subject: [PATCH] home: vim: abbreviations: use lua This makes it less repetitive. --- home/vim/plugin/abbreviations.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/home/vim/plugin/abbreviations.vim b/home/vim/plugin/abbreviations.vim index 5d36434..4dd3633 100644 --- a/home/vim/plugin/abbreviations.vim +++ b/home/vim/plugin/abbreviations.vim @@ -1,5 +1,11 @@ -" A few useful sets of abbreviations +lua << EOF +local abbreviations = { + -- A few things that are hard to write in ASCII + ["(R)"] = "©", + ["(TM)"] = "™", +} -" A few things that are hard to write in ASCII -abbreviate (R) © -abbreviate (TM) ™ +for text, result in pairs(abbreviations) do + vim.cmd.abbreviate(text, result) +end +EOF