dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 573af685c653713ed601da631470da039284c536
parent 655c230b2303a2299bffd24d5346ab791f289f68
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 17 Jul 2019 09:42:40 +0200

Improve snippets plugin

Diffstat:
M.config/vis/plugins/snippets.lua | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/.config/vis/plugins/snippets.lua b/.config/vis/plugins/snippets.lua @@ -1,21 +1,21 @@ -- vis-snippets: Insert predefined text snippets from INSERT mode -- -- Usage: --- Press the snipleader (default @@) and a key specified in the --- insert_snippets table. This will insert the corresponding value from --- insert_snippets. Optionally, a cursor position can be specified with the --- string '<0>'. +-- Press the snipleader (default @@) and a key specified in the snippets +-- table. This will insert the corresponding value from snippets. Optionally, +-- a cursor position can be specified with the string '<1>'. -- -- Author: Anders Damsgaard <anders@adamsgaard.dk>, adc on #vis-editor -insert_snippets = { ae = 'æ', +local snippets = { + ae = 'æ', AE = 'Æ', oe = 'ø', OE = 'Ø', aa = 'å', AA = 'Å', - q = "\\emph{``<0>''}", - sig = '-- \n' .. + q = "\\emph{``<1>''}", + sig = '<1>\n\n-- \n' .. 'Anders Damsgaard\n' .. '--\n' .. 'Academia: https://adamsgaard.dk\n' .. @@ -25,9 +25,9 @@ insert_snippets = { ae = 'æ', } snippets_leader = '@@' -snippets_cursor = '<0>' +snippets_cursor = '<1>' -for k, v in pairs(insert_snippets) do +for k, v in pairs(snippets) do if string.find(v, snippets_cursor) then vis:map(vis.modes.INSERT, snippets_leader..k, function()