From ead1e9baa8c077f730eabc9d0dfd14c37ef5c7c5 Mon Sep 17 00:00:00 2001 From: nichkara Date: Sun, 12 Oct 2025 10:06:50 +0200 Subject: [PATCH] Makefile snippet for gccvarset to create clangd project file --- UltiSnips/brainfuck.snippets | 7 +++++++ UltiSnips/make.snippets | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 UltiSnips/brainfuck.snippets diff --git a/UltiSnips/brainfuck.snippets b/UltiSnips/brainfuck.snippets new file mode 100644 index 0000000..a8cd257 --- /dev/null +++ b/UltiSnips/brainfuck.snippets @@ -0,0 +1,7 @@ +snippet copy_1_2_w3 "Copy current cell modifying cells +1,+2" +Copy (from) (to) (with): >[-]>[-]<<[->+>+<<]>>[-<<+>>]<< +endsnippet + +snippet add_1_2 "Add from 1 to 2" +Add (from) (to): [->+<]> +endsnippet diff --git a/UltiSnips/make.snippets b/UltiSnips/make.snippets index 332e438..b7586b9 100644 --- a/UltiSnips/make.snippets +++ b/UltiSnips/make.snippets @@ -75,7 +75,18 @@ if t[19] == "y": t[19] = "Created!" if t[20] == "y": system(f"git init > /dev/null") - t[20] = "Initialized repository!"` + t[20] = "Initialized repository!"``!p +from os import system + +if "cl" in t[2].split(' ') and t[19] == "y": + with open(".clangd", "w") as w: + config = f""" +CompileFlags: + Add: [{t[8].split(' ').join(', ')}] + Remove: [] + Compiler: {t[3]} +""" w.write(config) +` $0 endsnippet