From 4a6654296b945e082d25e403e4886e30605ba9a7 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Wed, 28 Jun 2023 07:22:51 +0200 Subject: [PATCH] completion: set buffer completion to 4 chars - Set the keyword_length to 4 in order to lighten the buffer completion. - Add a markdown snippet to add a tags line in my incremental notes. Co-Authored-by: iGor milhit --- init.lua | 7 ++++++- my_snippets/markdown.lua | 29 +++++++++++++++++++++++------ spell/en.utf-8.add | 2 ++ spell/en.utf-8.add.spl | Bin 184 -> 254 bytes 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 5fa5097..b8df2cb 100644 --- a/init.lua +++ b/init.lua @@ -588,7 +588,12 @@ cmp.setup { }, sources = { { name = 'nvim_lsp' }, - { name = 'buffer' }, + { + name = 'buffer', + option = { + keyword_length = 4, + }, + }, { name = 'luasnip' }, { name = 'path' }, }, diff --git a/my_snippets/markdown.lua b/my_snippets/markdown.lua index 75bfa6c..21c92c4 100644 --- a/my_snippets/markdown.lua +++ b/my_snippets/markdown.lua @@ -86,12 +86,12 @@ return { }, fmt( [[ - --- - title: {1} - date: {3} - id: {4} - tags: [{2}] - --- + --- + title: {1} + date: {3} + id: {4} + tags: [{2}] + --- ]], { @@ -147,5 +147,22 @@ return { }, { repeat_duplicates = true } ) + ), + s( + { + trig = "tags", + name = "YAML tags", + dscr = "Insert a one-line tags array." + }, + fmt( + [[ + --- + tags: [{}] + --- + ]], + { + i(1, "tags") + } + ) ) } diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index ab67d2a..b1182d4 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -6,3 +6,5 @@ neovim lua InfoBiblio Réaménagement +biodiversité +hyperindustrialisés diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 9c741af2cf29dc84aa3dfb1dd8f5ebd61bb1b1b7..4add06e8a1d111fc8e6128e9988da4b8b25ed181 100644 GIT binary patch literal 254 zcmYjMI}QRN6nsNWjExuY0$UpkTkW>kQhUgLBw=9#YGUVgEIfq=(^+UNfcIwR%{zJD{cCVbv`Bp+@PMYELz@obcjf-uK3^ufg=;yYj|=>sqTRRYJn+BE#a0P zi33IEC{B48B2^;a)4~unG_xSOo>OO5(<3l6qt%$FG|KB4IglTD{H)%WmCB0jcb0$I Ts6$PQ6E`hE$N!*ZphV;cnk_R~ literal 184 zcmYjLyAHxI4D?x*VBrH0>QAsT!PbG1?y1z4NNIx7(wX1kJNjYt(ku*qobS$dUERl5 z>)iP#B4Ka3r*%G#2zWz3aBLzh3_Mz>GWF1cs3X&mX{fP)$RSw_gpzO!#Q|#YwLfS3I~XpSk^?*#$~OR-GCny8r+H