This commit is contained in:
Michael Moese 2025-07-25 14:19:20 +02:00
parent 07816eb302
commit 09d717fab8
63 changed files with 2945 additions and 34 deletions

114
nvim/.config/nvim/init.lua Normal file
View file

@ -0,0 +1,114 @@
vim.g.mapleader = " "
vim.opt.clipboard:append("unnamedplus")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath
})
end
vim.opt.rtp:prepend(lazypath)
-- Plugin-Setup
require("lazy").setup("plugins")
-- Ensure nvim-lspconfig is loaded
local lspconfig = require('lspconfig')
-- Define the corrected command to run Perl::LanguageServer inside the Distrobox
-- Replace 'perl-ls-debian' with the actual name of your Distrobox container
local perl_ls_cmd = {
'distrobox',
'enter',
'perl-ls-debian',
'--', -- This separates distrobox commands from the command to run inside
'perl',
'-MPerl::LanguageServer',
'-e',
[[Perl::LanguageServer->run("--stdio")]] -- Use Lua long string literal
}
-- Configure perlpls (Perl::LanguageServer)
lspconfig.perlpls.setup({
cmd = perl_ls_cmd,
settings = {
pls = {
inc = {
"${workspaceFolder}/lib",
"${workspaceFolder}/os-autoinst/lib",
},
perlcritic = {
enabled = true,
perlcriticrc = '${workspaceFolder}/.perlcriticrc',
},
perltidy = {
perltidyrc = '${workspaceFolder}/.perltidyrc',
},
}
},
on_attach = function(client, bufnr)
-- IMPORTANT: Remove the line `require('lspconfig.util').default_on_attach(client, bufnr)`
-- Set options for the buffer (e.g., enable completion, formatting)
-- Many of these are now handled by Neovim's LSP client automatically,
-- but you can explicitly enable them if needed.
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- for C-x C-o completion
-- Basic LSP keymaps (you can customize these)
local opts = { noremap=true, silent=true }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>f', '<cmd>lua vim.lsp.buf.format()<CR>', opts)
-- Example: Set up automatic formatting on save (if the LSP server supports it)
if client.supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('LspFormatting' .. bufnr, { clear = true }),
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr, async = false })
end,
})
end
-- You can add more client capabilities here, for example with nvim-cmp:
-- require('cmp_nvim_lsp').setup_client(client)
end,
})
vim.api.nvim_create_user_command('OrgYtDl', function()
local url = vim.fn.expand('<cfile>')
if url:match('^https?://') then
vim.fn.jobstart({ 'yt-dlp', url }, {
stdout_buffered = true,
on_stdout = function(_, data)
if data then
print(table.concat(data, '\n'))
end
end,
on_stderr = function(_, data)
if data then
print('[yt-dlp] error:', table.concat(data, '\n'))
end
end,
})
else
print('No link under cursor.')
end
end, {})
-- Kopiert visuell markierten Text ins Clipboard mit <leader>y
vim.keymap.set("v", "<leader>y", '"+y', { desc = "Yank selection to system clipboard" })
vim.keymap.set('n', '<leader>oy', ':OrgYtDl<CR>', { desc = 'yt-dlp link under cursor' })

View file

@ -0,0 +1,49 @@
-- init.lua
-- 1. lazy.nvim bootstrap
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- 2. Plugin Setup
require("lazy").setup({
{
"kyazdani42/nvim-tree.lua",
dependencies = { "kyazdani42/nvim-web-devicons" },
lazy = false,
config = function()
require("nvim-tree").setup {}
vim.api.nvim_set_keymap('n', '<C-n>', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
end,
},
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, -- für hübsche Icons
lazy = false,
config = function()
require("lualine").setup({
options = {
theme = "tokyonight",
section_separators = "",
component_separators = "",
globalstatus = true,
},
})
end,
},
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup({ style = "night" })
vim.cmd("colorscheme tokyonight")
end,
},
})

View file

@ -0,0 +1,23 @@
{
"gen.nvim": { "branch": "main", "commit": "c8e1f574d4a3a839dde73a87bdc319a62ee1e559" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"llm.nvim": { "branch": "main", "commit": "ce69731ba3f8d3ea8bc4c8f58c74c2f9ea0b33de" },
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" },
"mason.nvim": { "branch": "main", "commit": "197f6352c276bbc2d25541dfce00ec50d1a4e88f" },
"mini.nvim": { "branch": "main", "commit": "432a0614f8dc38715892b0eec537716457ea4c2f" },
"neorg": { "branch": "main", "commit": "e206c9642f4a115cd836e76c98ef785623d335bc" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lspconfig": { "branch": "master", "commit": "4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-tree.lua": { "branch": "master", "commit": "543ed3cac212dc3993ef9f042f6c0812e34ddd43" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" },
"orgmode": { "branch": "master", "commit": "ffa4d804115881d2a44ae5063ecb28f9686b4797" },
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"render-markdown.nvim": { "branch": "main", "commit": "b540997fbf7ccf3a39ce21162ce8957be2f67e37" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }
}

View file

@ -0,0 +1,30 @@
return {
"David-Kunz/gen.nvim",
opts = {
model = "deepseek-coder:latest", -- The default model to use.
quit_map = "q", -- set keymap to close the response window
retry_map = "<c-r>", -- set keymap to re-send the current prompt
accept_map = "<c-cr>", -- set keymap to replace the previous selection with the last result
host = "localhost", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening.
display_mode = "float", -- The display mode. Can be "float" or "split" or "horizontal-split" or "vertical-split".
show_prompt = false, -- Shows the prompt submitted to Ollama. Can be true (3 lines) or "full".
show_model = false, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
file = false, -- Write the payload to a temporary file to keep the command short.
hidden = false, -- Hide the generation window (if true, will implicitly set `prompt.replace = true`), requires Neovim >= 0.10
init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end,
-- Function to initialize Ollama
command = function(options)
local body = {model = options.model, stream = true}
return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
result_filetype = "markdown", -- Configure filetype of the result buffer
debug = false -- Prints errors and the command which is run.
}
}

View file

@ -0,0 +1,13 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = false,
config = function()
require("lualine").setup({
options = {
theme = "tokyonight",
globalstatus = true,
},
})
end,
}

View file

@ -0,0 +1,33 @@
return {
"nvim-neorg/neorg",
lazy = false,
version = "*",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Basismodule
["core.concealer"] = {}, -- Schönes Rendering
["core.dirman"] = { -- Workspace-Management
config = {
workspaces = {
notes = "~/Nextcloud/neorg",
},
default_workspace = "notes",
},
},
["core.qol.toc"] = {}, -- Table of Contents
},
})
-- ⛔ Standard-gO löschen
vim.keymap.del("n", "gO")
-- ✅ Neorg TOC auf gO binden
vim.keymap.set("n", "gO", "<cmd>Neorg toc<CR>", {
desc = "Neorg Table of Contents",
noremap = true,
silent = true,
})
end,
}

View file

@ -0,0 +1,9 @@
return {
"kyazdani42/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = false,
config = function()
require("nvim-tree").setup()
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>", { noremap = true, silent = true })
end,
}

View file

@ -0,0 +1,11 @@
return {
'nvim-orgmode/orgmode',
event = 'VeryLazy',
config = function()
-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/Nextcloud/org/**/*',
org_default_notes_file = '~/Nextcloud/org/refile.org',
})
end,
}

View file

@ -0,0 +1,11 @@
return {
'neovim/nvim-lspconfig',
event = 'BufReadPre',
dependencies = {
'williamboman/mason.nvim', -- Optional, but good for managing LSPs
'williamboman/mason-lspconfig.nvim', -- Integrates mason with lspconfig
},
config = function()
-- your lspconfig setup here
end
}

View file

@ -0,0 +1,9 @@
return {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
}

View file

@ -0,0 +1,13 @@
return {
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('telescope').setup()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find Files" })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "Live Grep" })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Find Buffers" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Help Tags" })
end
}

View file

@ -0,0 +1,10 @@
return {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup({ style = "night" })
vim.cmd("colorscheme tokyonight")
end,
}

View file

@ -0,0 +1,25 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
opts = {
ensure_installed = {
"lua",
"bash",
"markdown",
"norg",
"c",
"perl",
"python",
},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
}