Compare commits

...

4 Commits

Author SHA1 Message Date
Yannick Reiß 566763638d Remove unused lua snippets and add return statement to doxygen
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s Details
2024-09-15 20:19:50 +02:00
Yannick Reiß 6734c00e68 I don't even know lisp 2024-09-15 19:55:28 +02:00
Yannick Reiß 58a2717f6e Add HTML hello world snippet 2024-09-15 19:45:14 +02:00
Yannick Reiß e15b921187 Remove gitcommit snippets 2024-09-15 19:25:12 +02:00
4 changed files with 36 additions and 82 deletions

View File

@ -1,16 +0,0 @@
global !p
def complete(t, opts):
if t:
opts = [m[len(t):] for m in opts if m.startswith(t)]
if len(opts) == 1:
return opts[0]
return '(' + '|'.join(opts) + ')'
endglobal
snippet !! "Standard message" bA
$1`!p snip.rv=complete(t[1], ["BUG", "INFO", "UPDATE", "FEATURE", "ADD"])`: $2`!p snip.rv=complete(t[2], ["OPEN", "CLOSE", "FIX", "WARNING", "ERROR", "ADD", "REMOVED", "TODO", "NEW"])` `!p
if t[3] == "":
snip.rv = ""
else:
snip.rv = "=>"` $3
endsnippet

View File

@ -1,4 +1,19 @@
snippet << "Tag for html" bA snippet helloworld "A little hello world example." b
<$1>$2</${1/(\w+).*/$1/}>$0 <!DOCTYPE html>
<html>
<head>
<title>Hello world example</title>
</head>
<body>
<h1 align=center>Hello World</h1>
</body>
</html>
endsnippet endsnippet
snippet << "Tag for html" bA
<${1:p}>$2</${1/(\w+).*/$1/}>$0
endsnippet
snippet >> "Line break / closing tag"
</${1:br}>$0
endsnippet

View File

@ -1,3 +0,0 @@
snippet pack "This is the package." bA
(package! $1)$0
endsnippet

View File

@ -1,64 +1,3 @@
snippet fun "New function"
-- @name $1
`!p
param = ""
for i in t[2].split(","):
param += f"-- @param {i.replace(' ', '')}\n"
snip.rv = param
`-- @short ${3:Description}
function ${1:Name} (${2:})
$4
end;
$0
endsnippet
snippet while "while-loop"
while (${1:true})
do
$1
end;
$0
endsnippet
snippet for "for loop"
for ${1:i = 0}, ${2:target}, ${3:1}
do
$4
end;
$0
endsnippet
snippet repeat "repeat until loop"
repeat
$2
until (${1:Condition});
$0
endsnippet
snippet ifthen "normal if clause"
if (${1:Condition})
then
$2
end;
$0
endsnippet
snippet ifelse "if and else clause"
if (${1:Condition})
then
$1
else
$2
end;
$0
endsnippet
snippet "= fun" "Assign a function" rA
= function(${1:Parameter})
$2
end;$0
endsnippet
snippet docstring "Document string" b snippet docstring "Document string" b
-- Filename: `!p snip.rv = fn` -- Filename: `!p snip.rv = fn`
-- Author: ${1:Yannick Reiß} -- Author: ${1:Yannick Reiß}
@ -66,3 +5,22 @@ snippet docstring "Document string" b
-- Description: ${3:Funny lua script} -- Description: ${3:Funny lua script}
$0 $0
endsnippet endsnippet
snippet fun "New function"
-- @name $2
`!p
lines = t[5].split('\n')
for line in lines:
if line.startswith("return"):
snip.rv = f"-- @return {line.replace('return', '').replace(' ', '')}\n"
``!p
param = ""
for i in t[3].split(","):
param += f"-- @param {i.replace(' ', '')}\n"
snip.rv = param
`-- @short ${4:Description}
${1:local }function ${2:Name} (${3:})
$5
end;
$0
endsnippet