Compare commits
72 Commits
nvim_easyc
...
06cbad6b53
| Author | SHA1 | Date | |
|---|---|---|---|
| 06cbad6b53 | |||
| ea3acd437a | |||
| 04369588f6 | |||
| e1a5e7f825 | |||
| ea0e244f05 | |||
| 577fd649e3 | |||
| 61fb308e60 | |||
| 7f8f120b7b | |||
| 04eadef1d4 | |||
| ab043c5c1c | |||
| 2e0d35c2d9 | |||
| 299cdc7267 | |||
| 546cc3e437 | |||
| f0b346271c | |||
| 8026306999 | |||
| 325f41372a | |||
| 34d96fcddc | |||
| e2836f519f | |||
| 1d83337da8 | |||
| a1cffcf7e9 | |||
| 859311d0ee | |||
| 9c504e284f | |||
| e1711a1180 | |||
| 94457aae68 | |||
| 7e89acf09f | |||
| 39b9d351c0 | |||
| f33b495d12 | |||
| 74ce5c7cde | |||
| 3661bb6693 | |||
| 4c4a6443b9 | |||
| 1b9a7264de | |||
| 682f512251 | |||
| bd368117fe | |||
| 2143b6d5a1 | |||
| a3983ae9c5 | |||
| 290fcc1aff | |||
| e539bb663d | |||
| 5f39958f59 | |||
| b2cbeb41c1 | |||
| d42f1f53e8 | |||
| def3c6b531 | |||
| 1d7c562add | |||
| 39381d1da9 | |||
| f4b99df515 | |||
| 471e420829 | |||
| e15fc0dfa7 | |||
| 55c7a8d1e2 | |||
| e4812f748b | |||
| a7e387067a | |||
| 4fd990b5fd | |||
| 463ded36cd | |||
| 187b9de47a | |||
| d13d0ec0e8 | |||
| 30fdc90545 | |||
| bdab32c01a | |||
| abee013697 | |||
| 29f798abc7 | |||
| 49dfe769ed | |||
| 23d1e0deb1 | |||
| 4d3800a027 | |||
| ce70d6f9b7 | |||
| b2a762ab4d | |||
| e20feca786 | |||
| 0db71c6f62 | |||
| 744865e965 | |||
| 6b13d4c6b4 | |||
| 8eb3955fd6 | |||
| 54991cf3d9 | |||
| bb886d3fe6 | |||
| 1ceb2e0e4a | |||
| 77bba8c263 | |||
| 84d14e8884 |
29
.gitea/workflows/test.yaml
Normal file
29
.gitea/workflows/test.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Test Neovim config on push
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install required packages
|
||||||
|
run: |
|
||||||
|
apt-get update -qy
|
||||||
|
apt-get install -y git
|
||||||
|
apt-get install -y neovim
|
||||||
|
apt-get install -y python3-neovim
|
||||||
|
|
||||||
|
- name: Clone neovim repository
|
||||||
|
run: |
|
||||||
|
git clone https://git.nickr.eu/yannickreiss/nvim
|
||||||
|
|
||||||
|
- name: Syntax check the configuration
|
||||||
|
run: |
|
||||||
|
cd nvim && nvim -l init.lua
|
||||||
@@ -1,5 +1,63 @@
|
|||||||
snippet textio "Insert Textio import" b
|
global !p
|
||||||
with Ada.Text_IO;$0
|
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]
|
||||||
|
if len(opts) > 5:
|
||||||
|
opts = opts[0:5]
|
||||||
|
return "(" + "|".join(opts) + ")"
|
||||||
|
|
||||||
|
def find_candidate(tabstop, search_type):
|
||||||
|
# Split up the tabstop on semicolons
|
||||||
|
items = tabstop.replace("\n", "").replace(" ", "").split(";")
|
||||||
|
|
||||||
|
# find multiple same time assignments (a, b : Integer)
|
||||||
|
single_items = []
|
||||||
|
for item in items:
|
||||||
|
if (len(item.split(",")) > 1) and (len(item.split(":")) > 1):
|
||||||
|
variables = item.split(":")[0]
|
||||||
|
multi_type = item.split(":")[1]
|
||||||
|
for variable in variables.split(","):
|
||||||
|
single_items.append(f"{variable}:{multi_type}")
|
||||||
|
else:
|
||||||
|
single_items.append(item)
|
||||||
|
for candidate in single_items:
|
||||||
|
if len(candidate.split(":")) > 1:
|
||||||
|
name = candidate.split(":")[0]
|
||||||
|
candidate_type = candidate.split(":")[1]
|
||||||
|
else:
|
||||||
|
name = "None"
|
||||||
|
candidate_type = ""
|
||||||
|
|
||||||
|
if candidate_type == search_type:
|
||||||
|
return name
|
||||||
|
return "None"
|
||||||
|
endglobal
|
||||||
|
|
||||||
|
snippet helloworld "Hello world example to test features" b
|
||||||
|
-- `!p snip.rv = fn`
|
||||||
|
-- Created on: `date`
|
||||||
|
-- Author(s): Yannick Reiss <yannick.reiss@nickr.eu>
|
||||||
|
-- Content: Hello world example
|
||||||
|
with Ada.Text_IO; use Ada.Text_IO;
|
||||||
|
|
||||||
|
-- @name ${1:`!p snip.rv = fn[0].upper() + fn[1:].split('.')[0]`}
|
||||||
|
-- @return
|
||||||
|
-- @description Function printing hello world.
|
||||||
|
procedure $1 is
|
||||||
|
|
||||||
|
begin
|
||||||
|
${2:Put_Line ("Hello world!");}
|
||||||
|
end $1;$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet docstring "Document String with most important information" b
|
||||||
|
-- `!p snip.rv = fn`
|
||||||
|
-- Created on: `date`
|
||||||
|
-- Author(s): ${1:Yannick Reiß}
|
||||||
|
-- Description: ${2:`!p snip.rv = fn.split('.')[0]`}
|
||||||
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet procedure "insert procedure" b
|
snippet procedure "insert procedure" b
|
||||||
@@ -10,102 +68,94 @@ snip.rv = ""
|
|||||||
if t[2].startswith("l"):
|
if t[2].startswith("l"):
|
||||||
parameters = []
|
parameters = []
|
||||||
else:
|
else:
|
||||||
parameters = t[2].replace("\n", "").split(";");
|
parameters = t[2].replace("; ", ";").split(";");
|
||||||
for parameter in parameters:
|
for parameter in parameters:
|
||||||
if not parameter == "" and not parameter.startswith("typ"):
|
if not parameter == "" and not parameter.startswith("typ"):
|
||||||
paramless = parameter.replace("\t", "")
|
parameterless = parameter.replace("\t", "")
|
||||||
snip.rv += f"-- @variable {paramless}\n"
|
snip.rv += f"-- @parameter {parameterless}\n"
|
||||||
`-- @description $3
|
``!p
|
||||||
procedure ${1:Name} is
|
snip.rv = ""
|
||||||
$2
|
if t[3].startswith("l"):
|
||||||
|
variables = []
|
||||||
|
else:
|
||||||
|
variables = t[3].replace("\n", "").split(";");
|
||||||
|
for variable in variables:
|
||||||
|
if not variable == "" and not variable.startswith("typ"):
|
||||||
|
variableless = variable.replace("\t", "").replace (" ", "")
|
||||||
|
snip.rv += f"-- @variable {variableless}\n"
|
||||||
|
`-- @description $4
|
||||||
|
procedure ${1:`!p snip.rv = fn.split('.')[0].capitalize()`} `!p snip.rv = "" if t[2] == "" else "("`${2:N : Natural}`!p snip.rv = "" if t[2] == "" else ")"` is
|
||||||
|
$3
|
||||||
begin
|
begin
|
||||||
$4
|
$5
|
||||||
end $1;$0
|
end $1;$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet function "insert function" b
|
snippet function "insert function" b
|
||||||
-- @name $1
|
-- @name $1
|
||||||
-- @return $3
|
-- @return $3
|
||||||
-- @param $2
|
|
||||||
`!p
|
`!p
|
||||||
snip.rv = ""
|
snip.rv = ""
|
||||||
if t[4].startswith("l"):
|
if t[2].startswith("l"):
|
||||||
parameters = []
|
parameters = []
|
||||||
else:
|
else:
|
||||||
parameters = t[4].replace("\n", "").split(";")
|
parameters = t[2].replace("; ", ";").split(";");
|
||||||
for parameter in parameters:
|
for parameter in parameters:
|
||||||
if not parameter.startswith("typ") and not parameter == "":
|
if not parameter == "" and not parameter.startswith("typ"):
|
||||||
paramless = parameter.replace("\t", "")
|
parameterless = parameter.replace("\t", "")
|
||||||
snip.rv += f"-- @variable {paramless}\n"
|
snip.rv += f"-- @parameter {parameterless}\n"
|
||||||
|
``!p
|
||||||
|
snip.rv = ""
|
||||||
|
if t[4].startswith("l"):
|
||||||
|
variables = []
|
||||||
|
else:
|
||||||
|
variables = t[4].replace("\n", "").split(";");
|
||||||
|
for variable in variables:
|
||||||
|
if not variable == "" and not variable.startswith("typ") and not variable.startswith("--"):
|
||||||
|
variableless = variable.replace("\t", "").replace (" ", "")
|
||||||
|
snip.rv += f"-- @variable {variableless}\n"
|
||||||
`-- @description $5
|
`-- @description $5
|
||||||
function ${1:Name}($2`!p if (t[2] == ""):
|
function ${1:`!p snip.rv = fn.split('.')[0].capitalize()`} `!p snip.rv = "" if t[2] == "" else "("`${2:N : Natural}`!p snip.rv = "" if t[2] == "" else ")"` return ${3:Natural} is
|
||||||
t[2] = "a, b: Integer"`) return ${3:Integer} is
|
|
||||||
$4
|
$4
|
||||||
begin
|
begin
|
||||||
$7
|
$6
|
||||||
return ${6:`!p snip.rv = t[3]`};
|
|
||||||
|
return `!p
|
||||||
|
candidate = find_candidate(t[4], t[3])
|
||||||
|
if candidate == "None":
|
||||||
|
candidate = find_candidate(t[2], t[3])
|
||||||
|
if candidate == "None":
|
||||||
|
candidate = t[1]
|
||||||
|
snip.rv = candidate
|
||||||
|
`;
|
||||||
end $1;$0
|
end $1;$0
|
||||||
endsnippet
|
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]
|
|
||||||
if len(opts) > 5:
|
|
||||||
opts = opts[0:5]
|
|
||||||
return "(" + "|".join(opts) + ")"
|
|
||||||
endglobal
|
|
||||||
|
|
||||||
snippet if "If condition" b
|
|
||||||
if $1 then
|
|
||||||
$2
|
|
||||||
$3`!p snip.rv = complete(t[3], ["elsif", "else", "end if;"])` ${4:`!p if t[3] == "elsif":
|
|
||||||
snip.rv = "condition"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`} `!p
|
|
||||||
if t[3] == "elsif":
|
|
||||||
snip.rv = "then"`
|
|
||||||
$5
|
|
||||||
`!p if t[3] == "end if;":
|
|
||||||
snip.rv = ""
|
|
||||||
else:
|
|
||||||
snip.rv = "end if;"`$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet for "For loop" b
|
|
||||||
for ${1:i} ${2:in ${3:1}..${4:10}} loop
|
|
||||||
$5
|
|
||||||
end loop;$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet while "While loop" b
|
|
||||||
while ${1:Condition} loop
|
|
||||||
$2
|
|
||||||
end loop;$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet let "Create new Variable" bA
|
|
||||||
${1:letName}`!p if not t[1].startswith("let"):
|
|
||||||
t[1] = t[1].capitalize()``!p snip.rv = "\t:\t"`${2}`!p if t[2].startswith("!"):
|
|
||||||
snip.rv = ""
|
|
||||||
else:
|
|
||||||
snip.rv = complete(t[2], ["Integer", "Boolean", "Float", "Natural", "Positive", "Negative", "Long_Float", "String"])
|
|
||||||
``!p if t[3] == "":
|
|
||||||
snip.rv = ""
|
|
||||||
else:
|
|
||||||
snip.rv = " := "
|
|
||||||
`$3;
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet type "declare a new type" bA
|
snippet type "declare a new type" bA
|
||||||
type ${1:TypeName} is ${2:array($3..$4)} of ${5:Integer};$0
|
type ${1:TypeName} is ${2:array($3..$4) of }`!p
|
||||||
|
if t[2] == "record":
|
||||||
|
snip.rv = "\n\t\t"
|
||||||
|
else:
|
||||||
|
snip.rv = ""`$5`!p
|
||||||
|
if t[2] == "record":
|
||||||
|
snip.rv = "\n\tend record"
|
||||||
|
else:
|
||||||
|
snip.rv = ""
|
||||||
|
`;$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet docstring "Document String with most important infor" b
|
snippet project "Project" b
|
||||||
-- `!p snip.rv = fn`
|
project ${1:Default} is
|
||||||
-- Created on: `date`
|
for Source_Dirs use ("${2:src}");
|
||||||
-- Author(s): ${1:Yannick Reiß}
|
for Object_Dir use "${3:obj}";
|
||||||
-- Content: ${2: Function `!p snip.rv = fn.split('.')[0]`}
|
for Exec_Dir use "${4:bin}";
|
||||||
|
for Main use ("${5:main.adb}");
|
||||||
|
for Languages use ("Ada");
|
||||||
|
end $1;
|
||||||
|
-- Create dir? (y/): ${6:no}`!p
|
||||||
|
from os import system
|
||||||
|
if t[6] == "y":
|
||||||
|
system(f"mkdir -p {t[2]}")
|
||||||
|
system(f"mkdir -p {t[3]}")
|
||||||
|
system(f"mkdir -p {t[4]}")`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
snippet cred "My private Credentials"
|
|
||||||
Yannick Reiss <yannick.reiss@nickr.eu>
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet solve "Solve a python equation"
|
|
||||||
${1:1*1}`!p rv = ""
|
|
||||||
from math import *
|
|
||||||
try:
|
|
||||||
rv = eval(t[1])
|
|
||||||
except:
|
|
||||||
rv = "?"
|
|
||||||
snip.rv = f" = {rv}"`
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet dd "Date and Time" i
|
snippet dd "Date and Time" i
|
||||||
`date`
|
`date`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet credhsrm "Credentials HSRM"
|
snippet cred "My private Credentials"
|
||||||
Yannick Reiß (yareissx/yreis001) <yannick.reiss@student.hs-rm.de>
|
Nicki Reiss <yannick.reiss@nickr.eu>
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet credhsrm "Credentials HSRM"
|
||||||
|
Yannick Reiß <yannick.reiss@student.hs-rm.de>
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ endsnippet
|
|||||||
|
|
||||||
snippet article "Add article reference" b
|
snippet article "Add article reference" b
|
||||||
@article{${1:ref_name},
|
@article{${1:ref_name},
|
||||||
title={${2:Titel}},
|
title = {${2:Titel}},
|
||||||
author={${3:Autor}},
|
author = {${3:Autor}},
|
||||||
journal={${4:Journal}},`!p
|
journal = {${4:Journal}},`!p
|
||||||
if t[5] != "":
|
if t[5] != "":
|
||||||
snip.rv = "\n\tvolume\t= {"
|
snip.rv = "\n\tvolume\t= {"
|
||||||
else:
|
else:
|
||||||
@@ -45,8 +45,9 @@ if t[7] != "":
|
|||||||
snip.rv = "},"
|
snip.rv = "},"
|
||||||
else:
|
else:
|
||||||
snip.rv = ""`
|
snip.rv = ""`
|
||||||
year={${8:2023}},
|
year = {${8:2023}},
|
||||||
publisher={${9:Verlag}}
|
doi = {${9:DOI_NUM}}
|
||||||
|
publisher = {${10:Verlag}}
|
||||||
}
|
}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -1,10 +1,32 @@
|
|||||||
snippet hello "Hello World"
|
extends cpp
|
||||||
Hallo
|
|
||||||
|
priority 200
|
||||||
|
|
||||||
|
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 helloworld "Hello World"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void){(void)printf("Hello World!\n");return 0;}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet for "For-loop head"
|
snippet for "For-loop head"
|
||||||
for (${1:int i} = ${2:0}; ${3:i}; ${4:--i}) {
|
for (${1:int ${2:i}} = ${3:0}; ${4:$2 < $5}; ${6:$2++}) {
|
||||||
$5
|
$7
|
||||||
|
}
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet while "while loop head"
|
||||||
|
for (;$1;) {
|
||||||
|
$2
|
||||||
}
|
}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@@ -26,27 +48,6 @@ else:
|
|||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet "(\w+)->fun" "Struct function" r
|
|
||||||
${1:int} ${2:Name} (`!p snip.rv = match.group(1)`* self, ${4:void}) {
|
|
||||||
`!p
|
|
||||||
if t[1].replace('static ', '') != "void":
|
|
||||||
snip.rv = f"{t[1].replace('static ', '')} rv = 0;"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`
|
|
||||||
$5
|
|
||||||
`!p
|
|
||||||
if t[1].replace('static ', '') != "void":
|
|
||||||
snip.rv = f"return rv;"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "self.(\w+)" "Struct call" r
|
|
||||||
`!p snip.rv = match.group(1)`(self$1)$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pfun "prototype for function" bA
|
snippet pfun "prototype for function" bA
|
||||||
/**
|
/**
|
||||||
* @name $2
|
* @name $2
|
||||||
@@ -77,50 +78,33 @@ for param in params:
|
|||||||
snip.rv = rval`
|
snip.rv = rval`
|
||||||
*/
|
*/
|
||||||
${1:int} ${2:MyFunc} (${3:void}) {
|
${1:int} ${2:MyFunc} (${3:void}) {
|
||||||
|
/* Returns ${5:void} */
|
||||||
`!p
|
`!p
|
||||||
if t[1].replace('static ', '') != "void":
|
if t[1].replace('static ', '') != "void":
|
||||||
snip.rv = f"{t[1].replace('static ', '')} rv = 0;"
|
snip.rv = f"{t[1].replace('static ', '')} {t[5]} = 0;"
|
||||||
else:
|
else:
|
||||||
snip.rv = ""`
|
snip.rv = ""`
|
||||||
$5
|
$6
|
||||||
`!p
|
`!p
|
||||||
if t[1].replace('static ', '') != "void":
|
if t[1].replace('static ', '') != "void":
|
||||||
snip.rv = f"return rv;"
|
snip.rv = f"return {t[5]};"
|
||||||
else:
|
else:
|
||||||
snip.rv = ""`
|
snip.rv = ""`
|
||||||
}
|
}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet while "while loop head"
|
|
||||||
for (;$1;) {
|
|
||||||
$2
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
|
snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
|
||||||
/* Allocate memory for `!p snip.rv = match.group(1)` */
|
/* Allocate memory for `!p snip.rv = match.group(1)` */
|
||||||
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
|
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
|
||||||
if (!`!p snip.rv = match.group(1)`) {
|
if (!`!p snip.rv = match.group(1)`) {
|
||||||
/* Error */
|
/* Error */
|
||||||
(void)printf("malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
|
(void)printf("ERROR: malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet "(\w+) = open" "Automatic open error implementation" rA
|
|
||||||
/* create descriptor `!p snip.rv = match.group(1)` for file $1 */
|
|
||||||
`!p snip.rv = match.group(1)` = open(${1:"Filename"}, ${2:"MODE"});
|
|
||||||
if (-1 == `!p snip.rv = match.group(1)`) {
|
|
||||||
/* Error */
|
|
||||||
perror(${4:"open error"});
|
|
||||||
${5:exit(EXIT_FAILURE);}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet swap "Swap two integer or numerical variables"
|
snippet swap "Swap two integer or numerical variables"
|
||||||
/* Swap Variables $1 and $2 */
|
/* Swap Variables $1 and $2 */
|
||||||
${1:Var1} = $1 + ${2:Var2};
|
${1:Var1} = $1 + ${2:Var2};
|
||||||
@@ -129,27 +113,6 @@ $1 = $1 - $2;
|
|||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet cast "adds cast" i
|
|
||||||
(${1:void})$0
|
|
||||||
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 printf "Cast printf result to 'void' if heturn value is unneeded" bA
|
|
||||||
(void)printf("$1"`!p
|
|
||||||
if "%" in t[1]:
|
|
||||||
snip.rv = ", "
|
|
||||||
else:
|
|
||||||
snip.rv = ""`$2);$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet defstruct "define a new type with a struct" A
|
snippet defstruct "define a new type with a struct" A
|
||||||
/* define struct $1 ${2:Explaination} */
|
/* define struct $1 ${2:Explaination} */
|
||||||
typedef struct $1 $1;
|
typedef struct $1 $1;
|
||||||
@@ -158,10 +121,11 @@ struct $1 {
|
|||||||
};
|
};
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet docomment "Meta Comment for Documenation" A
|
snippet docstring "Meta Comment for Documenation" A
|
||||||
/*
|
/*
|
||||||
* Filename: `!p snip.rv = fn`
|
* Filename: `!p snip.rv = fn`
|
||||||
* Author: ${1:Yannick Reiss}
|
* Author: ${1:Yannick Reiss}
|
||||||
|
* Date: `date`
|
||||||
* Project: ${2:Project Name}
|
* Project: ${2:Project Name}
|
||||||
* Copyright: ${3:None}
|
* Copyright: ${3:None}
|
||||||
* Description: ${4:Funny module}
|
* Description: ${4:Funny module}
|
||||||
@@ -198,158 +162,10 @@ $8
|
|||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet let+ "Declare and initialize Variable" A
|
|
||||||
${1:int} ${2:Variable} = ${3:0}; /* ${4:Description} */
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet let- "Declare Variable" A
|
|
||||||
${1:int} ${2:Variable}; /* ${3:Description} */
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "close\((\w+)\)" "Automatic close error implementation" brA
|
|
||||||
/* Closing file `!p snip.rv = match.group(1)` */
|
|
||||||
if (close(`!p snip.rv = match.group(1)`)) {
|
|
||||||
/* Error */
|
|
||||||
perror("${1:Could not close file!}");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet write( "Automatic write error check" A
|
|
||||||
/* Write $3 bytes from $2 to file $1 */
|
|
||||||
if (-1 == write(${1:file}, ${2:buffer}, ${3:bytes})) {
|
|
||||||
/* Error */
|
|
||||||
perror("${4:Could not write to file!}");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet /* "comment" A
|
snippet /* "comment" A
|
||||||
/* $1 */$0
|
/* $1 */$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet "read\((.+), (.+), (.+)\);" "auto read" brA
|
|
||||||
/* read `!p snip.rv = match.group(3)` from file `!p snip.rv = match.group(1)` intobuffer `!p snip.rv = match.goup(2)` */
|
|
||||||
if (-1 == read(`!p snip.rv = match.group(1)`, `!p snip.rv = match.group(2)`, `!p snip.rv = match.group(3)`)) {
|
|
||||||
/* Error */
|
|
||||||
perror("${1:Could not read to file!})";
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "fstat\((.+), (.+)\);" "auto stat" brA
|
|
||||||
/* load information about file `!p snip.rv = match.group(1)` into struct `!p snip.rv = match.group(2)` */
|
|
||||||
if (fstat(`!p snip.rv = match.group(1)`, `!p snip.rv = match.group(2)`)) {
|
|
||||||
/* Error */
|
|
||||||
perror("${1:Could not fill struct with information!}");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "ftruncate\((.+), (.+)\);" "ftruncate auto" brA
|
|
||||||
/* Resize file `!p snip.rv = match.group(1)` to size `!p snip.rv = match.group(2)` */
|
|
||||||
if (ftruncate(`!p snip.rv = match.group(1)`, `!p snip.rv = match.group(2)`)) {
|
|
||||||
/* Error */
|
|
||||||
perror("${1:Could not resize file!}j;
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet 'system\("(.+)"\);' "Automatic system error implementation" rA
|
|
||||||
/* run system command `!p snip.rv = match.group(1)` and check for success */
|
|
||||||
if (system("`!p snip.rv = match.group(1)`")) {
|
|
||||||
/* Error */
|
|
||||||
perror(${1:"Could not execute shell command!"});
|
|
||||||
${5:exit(EXIT_FAILURE);}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "if \(argc" "automatically add clarg check" A
|
|
||||||
/* check for right number of arguments */
|
|
||||||
if (argc ${1:!=} $2) {
|
|
||||||
/* Error */
|
|
||||||
perror("Wrong number of arguments");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet "(\w+) = fork" "Auto fork error implementation" rA
|
|
||||||
/* create new subproccess `!p snip.rv = match.group(1)` */
|
|
||||||
`!p snip.rv = match.group(1)` = fork();
|
|
||||||
if (`!p snip.rv = match.group(1)` < 0) {
|
|
||||||
/* Error */
|
|
||||||
perror("fork error on creating new subprocess '`!p snip.rv = match.group(1)`'.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
} else if (!`!p snip.rv = match.group(1)`) {
|
|
||||||
/* fork runs from here */
|
|
||||||
${1:execve(proc, args, NULL)};
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_create "pthreadcreate auto implement" A
|
|
||||||
/* Creating thread $1 running function $3 */
|
|
||||||
if (pthread_create(${1:thread}, ${2:NULL}, ${3:function}, ${4:args})) {
|
|
||||||
perror("Could not create thread $1.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_mutex_unlock "mutex" iA
|
|
||||||
/* Unlock mutex $1 */
|
|
||||||
if ( pthread_mutex_unlock(&${1:mutex}) ) {
|
|
||||||
perror("Could not unlock mutex $1.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_cond_wait "condition wait" iA
|
|
||||||
/* wait for condition $1 on mutex $2 */
|
|
||||||
if ( pthread_cond_wait(&${1:Condition}, &${2:mutex}) ) {
|
|
||||||
perror("Could not wait for signal $1 on mutex $2.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_cond_signal "condition signal" iA
|
|
||||||
/* Send signal $1 */
|
|
||||||
if ( pthread_cond_signal(&${1:signal}) ) {
|
|
||||||
perror("Could not send signal $1.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_mutex_lock "mutex" iA
|
|
||||||
/* lock the mutex $1 */
|
|
||||||
if ( pthread_mutex_lock(&${1:mutex}) ) {
|
|
||||||
perror("Could not lock mutex $1.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pthread_join "join thread" iA
|
|
||||||
/* join the thread $1 */
|
|
||||||
if ( pthread_join(${1:thread}, ${2:NULL}) ) {
|
|
||||||
perror("Could not join thread $1.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sigaction "signal action" i
|
|
||||||
/* call function $2 on signal $1 */
|
|
||||||
if ( sigaction(${1:SIGINT}, ${2:&act}, ${3:&old}) ) {
|
|
||||||
perror("Could not change function of signal $1 to $2.");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fflush "flush stdout" iA
|
snippet fflush "flush stdout" iA
|
||||||
/* flush stdout */
|
/* flush stdout */
|
||||||
if ( fflush(stdout) ) {
|
if ( fflush(stdout) ) {
|
||||||
@@ -357,3 +173,13 @@ if ( fflush(stdout) ) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet switch "Classic C switch statement" b
|
||||||
|
switch(${1:Expression}) {
|
||||||
|
case $3:
|
||||||
|
$4
|
||||||
|
break;$5
|
||||||
|
default:
|
||||||
|
$2
|
||||||
|
}$0
|
||||||
|
endsnippet
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
extends c
|
||||||
|
priority 100
|
||||||
|
|
||||||
snippet header "Header wrapper" b
|
snippet header "Header wrapper" b
|
||||||
#ifndef $1
|
#ifndef $1
|
||||||
#define $1
|
#define $1
|
||||||
@@ -7,72 +10,6 @@ $0
|
|||||||
#endif//$1
|
#endif//$1
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet for "For-loop head"
|
|
||||||
for (${1:int i} = ${2:0}; ${3:i}; ${4:--i}) {
|
|
||||||
$5
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet exfun "New Function with Documentation"
|
|
||||||
/**
|
|
||||||
* @name $2
|
|
||||||
* @return `!p t[1].replace("static ", "")`
|
|
||||||
* @brief ${4: Description}
|
|
||||||
*
|
|
||||||
`!p
|
|
||||||
params = t[3].split(", ")
|
|
||||||
rval = ""
|
|
||||||
for param in params:
|
|
||||||
if len(param.split(' ')) == 2:
|
|
||||||
rval += f" * @param {param}:\t{t[2]}_{param.split(' ')[1]}\n"
|
|
||||||
snip.rv = rval`
|
|
||||||
*/
|
|
||||||
${1:int} ${2:MyFunc} (${3:void}) {
|
|
||||||
`!p
|
|
||||||
if t[1] != "void":
|
|
||||||
snip.rv = f"{t[1].replace('static ', '')} rv = 0;"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`
|
|
||||||
$5
|
|
||||||
`!p
|
|
||||||
if t[1].replace("static ", "") != "void":
|
|
||||||
snip.rv = f"return rv;"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fun "Function template"
|
|
||||||
${1:int} ${2:Name} (${3:void}) {
|
|
||||||
$5
|
|
||||||
|
|
||||||
return ${6:`!p
|
|
||||||
if t[1].replace("static ", "") != "void":
|
|
||||||
snip.rv = f"0"
|
|
||||||
else:
|
|
||||||
snip.rv = ""`};
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet while "while loop head"
|
|
||||||
while (${1:true}) {
|
|
||||||
$2
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ifelse "If-Clause"
|
|
||||||
if ($1) {
|
|
||||||
$2
|
|
||||||
} else {
|
|
||||||
$3
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet class "Add new class" bA
|
snippet class "Add new class" bA
|
||||||
class $1 ${2::} `!p
|
class $1 ${2::} `!p
|
||||||
if t[2] == ":":
|
if t[2] == ":":
|
||||||
@@ -150,47 +87,3 @@ for var in variables:
|
|||||||
snip.rv = rv`
|
snip.rv = rv`
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet defstruct "define a new type with a struct" A
|
|
||||||
typedef struct $1 $1;
|
|
||||||
struct $1{
|
|
||||||
$2
|
|
||||||
};
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet docomment "Meta Comment" A
|
|
||||||
/*
|
|
||||||
* Filename: `!p snip.rv = fn`
|
|
||||||
* Author: ${1:Yannick Reiss}
|
|
||||||
* Project: ${2:Project Name}
|
|
||||||
* Copyright: ${3:None}
|
|
||||||
* Description: ${4:Helpful description}
|
|
||||||
*/
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet let+ "Declare and initialize Variable" A
|
|
||||||
${1:int} ${2:Variable} = ${3:0}; /* ${4:Description} */
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet let- "Declare Variable" A
|
|
||||||
${1:int} ${2:Variable}; /* ${3:Description} */
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pfun "prototype for function" bA
|
|
||||||
/**
|
|
||||||
* @name $2
|
|
||||||
* @return $1
|
|
||||||
* @brief ${4: Description}
|
|
||||||
* `!p
|
|
||||||
params = t[3].split(", ")
|
|
||||||
rval = ""
|
|
||||||
for param in params:
|
|
||||||
if len(param.split(' ')) >= 2:
|
|
||||||
rval += f"\n *\t@param {param}:\t{t[2]}_{param.split(' ')[1]}"
|
|
||||||
snip.rv = rval`
|
|
||||||
*/
|
|
||||||
${1:int} ${2:MyFunc} (${3:void});
|
|
||||||
endsnippet
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
snippet fun "New function"
|
snippet fun "New function"
|
||||||
function ${1:Name} ($2)
|
-- @name $1
|
||||||
$3
|
`!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;
|
end;
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
global !p
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
def get_datetime():
|
||||||
|
now = datetime.now()
|
||||||
|
now_as_list = [
|
||||||
|
now.strftime("%d"),
|
||||||
|
now.strftime("%m"),
|
||||||
|
now.strftime("%Y"),
|
||||||
|
now.strftime("%H"),
|
||||||
|
now.strftime("%M")
|
||||||
|
]
|
||||||
|
return now_as_list
|
||||||
|
|
||||||
|
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]
|
||||||
|
else:
|
||||||
|
return "(" + '|'.join(opts) + ")"
|
||||||
|
|
||||||
|
endglobal
|
||||||
|
|
||||||
|
snippet mail "Template for a new delayed Mail" b
|
||||||
|
time:${1:`!p snip.rv = get_datetime()[0]`}.${2:`!p snip.rv = get_datetime()[1]`}.${3:`!p snip.rv = get_datetime()[2]`} ${4:`!p snip.rv = get_datetime()[3]`}:${5:`!p snip.rv = get_datetime()[4]`}
|
||||||
|
from:$6`!p snip.rv = complete(t[6], ['yannick.reiss@nickr.eu', 'schnick@nickr.eu'])`
|
||||||
|
to:${7:schnick@nickr.eu}
|
||||||
|
subject:${8:Subject}
|
||||||
|
|
||||||
|
${9:Message}
|
||||||
|
|
||||||
|
${10:`cat ~/.signature.txt`}
|
||||||
|
endsnippet
|
||||||
|
|||||||
@@ -108,3 +108,9 @@ snippet rule "Add new Rule"
|
|||||||
${1:all}: $2
|
${1:all}: $2
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet clean "Clean the object files and binary file" b
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
${1:rm *.o $(BIN)}
|
||||||
|
endsnippet
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ $1
|
|||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet cjson "json code"
|
||||||
|
\`\`\`json
|
||||||
|
$1
|
||||||
|
\`\`\`
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet ,m "Math equation" A
|
snippet ,m "Math equation" A
|
||||||
\$$1\$ $0
|
\$$1\$ $0
|
||||||
endsnippet
|
endsnippet
|
||||||
@@ -85,3 +92,8 @@ snippet cite "Cite from a paper" b
|
|||||||
Tags: $2
|
Tags: $2
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet immernoch "ARGH, lern schreiben!" A
|
||||||
|
noch immer
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ for param in params:
|
|||||||
$6
|
$6
|
||||||
`!p
|
`!p
|
||||||
if t[4] != "":
|
if t[4] != "":
|
||||||
snip.rv = f"\n\treturn {t[4]}"`
|
snip.rv = f"\n return {t[4]}"`
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -75,3 +75,14 @@ endsnippet
|
|||||||
snippet println "println" A
|
snippet println "println" A
|
||||||
println!("$1");$0
|
println!("$1");$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet docstring "Document head" b
|
||||||
|
/*
|
||||||
|
* Filename: `!p snip.rv = fn`
|
||||||
|
* Author: ${1:Yannick Reiss}
|
||||||
|
* Project: ${2:Project Name}
|
||||||
|
* Copyright: ${3:None} => You • 9 months ago • Move of Snippets into repository
|
||||||
|
* Description: ${4:Funny module}
|
||||||
|
*
|
||||||
|
*/$0
|
||||||
|
endsnippet
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ snippet img "Images"
|
|||||||
\\centering
|
\\centering
|
||||||
\\includegraphics[width=${2:0.8}\\linewidth]{${3}}
|
\\includegraphics[width=${2:0.8}\\linewidth]{${3}}
|
||||||
\\caption{${4:Abbildung}}
|
\\caption{${4:Abbildung}}
|
||||||
|
\\label{img:`!p snip.rv = t[4].lower().replace(" ", "_")`}
|
||||||
\\end{figure}
|
\\end{figure}
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@@ -264,23 +265,28 @@ snippet - "new item" b
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sch "chapter"
|
snippet sch "chapter"
|
||||||
\\chapter{$1}$0
|
\\chapter{$1}
|
||||||
|
\\label{chapter:`!p snip.rv = get_label(t[1])`}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sse "Section"
|
snippet sse "Section"
|
||||||
\\section{$1}$0
|
\\section{$1}
|
||||||
|
\\label{section:`!p snip.rv = get_label(t[1])`}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sss "Subsection"
|
snippet sss "Subsection"
|
||||||
\\subsection{$1}$0
|
\\subsection{$1}
|
||||||
|
\\label{subsection:`!p snip.rv = get_label(t[1])`}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ssn "Subsubsection"
|
snippet ssn "Subsubsection"
|
||||||
\\subsubsection{$1}$0
|
\\subsubsection{$1}
|
||||||
|
\\label{subsubsection:`!p snip.rv = get_label(t[1])`}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet par "Paragraph"
|
snippet par "Paragraph"
|
||||||
\\paragraph{$1}$0
|
\\paragraph{$1}
|
||||||
|
\\label{paragraph:`!p snip.rv = get_label(t[1])`}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet mquote "max quote"
|
snippet mquote "max quote"
|
||||||
@@ -373,6 +379,16 @@ def create_table(cols, rows, sep, start, end, head="##"):
|
|||||||
placeholder += 1
|
placeholder += 1
|
||||||
res += end
|
res += end
|
||||||
return res[:-1]
|
return res[:-1]
|
||||||
|
|
||||||
|
def get_label(title):
|
||||||
|
return_label = title.lower()
|
||||||
|
return_label = return_label.replace(" ", "_")
|
||||||
|
return_label = return_label.replace("ä", "ae")
|
||||||
|
return_label = return_label.replace("ö", "oe")
|
||||||
|
return_label = return_label.replace("ü", "ue")
|
||||||
|
return_label = return_label.replace("-", "__")
|
||||||
|
|
||||||
|
return return_label
|
||||||
endglobal
|
endglobal
|
||||||
|
|
||||||
post_jump "create_table_tabs(snip)"
|
post_jump "create_table_tabs(snip)"
|
||||||
@@ -459,7 +475,7 @@ snippet _- "Escape _ easier" iA
|
|||||||
\\_
|
\\_
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet bsp "Beispielsweise" iA
|
snippet bsp "Beispielsweise" A
|
||||||
beispielsweise
|
beispielsweise
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@@ -467,23 +483,12 @@ snippet ß "Backslash" A
|
|||||||
\\
|
\\
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet bibbook "Add a new book/journal/paper reference" b
|
snippet \0 "Add another Backslash" iA
|
||||||
\\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
|
endsnippet
|
||||||
|
|
||||||
snippet cc "Cite" A
|
snippet setenv "Set Environment around Text" b
|
||||||
\\cite{$1}$0
|
\\begin{$1}
|
||||||
|
${VISUAL}
|
||||||
|
\\end{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
snippet entry "Add new entry" bA
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
--- Title: $1
|
|
||||||
--- Date: ${2:`date`}
|
|
||||||
--- Author: ${3:`whoami`}
|
|
||||||
--- Host: `hostname`
|
|
||||||
-----------------------------------------------------------
|
|
||||||
Tags: $4
|
|
||||||
|
|
||||||
$5
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet 1) "Enumerated List" b
|
|
||||||
1) $1
|
|
||||||
`!p
|
|
||||||
if t[1] == "":
|
|
||||||
index = 2
|
|
||||||
if " \n" in t[1]:
|
|
||||||
t[1] = t[1].replace(" \n", f"\n{index})")
|
|
||||||
index += 1`
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet - "Itemized List" b
|
|
||||||
- $1
|
|
||||||
`!p
|
|
||||||
t[1] = t[1].replace(" \n", f"\n-")`
|
|
||||||
$0
|
|
||||||
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]
|
|
||||||
else:
|
|
||||||
return f"({'|'.join(opts)})"
|
|
||||||
endglobal
|
|
||||||
|
|
||||||
snippet mgl "DLRG neues Mitglied" b
|
|
||||||
${1:Num}|${2:Eintrittsdatum}`!p
|
|
||||||
if t[2] != "Eintrittsdatum" and len(t[2]) == 8:
|
|
||||||
if len(t[2]) > 2:
|
|
||||||
t[2] = f"{t[2][0:2]}.{t[2][2:]}"
|
|
||||||
if len(t[2]) > 4:
|
|
||||||
t[2] = f"{t[2][:5]}.{t[2][5:]}"
|
|
||||||
`|${3:Geburtsdatum}`!p
|
|
||||||
if t[3] != "Geburtsdatum" and len(t[3]) == 8:
|
|
||||||
if len(t[3]) > 2:
|
|
||||||
t[3] = f"{t[3][0:2]}.{t[3][2:]}"
|
|
||||||
if len(t[3]) > 4:
|
|
||||||
t[3] = f"{t[3][:5]}.{t[3][5:]}"
|
|
||||||
`|${4:PLZ}|${5}`!p snip.rv= complete(t[5], ['Offenbach', 'Hanau', 'Mühlheim', 'Frankfurt'])`|${6:Adresse}|${7:Nachname}`!p t[7] = t[7].upper()`, ${8:Vorname}
|
|
||||||
|
|
||||||
endsnippet
|
|
||||||
|
|||||||
@@ -73,3 +73,7 @@ endsnippet
|
|||||||
snippet regflit "reg_idx from literal" iA
|
snippet regflit "reg_idx from literal" iA
|
||||||
std_logic_vector(to_unsigned('${1:Literal}', reg_adr_size));
|
std_logic_vector(to_unsigned('${1:Literal}', reg_adr_size));
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet fillvec "Stdout to fill a vector" A
|
||||||
|
(others => '0')
|
||||||
|
endsnippet
|
||||||
|
|||||||
5
UltiSnips/xml.snippets
Normal file
5
UltiSnips/xml.snippets
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
snippet tg "automated tag insertion" b
|
||||||
|
<${1:tag}>
|
||||||
|
$2
|
||||||
|
</${1/(\w+).*/$1/}>$0
|
||||||
|
endsnippet
|
||||||
7
init.lua
7
init.lua
@@ -1,7 +1,8 @@
|
|||||||
-- Basic setup configuration
|
-- Basic setup configuration
|
||||||
vim.cmd("source ~/.config/nvim/viml/vanilla.vim")
|
|
||||||
require("vanilla")
|
require("vanilla")
|
||||||
|
|
||||||
|
vim.cmd("source ~/.config/nvim/viml/automacro.vim")
|
||||||
|
|
||||||
-- Lazy plugin setup
|
-- Lazy plugin setup
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
@@ -21,7 +22,3 @@ require("lazy").setup("plugins")
|
|||||||
require("plugconfig")
|
require("plugconfig")
|
||||||
|
|
||||||
require("confformat")
|
require("confformat")
|
||||||
|
|
||||||
vim.cmd("source ~/.config/nvim/viml/plugconfig.vim")
|
|
||||||
|
|
||||||
local plugtestbench = require("plugbench")
|
|
||||||
|
|||||||
51
lazy-lock.json
Normal file
51
lazy-lock.json
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"UltiSnips": { "branch": "master", "commit": "49dc8cb2086db19d385791c8e1635723b0fd95c7" },
|
||||||
|
"barbar.nvim": { "branch": "master", "commit": "3c48b5edf61dda21ad41c514e53448fee366a824" },
|
||||||
|
"bufstop": { "branch": "master", "commit": "274fc0e9fd6e8de860c427860c1e9970df142df5" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
||||||
|
"cmp-cmdline-history": { "branch": "master", "commit": "003573b72d4635ce636234a826fa8c4ba2895ffe" },
|
||||||
|
"cmp-fuzzy-buffer": { "branch": "main", "commit": "ada6352bc7e3c32471ab6c08f954001870329de1" },
|
||||||
|
"cmp-git": { "branch": "main", "commit": "8d8993680d627c8f13bd85094eba84604107dbdd" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||||
|
"cmp-nvim-ultisnips": { "branch": "main", "commit": "24bca5c3e137b28cd87442d4fc51a2b312dd99cc" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" },
|
||||||
|
"cyberspace.vim": { "branch": "master", "commit": "8d002ef6a449f08025d75249078ecae75a136a2d" },
|
||||||
|
"formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" },
|
||||||
|
"fuzzy.nvim": { "branch": "master", "commit": "67a42ad2fa6d5ff41f0ef3cf69bb247410da5d7a" },
|
||||||
|
"git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
|
||||||
|
"lexima.vim": { "branch": "master", "commit": "5513d686801993b40c55baa65602f79cd3cf3c77" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "82c7cb08ddb836ad938b2708e50085f12a8825d2" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
|
||||||
|
"nerdtree": { "branch": "master", "commit": "f3a4d8eaa8ac10305e3d53851c976756ea9dc8e8" },
|
||||||
|
"nerdtree-git-plugin": { "branch": "master", "commit": "e1fe727127a813095854a5b063c15e955a77eafb" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||||
|
"nvim-cmp-lua-latex-symbols": { "branch": "master", "commit": "89345d6e333c700d13748e8a7ee6fe57279b7f88" },
|
||||||
|
"nvim-dap": { "branch": "master", "commit": "c1695e500c7d552a0a19953a9aefcc89178fb1af" },
|
||||||
|
"nvim-doxyscan": { "branch": "master", "commit": "2c266fdb9395d6afa5d7188f8212fd7757193990" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "8c1831817d40925d22cd8a555296c44c02fdaaf5" },
|
||||||
|
"nvim-sourcer": { "branch": "main", "commit": "a2f6bc737a63a208d39fcc5c211076ea5aa9f390" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "2014f8285e306f4c8a896c7d3af53fdd599e5a4f" },
|
||||||
|
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||||
|
"telescope-ultisnips.nvim": { "branch": "main", "commit": "d1cca4b5aa809a90b7a8caddeb860329d5a8c2ff" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "c025baf23b62f044eff1f4ef561c45de636f0e32" },
|
||||||
|
"vim-airline": { "branch": "master", "commit": "d9f42cb46710e31962a9609939ddfeb0685dd779" },
|
||||||
|
"vim-airline-themes": { "branch": "master", "commit": "a9aa25ce323b2dd04a52706f4d1b044f4feb7617" },
|
||||||
|
"vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
|
||||||
|
"vim-monokai-tasty": { "branch": "master", "commit": "57c67feac63158a232c43aee2f463a994029b699" },
|
||||||
|
"vim-speeddating": { "branch": "master", "commit": "5a36fd29df63ea3f65562bd2bb837be48a5ec90b" },
|
||||||
|
"vim-startify": { "branch": "master", "commit": "4e089dffdad46f3f5593f34362d530e8fe823dcf" },
|
||||||
|
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
|
||||||
|
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||||
|
"vim-visual-multi": { "branch": "master", "commit": "fe1ec7e430013b83c8c2dee85ae496251b71e253" }
|
||||||
|
}
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Arch Linux) (format=lualatex 2023.7.21) 16 AUG 2023 18:24
|
|
||||||
restricted system commands enabled.
|
|
||||||
**viml/legacyconf.vim
|
|
||||||
(./viml/legacyconf.vim
|
|
||||||
LaTeX2e <2022-11-01> patch level 1
|
|
||||||
Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support
|
|
||||||
Lua module: lualibs 2022-10-04 2.75 ConTeXt Lua standard libraries.
|
|
||||||
Lua module: lualibs-extended 2022-10-04 2.75 ConTeXt Lua libraries -- extended c
|
|
||||||
ollection.
|
|
||||||
luaotfload | conf : Root cache directory is "/home/nick/.texlive/texmf-var/luate
|
|
||||||
x-cache/generic/names".
|
|
||||||
luaotfload | init : Loading fontloader "fontloader-2022-10-03.lua" from kpse-res
|
|
||||||
olved path "/usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-2022-10-03.lu
|
|
||||||
a".
|
|
||||||
Lua-only attribute luaotfload@noligature = 1
|
|
||||||
luaotfload | init : Context OpenType loader version 3.120
|
|
||||||
Inserting `luaotfload.node_processor' in `pre_linebreak_filter'.
|
|
||||||
Inserting `luaotfload.node_processor' in `hpack_filter'.
|
|
||||||
Inserting `luaotfload.glyph_stream' in `glyph_stream_provider'.
|
|
||||||
Inserting `luaotfload.define_font' in `define_font'.
|
|
||||||
Lua-only attribute luaotfload_color_attribute = 2
|
|
||||||
luaotfload | conf : Root cache directory is "/home/nick/.texlive/texmf-var/luate
|
|
||||||
x-cache/generic/names".
|
|
||||||
Inserting `luaotfload.harf.strip_prefix' in `find_opentype_file'.
|
|
||||||
Inserting `luaotfload.harf.strip_prefix' in `find_truetype_file'.
|
|
||||||
Removing `luaotfload.glyph_stream' from `glyph_stream_provider'.
|
|
||||||
Inserting `luaotfload.harf.glyphstream' in `glyph_stream_provider'.
|
|
||||||
Inserting `luaotfload.harf.finalize_vlist' in `post_linebreak_filter'.
|
|
||||||
Inserting `luaotfload.harf.finalize_hlist' in `hpack_filter'.
|
|
||||||
Inserting `luaotfload.cleanup_files' in `wrapup_run'.
|
|
||||||
Inserting `luaotfload.harf.finalize_unicode' in `finish_pdffile'.
|
|
||||||
Inserting `luaotfload.glyphinfo' in `glyph_info'.
|
|
||||||
Lua-only attribute luaotfload.letterspace_done = 3
|
|
||||||
Inserting `luaotfload.aux.set_sscale_dimens' in `luaotfload.patch_font'.
|
|
||||||
Inserting `luaotfload.aux.set_font_index' in `luaotfload.patch_font'.
|
|
||||||
Inserting `luaotfload.aux.patch_cambria_domh' in `luaotfload.patch_font'.
|
|
||||||
Inserting `luaotfload.aux.fixup_fontdata' in `luaotfload.patch_font_unsafe'.
|
|
||||||
Inserting `luaotfload.aux.set_capheight' in `luaotfload.patch_font'.
|
|
||||||
Inserting `luaotfload.aux.set_xheight' in `luaotfload.patch_font'.
|
|
||||||
Inserting `luaotfload.rewrite_fontname' in `luaotfload.patch_font'. L3 programm
|
|
||||||
ing layer <2023-02-22>
|
|
||||||
Inserting `tracingstacklevels' in `input_level_string'.
|
|
||||||
|
|
||||||
! LaTeX Error: Missing \begin{document}.
|
|
||||||
|
|
||||||
See the LaTeX manual or LaTeX Companion for explanation.
|
|
||||||
Type H <return> for immediate help.
|
|
||||||
...
|
|
||||||
|
|
||||||
l.1 "
|
|
||||||
NERDTree remap
|
|
||||||
?
|
|
||||||
! Emergency stop.
|
|
||||||
...
|
|
||||||
|
|
||||||
l.1 "
|
|
||||||
NERDTree remap
|
|
||||||
You're in trouble here. Try typing <return> to proceed.
|
|
||||||
If that doesn't work, type X <return> to quit.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Here is how much of LuaTeX's memory you used:
|
|
||||||
21 strings out of 478285
|
|
||||||
100000,1977958 words of node,token memory allocated 333 words of node memory still in use:
|
|
||||||
2 hlist, 1 local_par, 1 dir, 1 glue, 3 kern, 1 glyph, 3 attribute, 39 glue_sp
|
|
||||||
ec, 3 attribute_list, 1 temp nodes
|
|
||||||
avail lists: 2:5,3:3,4:1,5:1,7:1
|
|
||||||
20343 multiletter control sequences out of 65536+600000
|
|
||||||
14 fonts using 591679 bytes
|
|
||||||
13i,0n,12p,58b,15s stack positions out of 10000i,1000n,20000p,200000b,200000s
|
|
||||||
! ==> Fatal error occurred, no output PDF file produced!
|
|
||||||
@@ -16,10 +16,15 @@ cmp.setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Add borders to the windows
|
-- Add borders to the windows
|
||||||
-- window = {
|
window = {
|
||||||
-- completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
-- documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
-- },
|
},
|
||||||
|
|
||||||
|
-- experimental settings
|
||||||
|
experimental = {
|
||||||
|
ghost_text = {},
|
||||||
|
},
|
||||||
|
|
||||||
-- mapping
|
-- mapping
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
@@ -49,12 +54,12 @@ cmp.setup({
|
|||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "nvim_lsp", keyword_length = 2 },
|
{ name = "nvim_lsp", keyword_length = 2 },
|
||||||
{ name = "nvim_lsp_signature_help" },
|
{ name = "nvim_lsp_signature_help" },
|
||||||
{ name = "nvim_lua", keyword_length = 4 },
|
{ name = "nvim_lua", keyword_length = 2 },
|
||||||
{ name = "buffer", keyword_length = 3 },
|
{ name = "buffer", keyword_length = 2 },
|
||||||
{ name = "calc" },
|
{ name = "calc" },
|
||||||
{ name = "lua-latex-symbols", option = { cache = true } },
|
{ name = "lua-latex-symbols", option = { cache = true } },
|
||||||
-- { name = "spell", option = { keep_all_entries = false }, keyword_length = 2 },
|
{ name = "cmp_tabnine", keyword_length = 20 },
|
||||||
-- { name = "fuzzy_buffer", keyword_length = 2 }, -- Throwing unknown errors
|
-- { name = "fuzzy_buffer", keyword_length = 4 },
|
||||||
}),
|
}),
|
||||||
|
|
||||||
-- add formatting of the different sources
|
-- add formatting of the different sources
|
||||||
@@ -62,14 +67,15 @@ cmp.setup({
|
|||||||
fields = { "menu", "abbr", "kind" },
|
fields = { "menu", "abbr", "kind" },
|
||||||
format = function(entry, item)
|
format = function(entry, item)
|
||||||
local menu_icon = {
|
local menu_icon = {
|
||||||
|
ultisnips = "Φ",
|
||||||
nvim_lsp = "λ",
|
nvim_lsp = "λ",
|
||||||
ultisnips = "⋗",
|
path = "",
|
||||||
path = "🌐",
|
|
||||||
calc = "Σ",
|
calc = "Σ",
|
||||||
buffer = "📚",
|
buffer = "",
|
||||||
lualatexsymbols = "𝕋",
|
lualatexsymbols = "",
|
||||||
spell = "📚",
|
spell = "",
|
||||||
fuzzy_buffer = "📄",
|
fuzzy_buffer = "",
|
||||||
|
cmp_tabnine = "🖳",
|
||||||
}
|
}
|
||||||
item.menu = menu_icon[entry.source.name]
|
item.menu = menu_icon[entry.source.name]
|
||||||
return item
|
return item
|
||||||
@@ -77,20 +83,23 @@ cmp.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Set configuration for specific filetype.
|
|
||||||
cmp.setup.filetype("gitcommit", {
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
cmp.setup.cmdline({ "/", "?" }, {
|
cmp.setup.cmdline({ "/", "?" }, {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
|
{ name = "fuzzy_path", keyword_length = 4 },
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { "menu", "abbr", "kind" },
|
||||||
|
format = function(entry, item)
|
||||||
|
local menu_icon = {
|
||||||
|
buffer = "",
|
||||||
|
fuzzy_path = "",
|
||||||
|
}
|
||||||
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
return item
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -99,8 +108,20 @@ cmp.setup.cmdline(":", {
|
|||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "cmdline_history", keyword_length = 15 },
|
{ name = "cmdline_history", keyword_length = 24 },
|
||||||
}, {
|
}, {
|
||||||
{ name = "cmdline" },
|
{ name = "cmdline", keyword_length = 1 },
|
||||||
}),
|
}),
|
||||||
|
formatting = {
|
||||||
|
fields = { "menu", "abbr", "kind" },
|
||||||
|
format = function(entry, item)
|
||||||
|
local menu_icon = {
|
||||||
|
path = "",
|
||||||
|
cmdline = "",
|
||||||
|
cmdline_history = " ",
|
||||||
|
}
|
||||||
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
return item
|
||||||
|
end,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
-- default config:
|
|
||||||
require("peek").setup({
|
|
||||||
auto_load = true, -- whether to automatically load preview when
|
|
||||||
-- entering another markdown buffer
|
|
||||||
close_on_bdelete = true, -- close preview window on buffer delete
|
|
||||||
|
|
||||||
syntax = true, -- enable syntax highlighting, affects performance
|
|
||||||
|
|
||||||
theme = "dark", -- 'dark' or 'light'
|
|
||||||
|
|
||||||
update_on_change = true,
|
|
||||||
|
|
||||||
app = "webview", -- 'webview', 'browser', string or a table of strings
|
|
||||||
-- explained below
|
|
||||||
|
|
||||||
filetype = { "markdown" }, -- list of filetypes to recognize as markdown
|
|
||||||
|
|
||||||
-- relevant if update_on_change is true
|
|
||||||
throttle_at = 200000, -- start throttling when file exceeds this
|
|
||||||
-- amount of bytes in size
|
|
||||||
throttle_time = "auto", -- minimum amount of time in milliseconds
|
|
||||||
-- that has to pass before starting new render
|
|
||||||
})
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
-- Delete area in between the current and next occurrence of the current symbol under cursor.
|
|
||||||
-- use builtin functionality for opening brackets
|
|
||||||
function M.Delete_interval()
|
|
||||||
-- TODO: Think of something
|
|
||||||
end
|
|
||||||
|
|
||||||
-- resize current window using control + 7,8,9,0
|
|
||||||
function M.Resize_Current_Window(change_width, change_height)
|
|
||||||
local width = vim.api.nvim_win_get_width(0)
|
|
||||||
local height = vim.api.nvim_win_get_height(0)
|
|
||||||
|
|
||||||
if width + change_width > 5 then
|
|
||||||
vim.api.nvim_win_set_width(0, width + change_width)
|
|
||||||
end
|
|
||||||
|
|
||||||
if height + change_height > 5 then
|
|
||||||
vim.api.nvim_win_set_height(0, height + change_height)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Keybindings
|
|
||||||
-- 7/8 change width
|
|
||||||
-- 9/0 change height
|
|
||||||
--vim.keymap.set("n", "<C-7>", Resize_Current_Window(-1, 0))
|
|
||||||
--vim.keymap.set("n", "<C-8>", Resize_Current_Window(1, 0))
|
|
||||||
--vim.keymap.set("n", "<C-9>", Resize_Current_Window(0, -1))
|
|
||||||
--vim.keymap.set("n", "<C-0>", Resize_Current_Window(0, 1))
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
|
if vim == nil then
|
||||||
|
vim = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Update function and call
|
||||||
|
function Update_Sys()
|
||||||
|
vim.cmd("Lazy sync")
|
||||||
|
vim.cmd("TSUpdate")
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<M-u>", ":lua Update_Sys()<CR>")
|
||||||
|
|
||||||
|
-- Bufstop
|
||||||
|
vim.keymap.set("n", "<M-w>", ":bdelete<CR>")
|
||||||
|
vim.keymap.set("n", "<C-y>", ":BufstopFast<CR>")
|
||||||
|
|
||||||
-- UltiSnips Configuration
|
-- UltiSnips Configuration
|
||||||
vim.g.UltiSnipsExpandTrigger = "<tab>"
|
vim.g.UltiSnipsExpandTrigger = "<tab>"
|
||||||
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
|
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
|
||||||
@@ -7,6 +23,7 @@ vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }
|
|||||||
|
|
||||||
-- NERDTree Config
|
-- NERDTree Config
|
||||||
vim.g.NERDTreeShowHidden = 1
|
vim.g.NERDTreeShowHidden = 1
|
||||||
|
vim.keymap.set("n", "<C-e>", ":NERDTreeToggle<CR>")
|
||||||
|
|
||||||
-- Lexima
|
-- Lexima
|
||||||
vim.g.lexima_enable_basic_rules = 1
|
vim.g.lexima_enable_basic_rules = 1
|
||||||
@@ -24,17 +41,10 @@ vim.keymap.set("n", "<leader>fc", builtin.commands, {})
|
|||||||
require("telescope").load_extension("ultisnips")
|
require("telescope").load_extension("ultisnips")
|
||||||
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
|
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
|
||||||
|
|
||||||
-- NERDTree Config
|
|
||||||
vim.g.NERDTreeDirArrowExpandable = "▸"
|
|
||||||
vim.g.NERDTreeDirArrowCollapsible = "▾"
|
|
||||||
|
|
||||||
-- Git-Blame configuration
|
-- Git-Blame configuration
|
||||||
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
|
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
|
||||||
vim.g.gitblame_date_format = "%r"
|
vim.g.gitblame_date_format = "%r"
|
||||||
|
|
||||||
-- Intendation basics
|
|
||||||
require("ibl").setup()
|
|
||||||
|
|
||||||
-- Code completion
|
-- Code completion
|
||||||
require("code-completion")
|
require("code-completion")
|
||||||
|
|
||||||
@@ -43,7 +53,7 @@ require("mason").setup(require("mason").setup({
|
|||||||
ui = {
|
ui = {
|
||||||
icons = {
|
icons = {
|
||||||
package_installed = "✓",
|
package_installed = "✓",
|
||||||
package_pending = "➜",
|
package_pending = "",
|
||||||
package_uninstalled = "✗",
|
package_uninstalled = "✗",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -51,19 +61,67 @@ require("mason").setup(require("mason").setup({
|
|||||||
|
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
|
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
|
||||||
|
ensure_installed = { "clangd" },
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason-lspconfig").setup_handlers({
|
require("mason-lspconfig").setup_handlers({
|
||||||
function(clangd)
|
function(clangd)
|
||||||
require("lspconfig")[clangd].setup({})
|
require("lspconfig")[clangd].setup({})
|
||||||
end,
|
end,
|
||||||
["als"] = function()
|
|
||||||
require("lspconfig").als.setup({
|
|
||||||
settings = {
|
|
||||||
ada = {
|
|
||||||
projectFile = "default.gpr",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require("lspconfig").verible.setup({
|
||||||
|
cmd = { "verible-verilog-ls", "--rules_config_search" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Floating terminal
|
||||||
|
vim.keymap.set("n", "<C-t>", ":FloatermNew --height=0.9 --width=0.9 --wintype=float --name=terminal <CR>")
|
||||||
|
|
||||||
|
-- Set default colorscheme
|
||||||
|
vim.cmd("colo tokyonight-night")
|
||||||
|
|
||||||
|
-- Formatter configuration
|
||||||
|
vim.cmd([[
|
||||||
|
augroup FormatAutogroup
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePost * FormatWrite
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
autocmd BufWritePost *.v lua vim.lsp.buf.format({ async = false })
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- Ale configuration
|
||||||
|
vim.g.ale_linters_explicit = 0
|
||||||
|
local linters = {
|
||||||
|
python = { "pylint" },
|
||||||
|
vim = { "vint" },
|
||||||
|
cpp = { "clang" },
|
||||||
|
c = { "clang" },
|
||||||
|
markdown = { "languagetool" },
|
||||||
|
latex = { "proselint" },
|
||||||
|
tex = { "proselint" },
|
||||||
|
plaintex = { "proselint" },
|
||||||
|
ada = { "gnat", "gcc", "cspell" },
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.g.ale_linters = linters
|
||||||
|
vim.g.ale_fix_on_save = 1
|
||||||
|
-- vim.g.ale_ada_gpr_project_file = "default.gpr"
|
||||||
|
vim.g.ale_fixers = {
|
||||||
|
ada = { "gnatpp" },
|
||||||
|
asm = { "gcc" },
|
||||||
|
bash = { "bashate" },
|
||||||
|
c = { "astyle" },
|
||||||
|
latex = { "texlab", "textlint" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
markdown = { "prettier", "pandoc" },
|
||||||
|
python = { "yapf" },
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>lf", ":ALEFix<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>ld", ":ALEDetail<CR>")
|
||||||
|
|
||||||
|
-- Tagbar
|
||||||
|
vim.keymap.set("n", "<F8>", ":TagbarToggle<CR>") -- permanent window
|
||||||
|
vim.keymap.set("n", "<C-j>", ":TagbarOpenAutoClose<CR>") -- select, jump, close
|
||||||
|
vim.g.tagbar_autoclose = 0 -- do not autoclose after selection
|
||||||
|
|||||||
@@ -1,10 +1,37 @@
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
|
-- Behavior
|
||||||
|
"tpope/vim-surround",
|
||||||
|
"tpope/vim-speeddating",
|
||||||
|
"mg979/vim-visual-multi",
|
||||||
|
"SirVer/UltiSnips",
|
||||||
|
"cohama/lexima.vim",
|
||||||
|
"voldikss/vim-floaterm",
|
||||||
|
"https://git.nickr.eu/yannickreiss/nvim-sourcer.git",
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
"preservim/nerdtree",
|
"preservim/nerdtree",
|
||||||
"Xuyuanp/nerdtree-git-plugin",
|
"Xuyuanp/nerdtree-git-plugin",
|
||||||
"SirVer/UltiSnips",
|
"yannickreiss/nvim-doxyscan",
|
||||||
"tpope/vim-surround",
|
"mihaifm/bufstop",
|
||||||
|
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
||||||
|
{ "tzachar/fuzzy.nvim", requires = { "nvim-telescope/telescope-fzf-native.nvim" } },
|
||||||
|
"fhill2/telescope-ultisnips.nvim",
|
||||||
|
"preservim/tagbar",
|
||||||
|
|
||||||
|
-- Visuals
|
||||||
"vim-airline/vim-airline",
|
"vim-airline/vim-airline",
|
||||||
"vim-airline/vim-airline-themes",
|
"vim-airline/vim-airline-themes",
|
||||||
|
"ryanoasis/vim-devicons",
|
||||||
|
"tiagofumo/vim-nerdtree-syntax-highlight",
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.1.5",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
|
||||||
|
"mhinz/vim-startify",
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
@@ -19,26 +46,18 @@ return {
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
"f-person/git-blame.nvim",
|
|
||||||
"p00f/nvim-ts-rainbow",
|
"p00f/nvim-ts-rainbow",
|
||||||
"cohama/lexima.vim",
|
"dense-analysis/ale",
|
||||||
"ryanoasis/vim-devicons",
|
"f-person/git-blame.nvim",
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
tag = "0.1.5",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
},
|
|
||||||
"fhill2/telescope-ultisnips.nvim",
|
|
||||||
"hiroakis/cyberspace.vim",
|
|
||||||
"tpope/vim-speeddating",
|
|
||||||
"yannickreiss/nvim-doxyscan",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
|
|
||||||
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
|
|
||||||
"dstein64/vim-startuptime",
|
"dstein64/vim-startuptime",
|
||||||
"mhinz/vim-startify",
|
|
||||||
|
-- Themes
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
"patstockwell/vim-monokai-tasty",
|
"patstockwell/vim-monokai-tasty",
|
||||||
|
"hiroakis/cyberspace.vim",
|
||||||
|
"jaredgorski/spacecamp",
|
||||||
|
|
||||||
|
-- Code completion / Menu
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-nvim-lua",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
@@ -50,17 +69,14 @@ return {
|
|||||||
"dmitmel/cmp-cmdline-history",
|
"dmitmel/cmp-cmdline-history",
|
||||||
"amarakon/nvim-cmp-lua-latex-symbols",
|
"amarakon/nvim-cmp-lua-latex-symbols",
|
||||||
"f3fora/cmp-spell",
|
"f3fora/cmp-spell",
|
||||||
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" },
|
{ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },
|
||||||
|
"quangnguyen30192/cmp-nvim-ultisnips",
|
||||||
|
|
||||||
|
-- LSP / Formatter
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
"mg979/vim-visual-multi",
|
{ "TamaMcGlinn/nvim-lspconfig-ada" },
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
|
||||||
{ "tzachar/fuzzy.nvim", requires = { "nvim-telescope/telescope-fzf-native.nvim" } },
|
|
||||||
{ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },
|
|
||||||
"quangnguyen30192/cmp-nvim-ultisnips",
|
|
||||||
"mihaifm/bufstop",
|
|
||||||
"https://git.nickr.eu/yannickreiss/nvim-sourcer.git",
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
-- in tools.lua
|
-- in tools.lua
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
|
|
||||||
local M = {};
|
local M = {}
|
||||||
|
|
||||||
function M.makeScratch()
|
function M.makeScratch()
|
||||||
vim.bo[0].buftype=nofile -- set the current buffer's (buffer 0) buftype to nofile
|
vim.bo[0].buftype = nofile -- set the current buffer's (buffer 0) buftype to nofile
|
||||||
vim.bo[0].bufhidden=hide
|
vim.bo[0].bufhidden = hide
|
||||||
vim.bo[0].swapfile=false
|
vim.bo[0].swapfile = false
|
||||||
end;
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
||||||
return M;
|
|
||||||
|
|||||||
@@ -1,15 +1,46 @@
|
|||||||
|
-- Filetypes and compatibility
|
||||||
|
vim.opt.compatible = false
|
||||||
|
vim.cmd("filetype on")
|
||||||
|
vim.cmd("filetype plugin on")
|
||||||
|
vim.cmd("syntax on")
|
||||||
|
|
||||||
|
-- Spell
|
||||||
|
vim.opt.spell = true
|
||||||
|
vim.opt.spl = "en_us,de_de"
|
||||||
|
vim.opt.sps = "fast,timeout:100"
|
||||||
|
|
||||||
|
-- Editor configuration
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.opt.showmatch = true
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.g.mapleader = ","
|
||||||
|
vim.cmd("set clipboard+=unnamedplus")
|
||||||
|
vim.cmd("autocmd! CursorHold,CursorHoldI *.md write")
|
||||||
|
|
||||||
|
-- GUI
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
vim.opt.hlsearch = true
|
vim.opt.hlsearch = true
|
||||||
vim.opt.encoding = "UTF-8"
|
vim.opt.encoding = "UTF-8"
|
||||||
vim.g.tex_flavor = "latex"
|
vim.g.tex_flavor = "latex"
|
||||||
vim.opt.conceallevel = 2
|
vim.opt.conceallevel = 2
|
||||||
vim.opt.guifont = "DroidSansMono Nerd Font 11"
|
vim.opt.showmatch = true
|
||||||
vim.g.mapleader = ","
|
vim.o.guifont = "Source Code Pro:h13"
|
||||||
|
|
||||||
-- set color scheme
|
-- set color scheme
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
vim.cmd("colorscheme slate")
|
||||||
|
vim.keymap.set("n", "<M-+>", ":colo tokyonight-day<CR>")
|
||||||
|
vim.keymap.set("n", "<M-->", ":colo tokyonight-night<CR>")
|
||||||
|
|
||||||
|
vim.opt.mouse = ""
|
||||||
|
|
||||||
|
-- set copy mode
|
||||||
|
vim.keymap.set("n", "<leader>ll", ":set nonumber<cr>")
|
||||||
|
vim.keymap.set("n", "<leader>lm", ":set number<cr>")
|
||||||
|
|
||||||
|
-- switch mode
|
||||||
|
vim.keymap.set("n", "<leader>na", ":set norelativenumber<cr>")
|
||||||
|
vim.keymap.set("n", "<leader>nr", ":set relativenumber<cr>")
|
||||||
|
|||||||
@@ -1,177 +0,0 @@
|
|||||||
import os
|
|
||||||
import os.path
|
|
||||||
import fnmatch
|
|
||||||
import logging
|
|
||||||
import ycm_core
|
|
||||||
import re
|
|
||||||
|
|
||||||
BASE_FLAGS = [
|
|
||||||
'-Wall',
|
|
||||||
'-Wextra',
|
|
||||||
'-Werror',
|
|
||||||
'-Wno-long-long',
|
|
||||||
'-Wno-variadic-macros',
|
|
||||||
'-fexceptions',
|
|
||||||
'-ferror-limit=10000',
|
|
||||||
'-DNDEBUG',
|
|
||||||
'-std=c++11',
|
|
||||||
'-xc++',
|
|
||||||
'-I/usr/lib/',
|
|
||||||
'-I/usr/include/'
|
|
||||||
]
|
|
||||||
|
|
||||||
SOURCE_EXTENSIONS = [
|
|
||||||
'.cpp',
|
|
||||||
'.cxx',
|
|
||||||
'.cc',
|
|
||||||
'.c',
|
|
||||||
'.m',
|
|
||||||
'.mm'
|
|
||||||
]
|
|
||||||
|
|
||||||
SOURCE_DIRECTORIES = [
|
|
||||||
'src',
|
|
||||||
'lib'
|
|
||||||
]
|
|
||||||
|
|
||||||
HEADER_EXTENSIONS = [
|
|
||||||
'.h',
|
|
||||||
'.hxx',
|
|
||||||
'.hpp',
|
|
||||||
'.hh'
|
|
||||||
]
|
|
||||||
|
|
||||||
HEADER_DIRECTORIES = [
|
|
||||||
'include'
|
|
||||||
]
|
|
||||||
|
|
||||||
def IsHeaderFile(filename):
|
|
||||||
extension = os.path.splitext(filename)[1]
|
|
||||||
return extension in HEADER_EXTENSIONS
|
|
||||||
|
|
||||||
def GetCompilationInfoForFile(database, filename):
|
|
||||||
if IsHeaderFile(filename):
|
|
||||||
basename = os.path.splitext(filename)[0]
|
|
||||||
for extension in SOURCE_EXTENSIONS:
|
|
||||||
# Get info from the source files by replacing the extension.
|
|
||||||
replacement_file = basename + extension
|
|
||||||
if os.path.exists(replacement_file):
|
|
||||||
compilation_info = database.GetCompilationInfoForFile(replacement_file)
|
|
||||||
if compilation_info.compiler_flags_:
|
|
||||||
return compilation_info
|
|
||||||
# If that wasn't successful, try replacing possible header directory with possible source directories.
|
|
||||||
for header_dir in HEADER_DIRECTORIES:
|
|
||||||
for source_dir in SOURCE_DIRECTORIES:
|
|
||||||
src_file = replacement_file.replace(header_dir, source_dir)
|
|
||||||
if os.path.exists(src_file):
|
|
||||||
compilation_info = database.GetCompilationInfoForFile(src_file)
|
|
||||||
if compilation_info.compiler_flags_:
|
|
||||||
return compilation_info
|
|
||||||
return None
|
|
||||||
return database.GetCompilationInfoForFile(filename)
|
|
||||||
|
|
||||||
def FindNearest(path, target, build_folder):
|
|
||||||
candidate = os.path.join(path, target)
|
|
||||||
if(os.path.isfile(candidate) or os.path.isdir(candidate)):
|
|
||||||
logging.info("Found nearest " + target + " at " + candidate)
|
|
||||||
return candidate;
|
|
||||||
|
|
||||||
parent = os.path.dirname(os.path.abspath(path));
|
|
||||||
if(parent == path):
|
|
||||||
raise RuntimeError("Could not find " + target);
|
|
||||||
|
|
||||||
if(build_folder):
|
|
||||||
candidate = os.path.join(parent, build_folder, target)
|
|
||||||
if(os.path.isfile(candidate) or os.path.isdir(candidate)):
|
|
||||||
logging.info("Found nearest " + target + " in build folder at " + candidate)
|
|
||||||
return candidate;
|
|
||||||
|
|
||||||
return FindNearest(parent, target, build_folder)
|
|
||||||
|
|
||||||
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
|
||||||
if not working_directory:
|
|
||||||
return list(flags)
|
|
||||||
new_flags = []
|
|
||||||
make_next_absolute = False
|
|
||||||
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
|
|
||||||
for flag in flags:
|
|
||||||
new_flag = flag
|
|
||||||
|
|
||||||
if make_next_absolute:
|
|
||||||
make_next_absolute = False
|
|
||||||
if not flag.startswith('/'):
|
|
||||||
new_flag = os.path.join(working_directory, flag)
|
|
||||||
|
|
||||||
for path_flag in path_flags:
|
|
||||||
if flag == path_flag:
|
|
||||||
make_next_absolute = True
|
|
||||||
break
|
|
||||||
|
|
||||||
if flag.startswith(path_flag):
|
|
||||||
path = flag[ len(path_flag): ]
|
|
||||||
new_flag = path_flag + os.path.join(working_directory, path)
|
|
||||||
break
|
|
||||||
|
|
||||||
if new_flag:
|
|
||||||
new_flags.append(new_flag)
|
|
||||||
return new_flags
|
|
||||||
|
|
||||||
|
|
||||||
def FlagsForClangComplete(root):
|
|
||||||
try:
|
|
||||||
clang_complete_path = FindNearest(root, '.clang_complete')
|
|
||||||
clang_complete_flags = open(clang_complete_path, 'r').read().splitlines()
|
|
||||||
return clang_complete_flags
|
|
||||||
except:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def FlagsForInclude(root):
|
|
||||||
try:
|
|
||||||
include_path = FindNearest(root, 'include')
|
|
||||||
flags = []
|
|
||||||
for dirroot, dirnames, filenames in os.walk(include_path):
|
|
||||||
for dir_path in dirnames:
|
|
||||||
real_path = os.path.join(dirroot, dir_path)
|
|
||||||
flags = flags + ["-I" + real_path]
|
|
||||||
return flags
|
|
||||||
except:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def FlagsForCompilationDatabase(root, filename):
|
|
||||||
try:
|
|
||||||
# Last argument of next function is the name of the build folder for
|
|
||||||
# out of source projects
|
|
||||||
compilation_db_path = FindNearest(root, 'compile_commands.json', 'build')
|
|
||||||
compilation_db_dir = os.path.dirname(compilation_db_path)
|
|
||||||
logging.info("Set compilation database directory to " + compilation_db_dir)
|
|
||||||
compilation_db = ycm_core.CompilationDatabase(compilation_db_dir)
|
|
||||||
if not compilation_db:
|
|
||||||
logging.info("Compilation database file found but unable to load")
|
|
||||||
return None
|
|
||||||
compilation_info = GetCompilationInfoForFile(compilation_db, filename)
|
|
||||||
if not compilation_info:
|
|
||||||
logging.info("No compilation info for " + filename + " in compilation database")
|
|
||||||
return None
|
|
||||||
return MakeRelativePathsInFlagsAbsolute(
|
|
||||||
compilation_info.compiler_flags_,
|
|
||||||
compilation_info.compiler_working_dir_)
|
|
||||||
except:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def FlagsForFile(filename):
|
|
||||||
root = os.path.realpath(filename);
|
|
||||||
compilation_db_flags = FlagsForCompilationDatabase(root, filename)
|
|
||||||
if compilation_db_flags:
|
|
||||||
final_flags = compilation_db_flags
|
|
||||||
else:
|
|
||||||
final_flags = BASE_FLAGS
|
|
||||||
clang_flags = FlagsForClangComplete(root)
|
|
||||||
if clang_flags:
|
|
||||||
final_flags = final_flags + clang_flags
|
|
||||||
include_flags = FlagsForInclude(root)
|
|
||||||
if include_flags:
|
|
||||||
final_flags = final_flags + include_flags
|
|
||||||
return {
|
|
||||||
'flags': final_flags,
|
|
||||||
'do_cache': True
|
|
||||||
}
|
|
||||||
@@ -351,3 +351,30 @@ Instagram
|
|||||||
Tablet
|
Tablet
|
||||||
Abschwington
|
Abschwington
|
||||||
BerndDasBot
|
BerndDasBot
|
||||||
|
Frameworks
|
||||||
|
Tuples
|
||||||
|
structs
|
||||||
|
make
|
||||||
|
IoT
|
||||||
|
json
|
||||||
|
Request
|
||||||
|
Dictionary
|
||||||
|
Everything
|
||||||
|
Disclaimer
|
||||||
|
linuxspezifischen
|
||||||
|
linuxspezifischen
|
||||||
|
cron
|
||||||
|
false
|
||||||
|
true
|
||||||
|
boolsche
|
||||||
|
bash
|
||||||
|
zsh
|
||||||
|
sockets
|
||||||
|
requests
|
||||||
|
otwendige
|
||||||
|
ptionale
|
||||||
|
utomatischer
|
||||||
|
anueller
|
||||||
|
nickr
|
||||||
|
eu
|
||||||
|
email
|
||||||
|
|||||||
Binary file not shown.
@@ -171,3 +171,5 @@ gcc
|
|||||||
linux
|
linux
|
||||||
chibicc
|
chibicc
|
||||||
chibi
|
chibi
|
||||||
|
readonly
|
||||||
|
extern
|
||||||
|
|||||||
Binary file not shown.
32
viml/automacro.vim
Normal file
32
viml/automacro.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" various tools inside vim
|
||||||
|
function! GetCharUnderCursor()
|
||||||
|
let line = getline('.')
|
||||||
|
let col = col('.')
|
||||||
|
return line[col - 1]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" predefined macros in functions
|
||||||
|
function SpacedLine()
|
||||||
|
normal o
|
||||||
|
normal O
|
||||||
|
normal O
|
||||||
|
normal j
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function SwapWords()
|
||||||
|
normal dw
|
||||||
|
normal e
|
||||||
|
exec 'normal! a '
|
||||||
|
normal p
|
||||||
|
normal l
|
||||||
|
let char = GetCharUnderCursor()
|
||||||
|
if char == ' '
|
||||||
|
normal x
|
||||||
|
endif
|
||||||
|
normal h
|
||||||
|
normal b
|
||||||
|
normal b
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let @o = ':call SpacedLine()
|
||||||
|
'
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
" NERDTree remap
|
|
||||||
let g:NERDTreeDirArrowExpandable = '▸'
|
|
||||||
let g:NERDTreeDirArrowCollapsible = '▾'
|
|
||||||
nmap <C-e> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" open builtin terminal
|
|
||||||
function OpenTerm()
|
|
||||||
vsplit
|
|
||||||
terminal
|
|
||||||
endfunction
|
|
||||||
nnoremap <C-t> :call OpenTerm()<CR>
|
|
||||||
|
|
||||||
" open new files right/below
|
|
||||||
set splitright
|
|
||||||
set splitbelow
|
|
||||||
|
|
||||||
set clipboard+=unnamedplus
|
|
||||||
|
|
||||||
" Autoformat on save
|
|
||||||
augroup FormatAutogroup
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePost * FormatWrite
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" set spellcheck according to Filetype
|
|
||||||
autocmd VimEnter * set spell spelllang=en_us
|
|
||||||
|
|
||||||
function Litde()
|
|
||||||
set spell spelllang=de_de
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function Liten()
|
|
||||||
set spell spelllang=en_us
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <M-e> :call Liten()<CR>
|
|
||||||
nnoremap <M-g> :call Litde()<CR>
|
|
||||||
|
|
||||||
" Theme
|
|
||||||
nnoremap <M-+> :colo github_light_high_contrast<CR>
|
|
||||||
nnoremap <M--> :colo default<CR>
|
|
||||||
|
|
||||||
" Fuzzy finder
|
|
||||||
nnoremap <C-f> :Lines<CR>
|
|
||||||
|
|
||||||
function RestoreSession()
|
|
||||||
if @% == ""
|
|
||||||
source ~/.config/nvim/lastSession.vim
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Git-Blame configuration
|
|
||||||
let g:gitblame_message_template = ' => <author> • <date> • <summary>'
|
|
||||||
let g:gitblame_date_format = '%r'
|
|
||||||
|
|
||||||
if executable('vhdl-tool')
|
|
||||||
au User lsp_setup call lsp#register_server({
|
|
||||||
\ 'name': 'vhdl-tool',
|
|
||||||
\ 'cmd': {server_info->['vhdl-tool', 'lsp']},
|
|
||||||
\ 'whitelist': ['vhdl'],
|
|
||||||
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'vhdltool-config.yaml'))},
|
|
||||||
\ })
|
|
||||||
endif
|
|
||||||
|
|
||||||
autocmd FileType vhdl setlocal omnifunc=lsp#complete
|
|
||||||
|
|
||||||
nnoremap <silent> <C-0> <Cmd>BufferNext<CR>
|
|
||||||
|
|
||||||
" update function and call
|
|
||||||
function Update_Sys()
|
|
||||||
PackerSync
|
|
||||||
TSUpdate
|
|
||||||
MasonUpdate
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <M-u> :call Update_Sys()<CR>
|
|
||||||
|
|
||||||
" Call build function
|
|
||||||
function! Build()
|
|
||||||
let l:filetype = &filetype
|
|
||||||
|
|
||||||
if l:filetype == 'c' || l:filetype == 'cpp' || l:filetype == 'h' || l:filetype == 'hpp'
|
|
||||||
execute 'make'
|
|
||||||
elseif l:filetype == 'py' || l:filetype == 'python'
|
|
||||||
execute '!python3 %'
|
|
||||||
elseif l:filetype == 'tex'
|
|
||||||
execute '!lualatex % < /dev/null'
|
|
||||||
elseif l:filetype == 'rs'
|
|
||||||
execute 'cargo run'
|
|
||||||
elseif l:filetype == 'S'
|
|
||||||
execute 'make'
|
|
||||||
elseif l:filetype == 'verilog'
|
|
||||||
execute 'verilator --binary %'
|
|
||||||
elseif l:filetype == 'rust'
|
|
||||||
execute 'cargo run'
|
|
||||||
else
|
|
||||||
echo "Unsupported file type: " . l:filetype
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <C-b> :call Build()<CR>
|
|
||||||
nnoremap <M-w> :bdelete<CR>
|
|
||||||
nnoremap <C-y> :b#<CR>
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
" NERDTree remap
|
|
||||||
nmap <C-e> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
" Autoformat on save
|
|
||||||
augroup FormatAutogroup
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePost * FormatWrite
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
nnoremap <silent> <C-0> <Cmd>BufferNext<CR>
|
|
||||||
|
|
||||||
" update function and call
|
|
||||||
function Update_Sys()
|
|
||||||
Lazy sync
|
|
||||||
TSUpdate
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <M-u> :call Update_Sys()<CR>
|
|
||||||
|
|
||||||
" Call build function
|
|
||||||
function! Build()
|
|
||||||
let l:filetype = &filetype
|
|
||||||
|
|
||||||
if l:filetype == 'c' || l:filetype == 'cpp' || l:filetype == 'h' || l:filetype == 'hpp'
|
|
||||||
execute '!make'
|
|
||||||
elseif l:filetype == 'py' || l:filetype == 'python'
|
|
||||||
execute '!python3 %'
|
|
||||||
elseif l:filetype == 'tex'
|
|
||||||
execute '!lualatex % < /dev/null'
|
|
||||||
elseif l:filetype == 'rs'
|
|
||||||
execute 'cargo run'
|
|
||||||
elseif l:filetype == 'S'
|
|
||||||
execute '!make'
|
|
||||||
elseif l:filetype == 'verilog'
|
|
||||||
execute '!verilator --binary %'
|
|
||||||
elseif l:filetype == 'rust'
|
|
||||||
execute '!cargo run'
|
|
||||||
elseif l:filetype == 'markdown'
|
|
||||||
execute '!okular %&'
|
|
||||||
else
|
|
||||||
echo "Unsupported file type: " . l:filetype
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <C-b> :call Build()<CR>
|
|
||||||
nnoremap <M-w> :bdelete<CR>
|
|
||||||
nnoremap <C-y> :BufstopFast<CR>
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
set nocompatible
|
|
||||||
filetype on
|
|
||||||
filetype plugin on
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
colorscheme vim-monokai-tasty
|
|
||||||
|
|
||||||
" open builtin terminal
|
|
||||||
function OpenTerm()
|
|
||||||
10 split
|
|
||||||
terminal
|
|
||||||
endfunction
|
|
||||||
nnoremap <C-t> :call OpenTerm()<CR>
|
|
||||||
|
|
||||||
set splitright
|
|
||||||
set splitbelow
|
|
||||||
|
|
||||||
set clipboard+=unnamedplus
|
|
||||||
|
|
||||||
" set spellcheck according to Filetype
|
|
||||||
autocmd VimEnter * set spell spelllang=en_us
|
|
||||||
|
|
||||||
function Litde()
|
|
||||||
set spell spelllang=de_de
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function Liten()
|
|
||||||
set spell spelllang=en_us
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <M-e> :call Liten()<CR>
|
|
||||||
nnoremap <M-g> :call Litde()<CR>
|
|
||||||
|
|
||||||
" Theme
|
|
||||||
nnoremap <M-+> :colo tokyonight-day<CR>
|
|
||||||
nnoremap <M--> :colo tokyonight-night<CR>
|
|
||||||
|
|
||||||
" Try transparent nvim
|
|
||||||
highlight Normal guibg=none
|
|
||||||
highlight NonText guibg=none
|
|
||||||
highlight Normal ctermbg=none
|
|
||||||
highlight NonText ctermbg=none
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user