7 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
4 changed files with 141 additions and 1 deletions

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

@@ -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 = {}

View File

@@ -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,
},
},
}

View File

@@ -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,
})