Compare commits

..

3 Commits

Author SHA1 Message Date
Yannick Reiß 06cbad6b53 Something something LaTeX snippet something
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 34s Details
2024-09-15 18:48:40 +02:00
Yannick Reiß ea3acd437a Reduced snippets of this piece of shit language called cobol 2024-09-15 18:48:25 +02:00
Yannick Reiß 04369588f6 Remove rarely used assembly snippets 2024-09-15 10:20:09 +02:00
3 changed files with 16 additions and 121 deletions

View File

@ -1,14 +1,10 @@
snippet string "Assembler string definition" snippet string86 "Assembler string definition"
${1:Name} db ${2:"Hello World!"} ; string $1 = $2 ${1:Name} db ${2:"Hello World!"} ; string $1 = $2
len_$1 equ $ - $1 ; length of string $1 len_$1 equ $ - $1 ; length of string $1
$0 $0
endsnippet endsnippet
snippet \n "Zeilenumbruch" A snippet write86 "write sys_call"
", 0x0a, "
endsnippet
snippet write "write sys_call"
mov eax, 4 ; write sys_call mov eax, 4 ; write sys_call
mov ebx, 1 ; write to stdout mov ebx, 1 ; write to stdout
mov ecx, ${1:string} ; string to write mov ecx, ${1:string} ; string to write
@ -17,7 +13,7 @@ int 0x80 ; system interrupt
$0 $0
endsnippet endsnippet
snippet exit "exit sys_call" snippet exit86 "exit sys_call"
mov eax, 1 ; exit sys_call mov eax, 1 ; exit sys_call
mov ebx, ${1:0} ; exit Code mov ebx, ${1:0} ; exit Code
int 0x80 ; system interrupt$0 int 0x80 ; system interrupt$0
@ -40,33 +36,7 @@ $1:
$0 $0
endsnippet endsnippet
snippet read "read sys call" snippet functionGCC "GCC conform function implementation" b
mov eax, 3 ; read sys call
mov ebx, 2 ; stdin file descriptor
mov ecx, ${1: variable} ; read input value in $1
mov edx, ${2:5} ; read $2 bytes of data
int 0x80 ; system interrupt
endsnippet
snippet aprstore "Store all purpose register on stack"
; store ap-register
push eax
push ebx
push ecx
push edx
$0
endsnippet
snippet aprload "Load all purpose register from stack"
; load ap-register
pop eax
pop ebx
pop ecx
pop edx
$0
endsnippet
snippet gcc_function "GCC conform function implementation" b
$1: $1:
push %ebp push %ebp
mov %esp, %ebp mov %esp, %ebp

View File

@ -1,3 +1,12 @@
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 template "template for new program" A snippet template "template for new program" A
*----------------------------------------------------------------- *-----------------------------------------------------------------
IDENTIFICATION DIVISION. IDENTIFICATION DIVISION.
@ -13,9 +22,9 @@ snippet template "template for new program" A
*------------------------- *-------------------------
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
$4 $4
*----------------------------------------------------------------- *-----------------------------------------------------------------
*----------------------------------------------------------------- *-----------------------------------------------------------------
PROCEDURE DIVISION. PROCEDURE DIVISION.
$0 $0
@ -23,70 +32,7 @@ snippet template "template for new program" A
*----------------------------------------------------------------- *-----------------------------------------------------------------
endsnippet endsnippet
snippet let "Add new Variable" A
${1:01} ${2:Name} PIC ${3:999}${4:(8) }${5:VALUE }.
$0
endsnippet
snippet compute "Insert a computation" A
COMPUTE ${1:Expression}.
endsnippet
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 calc "Add a Calculation with autocomplete" A
$1`!p snip.rv = complete(t[1], ['ADD', 'DIVIDE', 'MULTIPLY', 'SUBTRACT'])` ${2:Var1} `!p
try:
snip.rv = {'ADD': 'TO', 'DIVIDE': 'INTO', 'MULTIPLY': 'BY', 'SUBTRACT': 'FROM'}[t[1] + complete(t[1], ['ADD', 'DIVIDE', 'MULTIPLY', 'SUBTRACT'])]
except KeyError:
snip.rv = '---'
` ${3:Var2} GIVING ${4:VarResult}.
$0
endsnippet
snippet move "Move value to another value" A
MOVE ${1:Const/Var} TO ${2:Var}.
$0
endsnippet
snippet display "Display a contant or Variable" A snippet display "Display a contant or Variable" A
DISPLAY ${1:"Hello World!"}. DISPLAY ${1:"Hello World!"}.
$0 $0
endsnippet endsnippet
snippet accept "Accept a Value to an uninitialized Variable" A
ACCEPT ${1:Variable}.
$0
endsnippet
snippet strinit "Initialize an empty String" A
INITIALIZE ${1:Stringvariable}.
$0
endsnippet
snippet init "Inizialize a numerical Value" A
INITIALIZE ${1:Numerical variable} REPLACING NUMERIC DATA BY ${2:ZEROS}.
$0
endsnippet
snippet ifthen "If-then-else Clause" A
IF ${1:Condition} THEN
${2:Do this}
ELSE
${3:Do that}
END-IF.
$0
endsnippet
snippet ifis "IF-Condition 'is' POS/NEG" A
IS $1`!p snip.rv = complete(t[1], ['POSITIVE', 'NEGATIVE'])` $0
endsnippet

View File

@ -487,27 +487,6 @@ snippet \0 "Add another Backslash" iA
\\\\ \\\\
endsnippet endsnippet
snippet bibbook "Add a new book/journal/paper reference" b
\\bibitem{${1:Reference_name}}
${2:Author}. (${3:2023}) \`${4:Title}'. ${5:Extension} `!p
if t[6] == "":
snip.rv = ""
elif "-" in t[6]:
snip.rv = "Seiten "
else:
snip.rv = "Seite"
`$6`!p
if t[6] == "":
snip.rv = ""
else:
snip.rv = "."`
$0
endsnippet
snippet cc "Cite" i
\\cite{$1}$0
endsnippet
snippet setenv "Set Environment around Text" b snippet setenv "Set Environment around Text" b
\\begin{$1} \\begin{$1}
${VISUAL} ${VISUAL}