85 Commits

Author SHA1 Message Date
3db17f9849 Update
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-07-31 08:57:16 +02:00
8564daf4b5 Create nix interpreter output
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-07-17 16:42:07 +02:00
f19f71c182 Markdown preview
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-07-15 16:17:23 +02:00
084fff8e1a Cyberdream
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-07-10 15:06:16 +02:00
82226b4f78 Add lean snippets and do Neovide
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-07-08 19:59:46 +02:00
c4c65c4e65 Merge branch 'master' of git.nickr.eu:yannickreiss/nvim
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-06-25 17:28:22 +02:00
8ecfde7ce1 Add spark wiki to config 2025-06-25 17:28:15 +02:00
Nick
437ce3ff2e Resolve merge conflicts
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-06-24 14:58:18 +02:00
Nick
4ad4a777f6 Add mail snippet to glob
ab
2025-06-24 14:56:19 +02:00
7daedc0b31 Ada proofs
Some checks are pending
Test Neovim config on push / build (ubuntu-20.04) (push) Waiting to run
2025-06-24 09:13:12 +02:00
5ee0540a2e Prove framework
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-06-15 14:53:46 +02:00
41ec16380b Add function to prove ada/Spark code
Some checks are pending
Test Neovim config on push / build (ubuntu-20.04) (push) Waiting to run
2025-06-14 23:23:28 +02:00
d79f1fd6d4 Ada mode update
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-06-11 14:43:13 +02:00
742e6f614a Remove unused features from config
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-05-22 08:44:07 +02:00
730ec3b4bd Change default from rel to abs number
Some checks are pending
Test Neovim config on push / build (ubuntu-20.04) (push) Waiting to run
2025-05-21 22:36:30 +02:00
1234f9bd4c Update
Some checks are pending
Test Neovim config on push / build (ubuntu-20.04) (push) Waiting to run
2025-05-21 18:48:17 +02:00
12a3293fff Remove lazy lock from repo
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 28s
2025-03-31 10:00:34 +02:00
e26dfea84f Add lazy lock to ignored files 2025-03-31 09:59:58 +02:00
2d0a74ed82 Change layout style of completion menu 2025-03-31 09:59:19 +02:00
8e09bfd6b7 Remove autoformat 2025-03-31 09:58:29 +02:00
9da04ad7e8 No ensure installed lsps
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 19s
2025-03-28 07:47:55 +01:00
c91101470c Change default colorscheme
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 27s
2025-03-27 11:33:35 +01:00
b11d36ba16 Snippets
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 26s
2025-03-25 08:52:24 +01:00
67eaafaee9 Add ignore
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 28s
2025-03-18 11:32:00 +01:00
a02cf6a902 Mail client
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 21s
2025-03-18 11:05:20 +01:00
ae06236c2c Add mail client to nvim
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
2025-03-18 11:01:38 +01:00
339d5b1197 add password file to gitignore
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Has been cancelled
2025-03-18 11:01:17 +01:00
06c098c194 Python updates
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 52s
2025-03-15 19:19:36 +01:00
886d434849 Adjust Ada snippets to styleguide
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 27s
2025-02-24 07:37:01 +01:00
cca29ca695 Spell
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 22s
2025-02-04 07:59:33 +01:00
f4909335c1 Set ada configuration file dynamically on startup
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 24s
2025-02-04 07:26:10 +01:00
c8be7d19a7 Change some defaults and the completion window looks
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s
2025-02-03 15:00:49 +01:00
443a0cb897 Spell check
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 21s
2025-02-01 07:17:01 +01:00
5b1d0d66de Add ada mode
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
2025-01-24 21:41:28 +01:00
59dc3784af Add screenkey mapping
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 29s
2024-12-27 16:09:30 +01:00
8cee1dc880 Ada mode
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m0s
2024-12-19 10:37:14 +01:00
af28c12ea7 Add screenkey
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m0s
2024-12-19 08:58:04 +01:00
4aa297662c Show key plugin
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 27s
2024-12-19 08:44:13 +01:00
fb0655896c Remove which-key, much to annoying 2024-12-18 12:22:11 +01:00
298e80f221 Add pascal snippets
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 25s
2024-12-18 09:29:02 +01:00
35da498b9b Add which key for testing 2024-12-18 09:28:38 +01:00
2836ff63e3 A very nice procedure snippet for pascal
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 52s
2024-12-12 09:47:32 +01:00
6e48879ffa Disable pascal formatter.
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 33s
2024-12-12 06:18:24 +01:00
e5aa6d7012 Update nvim
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 28s
2024-11-26 19:08:52 +01:00
d63a431242 Add high contrast theme
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m39s
2024-11-01 10:00:14 +01:00
deda105b50 Add VHDL formatter
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m41s
2024-10-09 10:00:30 +02:00
cfa581bf05 LSP configuration for LaTeX
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 41s
2024-10-09 09:08:49 +02:00
c0ad357563 Remove Ada language server
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 2m16s
2024-10-08 11:10:52 +02:00
3217a4456c Update Mason packages
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 2m39s
2024-10-08 11:01:27 +02:00
4357a36235 Autosetup lsp servers 2024-10-08 10:49:48 +02:00
01359aca3c Ensure installed packages
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 34s
2024-10-08 10:25:44 +02:00
2d7c2974ef Syntax feature upgrade for ada snippets
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 2m47s
2024-10-08 10:07:59 +02:00
02c752a943 Use fourmolu as Haskell formatter and fixer 2024-10-08 10:07:17 +02:00
8cb88ec054 Formatter update
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 29s
2024-10-07 08:19:18 +02:00
5f931de4cc Ada snippet update 2024-10-07 08:19:07 +02:00
af4b80906f Disable ada mode
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 2m8s
2024-10-07 07:55:16 +02:00
cc1a7c9311 Add ada formatting
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m24s
2024-10-07 07:46:40 +02:00
99e59d66e3 Add A,B:Type Syntax to Ultisnips function snippet 2024-10-07 07:46:25 +02:00
f9ae3dfe99 Format with 4 spaces of indentation
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 21s
2024-10-01 17:34:54 +02:00
c2705d1f1e Delete empty configuration file
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 35s
2024-10-01 17:27:14 +02:00
739d439946 Don't fix on save => not all fixed wanted 2024-10-01 17:26:46 +02:00
10ca92d206 Disable spell checking in pascal files
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 52s
2024-10-01 17:01:41 +02:00
561cdf5d2d Merge branch 'master' of git.nickr.eu:yannickreiss/nvim
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s
2024-09-24 05:41:49 +02:00
b8c5c86010 bypass reloading error when using pascal formatter 2024-09-24 05:41:41 +02:00
ad4c99c1f8 Autoreload is now up globally
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 27s
2024-09-23 15:34:07 +02:00
7452ee9b06 Add pascal mode formatter
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 28s
2024-09-23 15:23:56 +02:00
d2c68f99ab Add pascal mode 2024-09-23 15:23:44 +02:00
085ff836c3 PTOP configuration
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 22s
2024-09-23 15:10:59 +02:00
55e22fd3f7 Snippet updates
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s
2024-09-23 13:27:17 +02:00
963e7a1f97 Linterconfiguration 2024-09-23 13:27:06 +02:00
10c2b99fb8 Remove Doxyscan, tagbar is better
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 34s
2024-09-17 11:51:26 +02:00
aa1d40613d Seperating configuration into different lua modules
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 28s
2024-09-16 06:40:52 +02:00
fdd52c7471 Vim snippet add remap
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s
2024-09-16 06:18:16 +02:00
04f7b17fd5 Change XML tag trigger to auto trigger
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 20s
2024-09-15 21:09:33 +02:00
c3f37295e6 Failing self containing hello world snippet 2024-09-15 21:07:11 +02:00
8233320d90 Add Rust hello world, remove weird python based print snippet
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 33s
2024-09-15 20:46:40 +02:00
3348f2e49b Hello world snippet for python
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
2024-09-15 20:38:53 +02:00
2135d24022 Nicer function snippet for python
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 38s
2024-09-15 20:34:11 +02:00
b5a63692af Link plaintex snippets to latex 2024-09-15 20:33:57 +02:00
08394c8b54 Remove barely used snippets 2024-09-15 20:25:02 +02:00
be445dfcec Remove empty snippet files
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 26s
2024-09-15 20:20:52 +02:00
566763638d Remove unused lua snippets and add return statement to doxygen
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 30s
2024-09-15 20:19:50 +02:00
6734c00e68 I don't even know lisp 2024-09-15 19:55:28 +02:00
58a2717f6e Add HTML hello world snippet 2024-09-15 19:45:14 +02:00
e15b921187 Remove gitcommit snippets 2024-09-15 19:25:12 +02:00
40 changed files with 953 additions and 976 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,6 @@
lastSession.vim
plugin/
spell/
./mail_password
./lua/irc.lua
./lazy-lock.json

View File

@@ -68,8 +68,21 @@ snip.rv = ""
if t[2].startswith("l"):
parameters = []
else:
parameters = t[2].replace("; ", ";").split(";");
parameters = t[2].replace("; ", ";").replace('in ', '').replace('out ', '')
parameters = parameters.replace(' ', '').split(";");
parameter_list = []
for parameter in parameters:
if len(parameter.split(',')) == 1:
parameter_list.append(parameter)
else:
try:
list_type = parameter.split(':')[1]
except:
list_type = "???"
list_parameters = parameter.split(':')[0].replace(' ', '').split(',')
for sub_parameter in list_parameters:
parameter_list.append(f"{sub_parameter}\t:\t{list_type}")
for parameter in parameter_list:
if not parameter == "" and not parameter.startswith("typ"):
parameterless = parameter.replace("\t", "")
snip.rv += f"-- @parameter {parameterless}\n"
@@ -82,7 +95,7 @@ else:
for variable in variables:
if not variable == "" and not variable.startswith("typ"):
variableless = variable.replace("\t", "").replace (" ", "")
snip.rv += f"-- @variable {variableless}\n"
snip.rv += f"\t-- @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
@@ -99,11 +112,24 @@ snip.rv = ""
if t[2].startswith("l"):
parameters = []
else:
parameters = t[2].replace("; ", ";").split(";");
parameters = t[2].replace("; ", ";").replace('in ', '').replace('out ', '')
parameters = parameters.replace(' ', '').split(";");
parameter_list = []
for parameter in parameters:
if len(parameter.split(',')) == 1:
parameter_list.append(parameter)
else:
try:
list_type = parameter.split(':')[1]
except:
list_type = "???"
list_parameters = parameter.split(':')[0].replace(' ', '').split(',')
for sub_parameter in list_parameters:
parameter_list.append(f"{sub_parameter}\t:\t{list_type}")
for parameter in parameter_list:
if not parameter == "" and not parameter.startswith("typ"):
parameterless = parameter.replace("\t", "")
snip.rv += f"-- @parameter {parameterless}\n"
snip.rv += f"\t-- @parameter {parameterless}\n"
``!p
snip.rv = ""
if t[4].startswith("l"):
@@ -113,8 +139,8 @@ else:
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
snip.rv += f"\t-- @variable {variableless}\n"
` -- @description $5
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
$4
begin
@@ -159,3 +185,10 @@ if t[6] == "y":
system(f"mkdir -p {t[3]}")
system(f"mkdir -p {t[4]}")`
endsnippet
snippet package "Create package configuration" b
package ${1:body }${2:`!p package_name = fn.split('.')[0]
snip.rv = package_name[0].upper() + package_name[1:]`} is
$0
end $2;
endsnippet

View File

@@ -2,10 +2,54 @@ snippet dd "Date and Time" i
`date`
endsnippet
snippet cred "My private Credentials"
Nicki Reiss <yannick.reiss@nickr.eu>
snippet crednick "My private Credentials"
Yannick Reiss <yannick.reiss@nickr.eu>
endsnippet
snippet credhsrm "Credentials HSRM"
Yannick Reiß <yannick.reiss@student.hs-rm.de>
endsnippet
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
snippet crednina "My true credentials"
Nina Chloé Kassandra Reiß <nina.reiss@nickr.eu>
endsnippet
snippet pwd "Print the current working directory"
`echo $(pwd)`
endsnippet

View File

View File

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

View File

@@ -0,0 +1,3 @@
snippet ß "Add backslash" A
\\
endsnippet

View File

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

7
UltiSnips/irc.snippets Normal file
View File

@@ -0,0 +1,7 @@
snippet ff "Freunde (fast)" A
.freunde
endsnippet
snippet wild "Widi Schild update"
widi: Schildupdate?
endsnippet

37
UltiSnips/lean.snippets Normal file
View File

@@ -0,0 +1,37 @@
snippet ß "Backslash" A
\\
endsnippet
snippet <> "Add sharp brackets"
⟨$1⟩$0
endsnippet
snippet | "dvd"
endsnippet
snippet () "Braces"
($1)$0
endsnippet
# Mengen
snippet N "Natural number"
endsnippet
snippet Z "Whole numbers"
endsnippet
snippet R "Real"
endsnippet
# Quantoren
snippet E "Exists"
endsnippet
snippet A "All"
endsnippet

View File

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

View File

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

View File

@@ -35,13 +35,6 @@ $1
$0
endsnippet
snippet cobol "Cobol Code"
\`\`\`cobol
$1
\`\`\`
$0
endsnippet
snippet bash "bash Code"
\`\`\`bash
$1
@@ -60,40 +53,16 @@ snippet ,m "Math equation" A
\$$1\$ $0
endsnippet
snippet entry "Add new entry" bA
-----------------------------------------------------------
## $1 ##
### Date: ${2:`date`} ###
### Author: ${3:`whoami`} ###
### Host: `hostname` ###
-----------------------------------------------------------
Tags: $4
$5
-----------------------------------------------------------
$0
snippet bookshelf "Tagline for bookshelf" b
`!p
if t[1] != "":
snip.rv = "[CW: "
else:
snip.rv = ""`$1`!p
if t[1] != "":
snip.rv = "]"
else:
snip.rv = ""`
${2:Title} by ${3:Author}
${4:Description}
endsnippet
snippet info "The Markdown Information panel" b
---
${1:Info}
Tags: $2
$0
endsnippet
snippet cite "Cite from a paper" b
---
> ${1:Citation}`!p t[1].replace('\n', '\n> ')`
Tags: $2
$0
endsnippet
snippet immernoch "ARGH, lern schreiben!" A
noch immer
endsnippet

91
UltiSnips/pascal.snippets Normal file
View File

@@ -0,0 +1,91 @@
snippet prog "Add new program template" b
Program ${1:Name}`!p snip.rv = "" if t[2] == "" else " ("`${2:FileList}`!p snip.rv = "" if t[2] == "" else ")"`;`!p
if t[3] == "":
snip.rv = ""
else:
snip.rv = "\nconst\n (* Constant declarations *)\n "`${3:Const}`!p
if t[4] == "":
snip.rv = ""
else:
snip.rv = "\ntype\n (* Type declarations *)\n "`${4:Types}`!p
if t[5] == "":
snip.rv = ""
else:
snip.rv = "\nvar\n (* Variable declarations *)\n "`${5:Variables}
Begin
$0
End.
endsnippet
snippet procedure "Add a new procedure" b
{ Procedure
@name: $1`!p
if t[2] == "":
snip.rv = "\n\t"
else:
snip.rv = "\n"
groups = t[2].split(";");
for group in groups:
snip.rv += f"\t@param {group}\n"
snip.rv += "\t"
`@description: $3 }
Procedure ${1:name}`!p
if not (t[2] == ""):
snip.rv = " ("
else:
snip.rv = ""`$2`!p
if not (t[2] == ""):
snip.rv = ")"
else:
snip.rv = ""`;`!p
if t[4] == "":
snip.rv = ""
else:
snip.rv = "\nVar\n\t"`$4
Begin
$0
End;
endsnippet
snippet function "Add a new function" b
{ Procedure
@name: $1`!p
if t[2] == "":
snip.rv = "\n\t"
else:
snip.rv = "\n"
groups = t[2].split(";");
for group in groups:
snip.rv += f"\t@param {group}\n"
snip.rv += "\t"
`@return $3
@description: $4 }
Function ${1:name}`!p
if not (t[2] == ""):
snip.rv = " ("
else:
snip.rv = ""`$2`!p
if not (t[2] == ""):
snip.rv = ")"
else:
snip.rv = ""` : ${3:Integer};`!p
if t[5] == "":
snip.rv = ""
else:
snip.rv = "\nVar\n\t"`$5
Begin
$0
End;
endsnippet
snippet -- "Add comment"
(* $1 *)$0
endsnippet
snippet begin "Create Code Block" b
begin
$1
end;
$0
endsnippet

View File

@@ -1,608 +1 @@
snippet colx "textcolor"
\\textcolor{${1:red}}{$2}$0
endsnippet
snippet tred "text red"
\\textcolor{red}{$1}$0
endsnippet
snippet tblue "text blue"
\\textcolor{blue}{$1}$0
endsnippet
snippet tgreen "text green"
\\textcolor{green}{$1}$0
endsnippet
snippet colb "boxcolor"
\\colorbox{${1:blue}!${2:25}}{$3}$0
endsnippet
snippet imth "inlinemath"
$ $1 $ $0
endsnippet
snippet fmth "fullmath"
\\[
$1
\\]
$0
endsnippet
snippet vec "Vector"
\\vec{$1}$0
endsnippet
snippet tag "tag and text inbetween"
${1:placeholder}
$2
$1
$0
endsnippet
snippet env "Environment"
\\begin{$1}
$2
\\end{$1}
$0
endsnippet
snippet code "listing without own config"
\\begin{lstlisting}
$1
\\end{lstlisting}
$0
endsnippet
snippet ccpp "C++ listing configuration"
\\lstset{ basicstyle=\\ttfamily\\small, language=C++, keywordstyle=\\color{blue}\\bfseries } $0
endsnippet
snippet casm "Assembler listing configuration"
\\lstset{basicstyle=\\ttfamily\\small, language={[${1:x86masm}]Assembler}, keywordstyle=\\color{${2:red}}\\bfseries} $0
endsnippet
snippet cshell "ZSH/BASH config"
\\lstset{basicstyle=\\ttfamily\\small, language={bash}, keywordstyle=\\color{${2:green}}\\bfseries} $0
endsnippet
snippet cocode "Free config"
\\lstset{basicstyle=\\ttfamily\\small, language={$1}, keywordstyle=\\color{${2:red}}\\bfseries} $0
endsnippet
snippet confbook "Configuration for Lectures"
\\documentclass[a4paper]{report}
\\usepackage[utf8]{inputenc}
\\usepackage[ngerman]{babel}
\\usepackage[T1]{fontenc}
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
\\usepackage{makeidx}
\\usepackage[straightvoltages]{circuitikz}
\\usepackage[locale=DE]{siunitx}
\\usepackage{tikz}
\\usepackage[left=1cm, right=2cm, top=3cm, bottom=3cm, bindingoffset=1cm]{geometry}
\\usepackage{graphicx}
\\usepackage{lmodern}
\\usepackage{float}
\\usepackage{fancyhdr}
\\usepackage{listings}
\\usepackage{cancel}
\\usepackage{xcolor}
\\usepackage{interval}
\\usepackage{hyperref}
\\author{${1:Yannick Reiß}}
\\title{$2}
\\pagestyle{fancy}
\\fancyhead[C]{}
\\fancyhead[L]{$2}
\\fancyfoot[C]{\thepage}
${3:colorset}
$0
endsnippet
snippet confartcl "Configuration for short articles"
\\documentclass[16pt,a4paper]{article}
\\usepackage[utf8]{inputenc}
\\usepackage[ngerman]{babel}
\\usepackage[T1]{fontenc}
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
\\usepackage{fancyhdr}
\\usepackage{makeidx}
\\usepackage[straightvoltages]{circuitikz}
\\usepackage[locale=DE]{siunitx}
\\usepackage{tikz}
\\usepackage{graphicx}
\\usepackage{lmodern}
\\usepackage{float}
\\usepackage{cancel}
\\usepackage[left=1cm, right=2cm, top=3cm, bottom=3cm, bindingoffset=1cm]{geometry}
\\usepackage{listings}
\\usepackage{xcolor}
\\usepackage{interval}
\\usepackage{hyperref}
\\author{${1:Yannick Reiß}}
\\title{$2}
\\pagestyle{fancy}
\\fancyhead[C]{}
\\fancyhead[L]{$2}
\\fancyfoot[C]{\thepage}
${3:colorset}
$0
endsnippet
snippet img "Images"
\\begin{figure}
\\centering
\\includegraphics[width=${1:0.7}\\linewidth]{${2}}
\\caption{${3:Abbildung}}
\\end{figure}
$0
endsnippet
snippet document "Add document environment"
\\begin{document}
$0
\\end{document}
endsnippet
snippet land "Logical and"
\\wedge $0
endsnippet
snippet lor "Logical or"
\\vee $0
endsnippet
snippet ubrace "Underbrace"
\\underbrace{$1}_{$2} $0
endsnippet
snippet fall "For all"
\\forall{$1}
$0
endsnippet
snippet paragraph "Paragraph"
\\paragraph{$1}
$0
endsnippet
snippet menge "Menge der __ Zahlen"
\\mathbb{$1}$0
endsnippet
snippet xdelete "Cross out"
\\xcancel{$1}$0
endsnippet
snippet -> "Right normal Arrow"
\\rightarrow $0
endsnippet
snippet larrow "Left normal Arrow"
\\leftarrow $0
endsnippet
snippet frac "Fracture"
\\frac{$1}{$2}$0
endsnippet
snippet mspace "Math Space"
\\quad $0
endsnippet
snippet mmspace "Math double Space"
\\qquad $0
endsnippet
snippet sum "Sum"
\\sum_{i=${1:0}}^{${2:n}} $3 \\qquad $0
endsnippet
snippet prod "Product"
\\prod_{i=${1:1}}^{${2:N}} \\quad $3 \\qquad$0
endsnippet
snippet ltab "Table environment"
\\begin{tabular}{${1:c c c}}
$0
\\end{tabular}
endsnippet
snippet ctab "Table column"
$1 & $2 & $3 \\\\\\
$0
endsnippet
snippet lltab "Large table environment"
\\begin{tabular}{${1:c c c c c}}
$0
\\end{tabular}
endsnippet
snippet cctab "Large column environment"
$1 & $2 & $3 & $4 & $5 \\\\\\
$0
endsnippet
snippet setab "Small table environment"
\\begin{center}
\\begin{tabular}{${1:c c}}
$1
\\end{tabular}
\\end{center}
$0
endsnippet
snippet sctab "Small table column"
$1 & $2 \\\\
\\\\
$0
endsnippet
snippet lquote "Low Quote"
´$1´$0
endsnippet
snippet fquote "Full Quote"
´$1´ \\textit{($2)}$0
endsnippet
snippet colorset "std colorset (6 colors)"
\\definecolor{red}{RGB}{228, 3, 3}
\\definecolor{orange}{RGB}{255, 140, 0}
\\definecolor{yellow}{RGB}{255, 237, 0}
\\definecolor{green}{RGB}{0, 128, 38}
\\definecolor{indigo}{RGB}{36, 64, 142}
\\definecolor{blue}{RGB}{36, 64, 142}
\\definecolor{violet}{RGB}{115, 41, 130}
endsnippet
snippet href "html reference"
\\href{https://${1:link}}{\\underline{\\textcolor{blue}{${2:Text}}}}$0
endsnippet
snippet *_ "Intervall/Isotope-Notation" i
^{$1}_{$2}$0
endsnippet
snippet hook "Reference to text"
\\hyperref[$1]{$2}$0
endsnippet
snippet curled "{ ... }"
\\left\\{ $0 \\right\\}
endsnippet
snippet round "( ... )"
\\left( $0 \\right)
endsnippet
snippet menc "Mathmode-text"
\\text{ $1 }$0
endsnippet
snippet period "Periodic number"
\\overline{$1}$0
endsnippet
snippet leq "lesser equal"
\\leq
endsnippet
snippet geq "greater equal"
\\geq
endsnippet
snippet let "lesser than"
<
endsnippet
snippet grt "greater than"
>
endsnippet
snippet case "if else mathstyle"
\\begin{cases}
$1 & \\quad \\text{$2}\\\\\\ $3 & \\quad \\text{$4}\\\\\\ \\end{cases}$0
endsnippet
snippet median "Median"
\\overset{\\thicksim}{$1}$0
endsnippet
snippet ival "Intervall"
\\interval[$1]{$2}{$3}$0
endsnippet
snippet mul "multiplication"
\\cdot
endsnippet
snippet root "nth root"
\\sqrt[${1:2}]{$2}$0
endsnippet
snippet sdef "Definition"
\\colorbox{blue!25}{Definition: $1} \\\\\\$0
endsnippet
snippet mlgs "Lineares Gleichungssytem"
\\begin{gather}
$0
\\end{gather}
endsnippet
snippet cobol "COBOL config"
\\lstset{ basicstyle=\\ttfamily\\small, language=COBOL, numbers=left, keywordstyle=\\color{blue}\\bfseries} $0
endsnippet
snippet '(.*)__' "sub" r
`!p snip.rv = match.group(1)`_{$1}$0
endsnippet
snippet '(.*)\*\*' "upup" r
`!p snip.rv = match.group(1)`^{$1}$0
endsnippet
snippet ... "dots"
\\dots
endsnippet
snippet fsf "text serif"
\\textsf{$1}$0
endsnippet
snippet fblk "text block"
\\texttt{$1}{$0}
endsnippet
snippet fit "text italic"
\\textit{$1}$0
endsnippet
snippet '//(.+)//' "Make Text italic" rA
\\textit{`!p snip.rv = match.group(1)`}$0
endsnippet
snippet fbf "text bold"
\\textbf{$1}$0
endsnippet
snippet '\*\*(.+)\*\*' "Make Text bold" rA
\\textbf{`!p snip.rv = match.group(1)`}$0
endsnippet
snippet bit "itemize"
\\begin{itemize}
\\item $1
\\end{itemize}
$0
endsnippet
snippet ben "enumerate"
\\begin{enumerate}
\\item $1
\\end{enumerate}
$0
endsnippet
snippet +ni+ "next item" A
\\item $1
endsnippet
snippet sch "chapter"
\\chapter{$1}$0
endsnippet
snippet sse "Section"
\\section{$1}$0
endsnippet
snippet sss "Subsection"
\\subsection{$1}$0
endsnippet
snippet ssn "Subsubsection"
\\subsubsection{$1}$0
endsnippet
snippet par "Paragraph"
\\paragraph{$1}$0
endsnippet
snippet mquote "max quote"
\`$1\` (${2:author} : \\textit{${3:source}}, ${4:year})$0
endsnippet
snippet qed "Quod erat demonstrantum"
\\begin{flushright}
$\#$
\\end{flushright}
$0
endsnippet
snippet <- "Easy Left"
\\leftarrow $0
endsnippet
snippet => "Double Right"
\\Rightarrow $0
endsnippet
snippet <= "Double Left"
\\Leftarrow $0
endsnippet
snippet circuit "Circuit environment"
\\colorbox{blue!10}{
\\begin{circuitikz}[european resistors]
$1
\\end{circuitikz}}
$0
endsnippet
snippet edraw "Draw into electric circuit"
\\draw(${1:0}, ${2:0})
$3
;
$0
endsnippet
snippet 'R "Insert Resistor"
to [R=$R_{$1}: $2 \Omega$, ${3:i =$i$}, ${4:*-*}] ($5, $6)
$0
endsnippet
snippet 'W "Wire"
to [short, ${1:i=$i$}, ${2:*-*}] ($3, $4)
$0
endsnippet
snippet 'V "Voltage"
to [V, v=$U_{$1}: $2V$, ${3:i=$i$}, ${4:*-*}] ($5, $6)
$0
endsnippet
snippet 'L "Coil"
to [L=$L_{$1}: $2H$, ${3:i=$i$}, ${4:*-*}] ($3, $4)
$0
endsnippet
snippet 'C "Capacitor"
to [C=$C_{$1}: $2F$, ${3:i=$i$}, ${4:*-*}] ($3, $4)
$0
endsnippet
snippet 'W' "Wired powerline"
to [short, ${1:*-*}] ($2, $3)
$0
endsnippet
snippet 'G "GROUND"
to [short] node[ground] {$1} ($2, $3)
$0
endsnippet
snippet 'SA "(Sende)-Antenne"
to [short] node[antenna] {$1} ($2, $3)
$0
endsnippet
snippet timenow "The current time"
`date`
endsnippet
snippet texmeta "Meta with stamp for better documentation"
% Bookmark `!p import random as ran
if not snip.c:
snip.rv = t[1][0] + str(ran.randint(10, 100))` Content ${1:Title} on `date` by `echo $USER`
$0
endsnippet
snippet lmth "List math with align" b
\\begin{align*}
$1
\\end{align*}
$0
endsnippet
snippet lexp "List math expression"
$1 &= ${2:First} & ${3:Second} \\\\
$0
endsnippet
snippet definition "Box with definition"
\\framebox{
\\colorbox{blue!25}{
\\begin{minipage}{1.0\\textwidth}
\\textbf{Definition: $1}\\\\
$2
\\end{minipage}}}
$0
endsnippet
snippet attention "Box for attention"
\\framebox{
\\colorbox{red!25}{
\\begin{minipage}{1.0\\textwidth}
\\textbf{Achtung: $1}\\\\
$2
\\end{minipage}}}
$0
endsnippet
snippet headline "Insert a Headline"
\\lhead{}
\\chead{\\rightmark}
\\rhead{\\date}
\\renewcommand{\\headrulewidth}{1pt}
endsnippet
snippet footline "Insert a footer"
\\lfoot{}
\\cfoot{}
\\rfoot{}
endsnippet
global !p
def create_table_tabs(snip):
anon_snippet_body = ""
# get start and end line number of (expanded) snippet
start = snip.snippet_start[0]
end = snip.snippet_end[0]
# Append current line into snippet
for i in range(start, end+1):
anon_snippet_body += snip.buffer[i]
anon_snippet_body += "" if i == end else '\n'
# delete expanded snippet line while preserving the line
for i in range(start, end):
del snip.buffer[start]
# Empty last line, while preserving the line
snip.buffer[start] = ''
# Expand anonymous snippet
snip.expand_anon(anon_snippet_body)
def create_table(cols, rows, sep, start, end, head="##"):
res = ""
placeholder = 1
for _ in range(0, int(rows)):
res += start + head.replace("##", f"${placeholder} ")
placeholder += 1
for _ in range(0, int(cols) - 1):
res += sep + head.replace("##", f" ${placeholder} ")
placeholder += 1
res += end
return res[:-1]
endglobal
post_jump "create_table_tabs(snip)"
snippet 'table(\d+),(\d+)' "Table with given row and column count" r
\begin{center}
\begin{tabular}{`!p
orient = "c"
for _ in range(0, int(match.group(1))): orient += " c"
snip.rv = orient`}
`!p
snip.rv = create_table(match.group(1), match.group(2), "&", "\t", "\\\\\\\\\n")
`$0
\end{tabular}
\end{center}
endsnippet
post_jump "create_table_tabs(snip)"
snippet 'matrix(\d+),(\d+)' "Matrix with given row and column count" r
\begin{pmatrix}
`!p
snip.rv = create_table(match.group(1), match.group(2), "&", "\t", "\\\\\\\\\n")
`$0
\end{pmatrix}
endsnippet
extends latex

6
UltiSnips/pyenv.snippets Normal file
View File

@@ -0,0 +1,6 @@
global !p
def print_hello():
print("Hello")
endglobal

View File

@@ -1,4 +1,17 @@
snippet docmodule "Documentation for modules" A
snippet helloworld "Hello world example" b
"""
File: `!p snip.rv = fn`
Author: Nicki
Created on: `date`
Description: Hello world python example
"""
if __name__ == "__main__":
print("Hello world!")
$0
endsnippet
snippet docmodule "Documentation for modules"
"""
File: `!p snip.rv = fn`
Author: ${1:Yannick Reiß}
@@ -8,25 +21,26 @@ Description: ${2:No further description}
$0
endsnippet
snippet def "Python Function" A
snippet def "Python Function"
def ${1:function}(${2}):
"""
@name $1
@brief ${3:function description}
Args:
`!p
`!p
params = t[2].replace(", ", ",").split(",")
snip.rv = ""
for param in params:
snip.rv += f"@param {param}"
snip.rv += f"\t\t@param {param}\n"
`
Returns:
$4 ${5:description}
@return $4
"""
$6
$5
`!p
if t[4] != "":
snip.rv = f"\n return {t[4]}"`
if t[4] != "" and len(t[4].split(":")) > 1:
snip.rv = f"return {t[4].split(':')[0]}"`
$0
endsnippet

View File

@@ -1,3 +1,14 @@
snippet helloworld "Hello world example" b
// @name main
// @return
// @brief Hello world example.
// @param
fn main() {
println!("Hello World!");
}
$0
endsnippet
snippet fn "function declaration" i
// @name $1
// @return $3
@@ -13,13 +24,6 @@ else:
$0
endsnippet
snippet doxygen "Doxygen comment" b
// @name ${1:name}
// @return ${2:Return type}
// @param ${3:Parameter}
// @brief ${4:Description}
endsnippet
snippet struct "struct declaration"
// $1
// ${2:Description}
@@ -50,39 +54,6 @@ while $1 {
} $0
endsnippet
global !p
import re
def create_parameter_placeholders(snip):
placeholders_amount = int(snip.buffer[snip.line].strip())
snip.buffer[snip.line] = ''
anon_snippet_body = 'println!("' + '{}'.join(['$' + str(i+1) for i in range(placeholders_amount)]) + f"${placeholders_amount}" + '"'
if placeholders_amount > 0:
anon_snippet_body = anon_snippet_body + ', '
anon_snippet_body = anon_snippet_body + ', '.join(['$' + str(i+1) for i in range(placeholders_amount, 2*placeholders_amount)]) + ");"
snip.expand_anon(anon_snippet_body)
endglobal
post_jump "create_parameter_placeholders(snip)"
snippet "print\d+" "println" rA
`!p snip.rv = match.group(1)`
endsnippet
snippet println "println" A
println!("$1");$0
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

View File

@@ -4,3 +4,9 @@ $4
`!p snip.rv = "endsnippet"`
$0
endsnippet
snippet helloworld "A simple hello world snippet" b
${0:`!p
if not snip.c:
snip.rv = f'snippet helloworld "A simple hello world snippet" b\n{t[0]}\nendsnippet'`}
endsnippet

View File

@@ -1,3 +1,9 @@
extends pyenv
snippet cc "Add Citation" i
\\cite{$1}$0
endsnippet
snippet colx "textcolor"
\\textcolor{${1:red}}{$2}$0
endsnippet

View File

@@ -61,3 +61,7 @@ snippet def "Definition/Constant" b
\`define ${1:NAME} ${2:VALUE}
$0
endsnippet
snippet filename "Get Filename" b
// `pwd`/`!p snip.rv = fn`
endsnippet

View File

@@ -49,7 +49,7 @@ endsnippet
snippet docstring "Header Comment" A
-- `!p snip.rv = fn`
-- Created on: `date`
-- Author(s): ${1:Alexander Graf, Carl Ries, Yannick Reiß}
-- Author(s): ${1:Nina Chloé Reiß}
-- Content: ${2: Entity `!p snip.rv = fn.split('.')[0]`}
$0
endsnippet

View File

@@ -1,5 +1,3 @@
snippet fun "Lua function" b
function ${1:name}()
$2
endfunction$0
snippet nnoremap "Normal mode remap" b
nnoremap ${1:<leader>key} $2$0
endsnippet

View File

@@ -1,4 +1,4 @@
snippet tg "automated tag insertion" b
snippet << "automated tag insertion" A
<${1:tag}>
$2
</${1/(\w+).*/$1/}>$0

View File

@@ -20,5 +20,3 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")
require("plugconfig")
require("confformat")

View File

@@ -1,51 +0,0 @@
{
"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" }
}

67
lua/ada_mode.lua Normal file
View File

@@ -0,0 +1,67 @@
-- Lua vim-dummy variable
if vim == nil then
local vim = {}
end
-- @name Prove
-- @param
-- @short Run gnatprove
function Prove()
vim.cmd("new")
local run_cmd = { "alr gnatprove" }
vim.api.nvim_buf_set_lines(0, 0, -1, false, run_cmd)
vim.cmd(":%!bash")
buffer_loaded = true
end
-- @name Run
-- @param
-- @short Run program using alire
function Run()
vim.cmd("new")
local run_cmd = { "alr run" }
vim.api.nvim_buf_set_lines(0, 0, -1, false, run_cmd)
vim.cmd(":%!bash")
buffer_loaded = true
end
function Close_Prove()
if buffer_loaded then
buffer_loaded = false
vim.cmd("bd!")
end
end
vim.keymap.set("n", "pp", ":lua Close_Prove()<cr>")
vim.keymap.set("n", "<leader>pp", ":lua Prove()<cr>")
vim.keymap.set("n", "<leader>op", ":lua Run()<cr>")
-- @name setup_ada
-- @param
-- @short Verify installation of ada tools or install them.
local function setup_ada()
vim.keymap.set("n", "<leader>cb", ":!gnatpp %<cr>")
vim.opt.tabstop = 3
vim.opt.shiftwidth = 3
end
-- Setup and verify ada tools when opening a ada file
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "*.adb", "*.ads" },
callback = setup_ada,
})
-- @name leave_ada
-- @param
-- @short Leave ada and reverse any changes to my editor defaults
local function leave_ada()
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
end
vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.adb", "*.ads" },
callback = leave_ada,
})

View File

@@ -16,6 +16,9 @@ cmp.setup({
},
-- Add borders to the windows
view = {
entries = "custom",
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),

View File

@@ -12,8 +12,6 @@ require("formatter").setup({
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
lua = {
-- "formatter.filetypes.lua" defines default configurations for the
-- "lua" filetype
require("formatter.filetypes.lua").stylua,
},
@@ -45,6 +43,34 @@ require("formatter").setup({
require("formatter.filetypes.rust").rustfmt,
},
haskell = {
function()
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "fourmolu",
args = {
util.escape_path(util.get_current_buffer_file_path()),
},
stdin = true,
}
end,
},
vhdl = {
function()
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "vhdlfmt",
args = {
util.escape_path(util.get_current_buffer_file_path()),
},
stdin = true,
}
end,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
@@ -54,3 +80,13 @@ require("formatter").setup({
},
},
})
-- Formatter autocommands
vim.cmd([[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost * FormatWrite
augroup END
autocmd BufWritePost *.v lua vim.lsp.buf.format({ async = false })
]])

View File

@@ -0,0 +1,34 @@
-- 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", "adals", "cspell" },
}
local fixers = {
ada = { "gnatpp" },
asm = { "gcc" },
bash = { "bashate" },
c = { "astyle" },
latex = { "texlab", "textlint" },
tex = { "textlint" },
lua = { "stylua" },
markdown = { "prettier", "pandoc" },
python = { "yapf" },
pascal = { "ptop" },
haskell = { "fourmolu" },
}
vim.g.ale_linters = linters
vim.g.ale_fix_on_save = 0
vim.g.ale_fixers = fixers
vim.keymap.set("n", "<leader>lf", ":ALEFix<CR>")
vim.keymap.set("n", "<leader>lp", ":ALEFindReferences<CR>")

90
lua/lspconfiguration.lua Normal file
View File

@@ -0,0 +1,90 @@
-- Mason setup
require("mason").setup(require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "󰔟",
package_uninstalled = "",
},
},
}))
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
},
})
-- require("mason-lspconfig").setup_handlers({
-- function(asm_lsp)
-- require("lspconfig")[asm_lsp].setup({})
-- end,
-- function(clangd)
-- require("lspconfig")[clangd].setup({})
-- end,
-- function(lua_ls)
-- require("lspconfig")[lua_ls].setup({})
-- end,
-- function(hls)
-- require("lspconfig")[hls].setup({})
-- end,
-- function(rust_analyzer)
-- require("lspconfig")[rust_analyzer].setup({})
-- end,
-- function(vhdl_ls)
-- require("lspconfig")[vhdl_ls].setup({})
-- end,
-- function(verible)
-- require("lspconfig")[verible].setup({})
-- end,
-- function(vimls)
-- require("lspconfig")[vimls].setup({})
-- end,
-- function(texlab)
-- require("lspconfig")[texlab].setup({})
-- end,
-- function(als)
-- require("lspconfig")[als].setup({})
-- end,
-- })
require("lspconfig").verible.setup({
cmd = { "verible-verilog-ls", "--rules_config_search" },
})
-- @name file_exists
-- @param (name
-- @short Check if a file does exists (i. e. an ada project file)
local function file_exists(name)
local f = io.open(name, "r")
return f ~= nil and io.close(f)
end
-- @name get_config_file
-- @param
-- @short Get the configuration file.
local function get_config_file()
local filename = vim.api.nvim_buf_get_name(0)
local basedirectory = filename:gsub("/[^%/]-$", "")
local currentdirectory = filename:match("[^%/]-$")
if file_exists(basedirectory .. currentdirectory .. ".gpr") then
return basedirectory .. currentdirectory .. ".gpr"
else
basedirectory = basedirectory:gsub("/[^%/]-$", "")
currentdirectory = filename:match("[^%/]-$")
if file_exists(basedirectory .. currentdirectory .. ".gpr") then
return basedirectory .. currentdirectory .. ".gpr"
else
return "default.gpr"
end
end
end
require("lspconfig").als.setup({
settings = {
ada = {
projectFile = get_config_file(),
},
},
})

24
lua/navigation.lua Normal file
View File

@@ -0,0 +1,24 @@
-- Bufstop
vim.keymap.set("n", "<M-w>", ":bdelete<CR>")
vim.keymap.set("n", "<C-y>", ":BufstopFast<CR>")
-- NERDTree Config
vim.g.NERDTreeShowHidden = 1
vim.keymap.set("n", "<C-e>", ":NERDTreeToggle<CR>")
-- Telescope snippet
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<c-f>", builtin.current_buffer_fuzzy_find, {})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
vim.keymap.set("n", "<leader>fc", builtin.commands, {})
-- Telescope + Ultisnips
require("telescope").load_extension("ultisnips")
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
-- 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

56
lua/pascal_mode.lua Normal file
View File

@@ -0,0 +1,56 @@
-- Lua vim-dummy variable
if vim == nil then
local vim = {}
end
-- @name setup_pascal
-- @param
-- @short Verify installation of pascal tools or install them.
local function setup_pascal()
local check_ptop = { os.execute("which ptop") }
-- if return value is 1, get ptop
if check_ptop == 1 then
os.execute("wget -O ~/.local/bin/ptop https://www.nickr.eu/data/ptop64")
os.execute("chmod +x ~/.local/bin/ptop")
end
vim.opt.spell = false
end
-- Setup and verify pascal tools when opening a pascal file
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "*.pas" },
callback = setup_pascal,
})
-- @name leave_pascal
-- @param
-- @short Leave pascal and reverse any changes to my editor defaults
local function leave_pascal()
vim.opt.spell = true
end
vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.pas" },
callback = leave_pascal,
})
-- @name auto_format
-- @param
-- @short The format function for pascal.
local function auto_format()
vim.cmd("checktime %")
local write_cmd = "ptop -i 4 -c ~/.config/nvim/ptop.conf "
.. vim.api.nvim_buf_get_name(0)
.. " "
.. vim.api.nvim_buf_get_name(0)
os.execute(write_cmd)
vim.cmd("checktime %")
end
-- Add formatter command
--vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- pattern = { "*.pas" },
-- callback = auto_format,
--})

View File

@@ -1,127 +1,60 @@
-- VHDL mode (Vanilla with shell interaction)
require("vhdl_mode")
-- Formatter configuration
require("formatterconfiguration")
-- Code completion
require("code-completion")
-- Snippet configuration (Ultisnips)
require("snippetconfiguration")
-- ALE configuration
require("linterconfiguration")
-- Navigation and jumping configuration
require("navigation")
-- Mason and builtin lsp configuration
require("lspconfiguration")
-- Pascal mode (supported by plugins)
require("pascal_mode")
-- Ada mode (supported by plugins)
require("ada_mode")
-- Markdown Preview
vim.g.mkdp_auto_start = 0
vim.g.mkdp_browser = "epiphany"
vim.g.mkdp_echo_preview_url = 1
-- Misc configuration
if vim == nil then
vim = {}
end
-- Update function and call
function Update_Sys()
--vim.cmd("TSUpdate")
vim.cmd("MasonUpdate")
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
vim.g.UltiSnipsExpandTrigger = "<tab>"
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
vim.g.UltiSnipsJumpBackwardTrigger = "<c-h>"
vim.g.UltiSnipsEditSplit = "vertical"
vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }
-- NERDTree Config
vim.g.NERDTreeShowHidden = 1
vim.keymap.set("n", "<C-e>", ":NERDTreeToggle<CR>")
-- Lexima
vim.g.lexima_enable_basic_rules = 1
vim.g.lexima_enable_newline_rules = 1
-- Telescope snippet
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<c-f>", builtin.current_buffer_fuzzy_find, {})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
vim.keymap.set("n", "<leader>fc", builtin.commands, {})
-- Telescope + Ultisnips
require("telescope").load_extension("ultisnips")
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
-- Git-Blame configuration
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
vim.g.gitblame_date_format = "%r"
-- Code completion
require("code-completion")
-- Mason setup
require("mason").setup(require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "󰔟",
package_uninstalled = "",
},
},
}))
require("mason-lspconfig").setup({
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
ensure_installed = { "clangd" },
})
require("mason-lspconfig").setup_handlers({
function(clangd)
require("lspconfig")[clangd].setup({})
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
-- vim.cmd("colo vim-monokai-tasty")
vim.cmd("colo vim-monokai-tasty")

View File

@@ -12,9 +12,11 @@ return {
-- Navigation
"preservim/nerdtree",
"Xuyuanp/nerdtree-git-plugin",
"yannickreiss/nvim-doxyscan",
"mihaifm/bufstop",
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
},
{ "tzachar/fuzzy.nvim", requires = { "nvim-telescope/telescope-fzf-native.nvim" } },
"fhill2/telescope-ultisnips.nvim",
"preservim/tagbar",
@@ -32,6 +34,7 @@ return {
"nvim-tree/nvim-web-devicons",
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
"mhinz/vim-startify",
"p00f/nvim-ts-rainbow",
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
@@ -43,19 +46,38 @@ return {
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
rainbow = {
enable = true,
extended_mode = true,
max_file_lines = 3000,
},
})
end,
},
"p00f/nvim-ts-rainbow",
"dense-analysis/ale",
"f-person/git-blame.nvim",
"dstein64/vim-startuptime",
"hiphish/rainbow-delimiters.nvim",
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && npm install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
-- Themes
"folke/tokyonight.nvim",
"patstockwell/vim-monokai-tasty",
"hiroakis/cyberspace.vim",
"jaredgorski/spacecamp",
{
"scottmckendry/cyberdream.nvim",
lazy = false,
priority = 1000,
},
-- Code completion / Menu
"hrsh7th/nvim-cmp",
@@ -79,4 +101,54 @@ return {
"mfussenegger/nvim-dap",
"mhartington/formatter.nvim",
{ "TamaMcGlinn/nvim-lspconfig-ada" },
"sainnhe/sonokai",
-- Plugins to test
"https://git.nickr.eu/yannickreiss/nvim-macrotool.git",
-- Wiki
{
"echaya/neowiki.nvim",
opts = {
wiki_dirs = {
-- neowiki.nvim supports both absolute and relative paths
{ name = "Personal", path = "~/.wiki" },
{ name = "RiscVar", path = "~/Documents/HSRM/riscvar.wiki" },
{ name = "Ada/Spark", path = "~/Documents/Science/ada_spark_wiki" },
{ name = "FPGA Book", path = "~/Documents/Science/FPGA_Design" },
{ name = "Spark-Shell", path = "~/Documents/Programming/spark/spark_shell/spark_shell.wiki" },
},
},
keys = {
{ "<leader>ww", "<cmd>lua require('neowiki').open_wiki()<cr>", desc = "Open Wiki" },
{ "<leader>wW", "<cmd>lua require('neowiki').open_wiki_floating()<cr>", desc = "Open Floating Wiki" },
{ "<leader>wT", "<cmd>lua require('neowiki').open_wiki_new_tab()<cr>", desc = "Open Wiki in Tab" },
},
},
-- Lean
{
"Julian/lean.nvim",
event = { "BufReadPre *.lean", "BufNewFile *.lean" },
dependencies = {
"neovim/nvim-lspconfig",
"nvim-lua/plenary.nvim",
-- optional dependencies:
-- a completion engine
-- hrsh7th/nvim-cmp or Saghen/blink.cmp are popular choices
-- 'nvim-telescope/telescope.nvim', -- for 2 Lean-specific pickers
-- 'andymass/vim-matchup', -- for enhanced % motion behavior
-- 'andrewradev/switch.vim', -- for switch support
-- 'tomtom/tcomment_vim', -- for commenting
},
---@type lean.Config
opts = { -- see below for full configuration options
mappings = true,
},
},
}

View File

@@ -0,0 +1,5 @@
vim.g.UltiSnipsExpandTrigger = "<tab>"
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
vim.g.UltiSnipsJumpBackwardTrigger = "<c-h>"
vim.g.UltiSnipsEditSplit = "vertical"
vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }

View File

@@ -16,9 +16,11 @@ vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.relativenumber = false
vim.g.mapleader = ","
vim.cmd("set clipboard+=unnamedplus")
vim.cmd("autocmd! CursorHold,CursorHoldI *.md write")
vim.cmd("set autoread")
-- GUI
vim.opt.cursorline = true
@@ -27,7 +29,6 @@ vim.opt.encoding = "UTF-8"
vim.g.tex_flavor = "latex"
vim.opt.conceallevel = 2
vim.opt.showmatch = true
vim.o.guifont = "Source Code Pro:h13"
-- set color scheme
vim.opt.termguicolors = true
@@ -35,7 +36,7 @@ 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 = ""
-- vim.opt.mouse = ""
-- set copy mode
vim.keymap.set("n", "<leader>ll", ":set nonumber<cr>")
@@ -44,3 +45,61 @@ 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>")
-- Nix mode
local nix_interpreter_buffer = -1
local nix_interpreter_window = -1
-- @name run_nix_interpreter
-- @param
-- @short Run nix and output to a buffer on the right
local function run_nix_interpreter()
local original_win = vim.api.nvim_get_current_win()
vim.cmd("vsplit")
nix_interpreter_buffer = vim.api.nvim_create_buf(false, true)
vim.api.nvim_win_set_buf(0, nix_interpreter_buffer)
nix_interpreter_window = vim.api.nvim_get_current_win()
vim.api.nvim_set_current_win(original_win)
end
-- @name update_nix_interpreter
-- @param
-- @short Run nix enterpreter on that file.
local function update_nix_interpreter()
local filename = vim.api.nvim_buf_get_name(0)
if filename == "" then
vim.api.nvim_buf_set_lines(nix_interpreter_buffer, 0, -1, false, {
"Error: Current buffer has no file name.",
})
return
end
local cmd = { "nix-instantiate", "--eval", "--strict", filename }
local output = vim.fn.systemlist(cmd)
if vim.v.shell_error ~= 0 then
table.insert(output, 1, "Error running nix-instantiate:")
end
vim.api.nvim_buf_set_lines(nix_interpreter_buffer, 0, -1, false, output)
end
-- @name close_nix_interpreter
-- @param
-- @short Closes the window and buffer of the interpreter
local function close_nix_interpreter()
vim.api.nvim_buf_delete(nix_interpreter_buffer, { unload = true })
vim.api.nvim_win_close(nix_interpreter_window, true)
end
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "*.nix" },
callback = run_nix_interpreter,
})
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = { "*.nix" },
callback = update_nix_interpreter,
})
vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.nix" },
callback = close_nix_interpreter,
})

13
lua/vhdl_mode.lua Normal file
View File

@@ -0,0 +1,13 @@
-- vim dummy assignment for the lsp
if vim == nil then
local vim = {}
end
-- Setup the formatter for VHDL
-- Download for current platform type if not already present
local check_formatter = { os.execute("which ~/.local/bin/vhdlfmt") }
if check_formatter == 1 then
-- setup the formatter here
os.execute("wget -O ~/.local/bin/vhdlfmt https://www.nickr.eu/data/vhdlfmt")
os.execute("chmod +x ~/.local/bin/vhdlfmt")
end

98
ptop.conf Normal file
View File

@@ -0,0 +1,98 @@
end=crbefore,dindonkey,dindent,crafter,capital
[end]=if,then,else,while,with,for,record,try,finally,except,class,object,private,public,protected,published,casevar,colon,equals
begin=crbefore,dindonkey,inbytab,crafter,capital
[begin]=var,label,const,type
if=spaft,gobsym,inbytab,capital
then=capital
else=crbefore,dindonkey,inbytab,capital
[else]=if,then,else
proc=dindonkey,spaft,capital
[proc]=var,label,const,type
var=blinbefore,dindonkey,spaft,inbytab,capital
[var]=var,label,const,type
of=crsupp,spbef,spaft,capital
while=spaft,gobsym,inbytab,crafter,capital
do=crsupp,spbef,capital
case=spaft,gobsym,inbytab,crafter,capital
with=spaft,gobsym,inbytab,crafter,capital
for=spaft,gobsym,inbytab,crafter,capital
repeat=inbytab,crafter,capital
until=crbefore,dindonkey,dindent,spaft,gobsym,crafter,capital
[until]=if,then,else,while,with,for,colon,equals
func=dindonkey,spaft,capital
[func]=var,label,const,type
label=blinbefore,spaft,inbytab,capital
const=blinbefore,dindonkey,spaft,inbytab,capital
[const]=var,label,const,type
type=blinbefore,dindonkey,spaft,inbytab,capital
[type]=var,label,const,type
record=inbyindent,crafter,capital
[record]=end
string=
prog=blinbefore,spaft,capital
asm=
try=crbefore,inbytab,crafter,capital
finally=crbefore,dindent,inbytab,crafter,capital
[finally]=try
except=crbefore,dindent,inbytab,crafter,capital
[except]=try
raise=
class=inbyindent,capital
object=inbyindent,capital
constructor=
destructor=
inherited=
property=
private=crbefore,dindonkey,spaft,inbytab,capital
[private]=end,private,public,protected,published
public=crbefore,dindonkey,spaft,inbytab,capital
[public]=end,private,public,protected,published
protected=crbefore,dindonkey,spaft,inbytab,capital
[protected]=end,private,public,protected,published
published=crbefore,dindonkey,spaft,inbytab,capital
[published]=end,private,public,protected,published
initialization=
finalization=
inline=
library=blinbefore,spaft,capital
interface=blinbefore,crafter,capital
implementation=blinbefore,dindonkey,crafter,capital
[implementation]=end,var,label,const,type,property
read=
write=
unit=blinbefore,spaft,capital
and=
arr=
div=
down=
file=
goto=
in=
mod=
not=
nil=
or=
set=
to=
virtual=
uses=blinbefore,spaft,capital
casevar=spaft,gobsym,inbytab,crafter,capital
ofobject=
becomes=spbef,spaft,gobsym,capital
notequal=
lessorequal=
greaterorequal=
delphicomment=crafter
dopencomment=
dclosecomment=
opencomment=crsupp,capital
closecomment=crsupp,capital
semicolon=crsupp,dindonkey,crafter,capital
[semicolon]=if,then,else,while,with,for,colon,equals
colon=inbytab,capital
equals=spbef,spaft,inbytab,capital
openparen=gobsym,capital
closeparen=
period=crsupp,capital
endoffile=
other=