Compare commits
9 Commits
7daedc0b31
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3db17f9849 | |||
| 8564daf4b5 | |||
| f19f71c182 | |||
| 084fff8e1a | |||
| 82226b4f78 | |||
| c4c65c4e65 | |||
| 8ecfde7ce1 | |||
|
|
437ce3ff2e | ||
|
|
4ad4a777f6 |
@@ -10,6 +10,42 @@ 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
|
||||
|
||||
37
UltiSnips/lean.snippets
Normal file
37
UltiSnips/lean.snippets
Normal 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
|
||||
@@ -25,6 +25,11 @@ 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 = {}
|
||||
|
||||
@@ -58,12 +58,26 @@ return {
|
||||
"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",
|
||||
@@ -102,6 +116,7 @@ return {
|
||||
{ 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 = {
|
||||
@@ -110,4 +125,30 @@ return {
|
||||
{ "<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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -29,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
|
||||
@@ -46,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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user