changed language to english
This commit is contained in:
62
init.lua
62
init.lua
@@ -1,5 +1,11 @@
|
|||||||
-- ~/.config/nvim/init.lua
|
-- ~/.config/nvim/init.lua
|
||||||
|
|
||||||
|
-- =============================================================================
|
||||||
|
-- 0. LANGUAGE SETTINGS (Set UI to English)
|
||||||
|
-- =============================================================================
|
||||||
|
vim.opt.langmenu = "en_US.UTF-8"
|
||||||
|
pcall(vim.cmd, "language en_US.UTF-8")
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 1. BOOTSTRAP PAQ (Plugin Manager Installation)
|
-- 1. BOOTSTRAP PAQ (Plugin Manager Installation)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
@@ -7,13 +13,13 @@ local data_path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/"
|
|||||||
local paq_path = data_path .. "paq-nvim"
|
local paq_path = data_path .. "paq-nvim"
|
||||||
|
|
||||||
if vim.fn.empty(vim.fn.glob(paq_path)) > 0 then
|
if vim.fn.empty(vim.fn.glob(paq_path)) > 0 then
|
||||||
print("Installiere Paq...")
|
print("Installing Paq...")
|
||||||
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", paq_path })
|
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", paq_path })
|
||||||
vim.cmd("packadd paq-nvim")
|
vim.cmd("packadd paq-nvim")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 2. PLUGINS LADEN & AUTO-INSTALL
|
-- 2. LOAD PLUGINS & AUTO-INSTALL
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
local plugins = require("plugins")
|
local plugins = require("plugins")
|
||||||
local paq = require("paq")
|
local paq = require("paq")
|
||||||
@@ -30,12 +36,12 @@ for _, plugin in ipairs(plugins) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if missing_plugins then
|
if missing_plugins then
|
||||||
print("Neue Plugins gefunden. Installiere... Bitte danach Neovim neu starten.")
|
print("New plugins found. Installing... Please restart Neovim afterwards.")
|
||||||
paq.install()
|
paq.install()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 3. EDITOR OPTIONEN (A11y / Screenreader optimiert)
|
-- 3. EDITOR OPTIONS (A11y / Screenreader optimized)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
opt.number = false
|
opt.number = false
|
||||||
@@ -47,31 +53,31 @@ opt.showmode = false
|
|||||||
opt.mouse = ""
|
opt.mouse = ""
|
||||||
opt.shortmess:append("atI")
|
opt.shortmess:append("atI")
|
||||||
opt.hidden = true
|
opt.hidden = true
|
||||||
opt.termguicolors = true -- Wichtig für moderne LSPs/UI
|
opt.termguicolors = true -- Important for modern LSPs/UI
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 4. DIAGNOSTICS (Fehleranzeige)
|
-- 4. DIAGNOSTICS (Error display)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = false, -- Kein Text-Rauschen in der Zeile
|
virtual_text = false, -- No text noise in the line
|
||||||
underline = true, -- Fehler werden unterstrichen
|
underline = true, -- Errors are underlined
|
||||||
signs = false, -- Keine Icons am Rand (weniger Lärm)
|
signs = false, -- No icons on the edge (less noise)
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 5. KEYMAPS (Leader: Leertaste)
|
-- 5. KEYMAPS (Leader: Space)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
-- Fehlerliste (Quickfix) öffnen
|
-- Open error list (Quickfix)
|
||||||
vim.keymap.set("n", "<leader>e", vim.diagnostic.setqflist, { desc = "Fehlerliste zeigen" })
|
vim.keymap.set("n", "<leader>e", vim.diagnostic.setqflist, { desc = "Show error list" })
|
||||||
|
|
||||||
-- Dashboard öffnen
|
-- Open dashboard
|
||||||
vim.keymap.set("n", "<leader>b", function()
|
vim.keymap.set("n", "<leader>b", function()
|
||||||
local ok, dashboard = pcall(require, "config.dashboard")
|
local ok, dashboard = pcall(require, "config.dashboard")
|
||||||
if ok then dashboard.open() else print("Dashboard nicht gefunden!") end
|
if ok then dashboard.open() else print("Dashboard not found!") end
|
||||||
end, { desc = "Zurück zum Dashboard" })
|
end, { desc = "Back to dashboard" })
|
||||||
|
|
||||||
-- Core Update
|
-- Core Update
|
||||||
local ok_up, updater = pcall(require, "core.update")
|
local ok_up, updater = pcall(require, "core.update")
|
||||||
@@ -80,7 +86,7 @@ if ok_up then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 6. MASON & LSP SETUP (VERZÖGERT FÜR STABILITÄT)
|
-- 6. MASON & LSP SETUP (DELAYED FOR STABILITY)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
local ok_mason, mason = pcall(require, "mason")
|
local ok_mason, mason = pcall(require, "mason")
|
||||||
@@ -96,14 +102,14 @@ vim.schedule(function()
|
|||||||
ensure_installed = { "basedpyright", "rust_analyzer", "lua_ls" },
|
ensure_installed = { "basedpyright", "rust_analyzer", "lua_ls" },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Sicherheitscheck: Existiert die Funktion wirklich?
|
-- Security check: Does the function really exist?
|
||||||
if mason_lspconfig.setup_handlers then
|
if mason_lspconfig.setup_handlers then
|
||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
-- Standard-Handler für jeden installierten Server
|
-- Default handler for each installed server
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local opts = {}
|
local opts = {}
|
||||||
|
|
||||||
-- Falls nvim-cmp für Autovervollständigung genutzt wird
|
-- If nvim-cmp is used for autocompletion
|
||||||
local ok_cmp, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
local ok_cmp, cmp_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
if ok_cmp then
|
if ok_cmp then
|
||||||
opts.capabilities = cmp_lsp.default_capabilities()
|
opts.capabilities = cmp_lsp.default_capabilities()
|
||||||
@@ -112,7 +118,7 @@ vim.schedule(function()
|
|||||||
lspconfig[server_name].setup(opts)
|
lspconfig[server_name].setup(opts)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- Spezial-Konfiguration für Lua (verhindert 'vim' Warnungen)
|
-- Special configuration for Lua (prevents 'vim' warnings)
|
||||||
["lua_ls"] = function()
|
["lua_ls"] = function()
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
settings = {
|
settings = {
|
||||||
@@ -130,16 +136,16 @@ local ok_oil, oil = pcall(require, "oil")
|
|||||||
if ok_oil then
|
if ok_oil then
|
||||||
oil.setup({
|
oil.setup({
|
||||||
default_file_explorer = true,
|
default_file_explorer = true,
|
||||||
columns = { "icon" }, -- Du kannst "icon" auch löschen für puren Text
|
columns = { "icon" }, -- You can also delete "icon" for pure text
|
||||||
view_options = {
|
view_options = {
|
||||||
show_hidden = true,
|
show_hidden = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Keymap: Leertaste + f (File)
|
-- Keymap: Space + f (File)
|
||||||
vim.keymap.set("n", "<leader>f", "<CMD>Oil<CR>", { desc = "Öffne File Manager" })
|
vim.keymap.set("n", "<leader>f", "<CMD>Oil<CR>", { desc = "Open File Manager" })
|
||||||
end
|
end
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- 7. BUFFER MANAGEMENT & DASHBOARD LOGIK
|
-- 7. BUFFER MANAGEMENT & DASHBOARD LOGIC
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
local ok_mini, bufremove = pcall(require, "mini.bufremove")
|
local ok_mini, bufremove = pcall(require, "mini.bufremove")
|
||||||
if ok_mini then bufremove.setup({}) end
|
if ok_mini then bufremove.setup({}) end
|
||||||
@@ -154,10 +160,10 @@ local function force_dashboard()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Buffer schließen (Speichern-Abfrage integriert)
|
-- Close buffer (integrated save prompt)
|
||||||
vim.keymap.set("n", "<leader>d", function()
|
vim.keymap.set("n", "<leader>d", function()
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
local choice = vim.fn.confirm("Änderungen speichern?", "&Ja\n&Nein\n&Abbrechen", 1)
|
local choice = vim.fn.confirm("Save changes?", "&Yes\n&No\n&Cancel", 1)
|
||||||
if choice == 1 then
|
if choice == 1 then
|
||||||
vim.cmd("write")
|
vim.cmd("write")
|
||||||
elseif choice == 3 then
|
elseif choice == 3 then
|
||||||
@@ -170,9 +176,9 @@ vim.keymap.set("n", "<leader>d", function()
|
|||||||
else
|
else
|
||||||
vim.cmd("bd!")
|
vim.cmd("bd!")
|
||||||
end
|
end
|
||||||
end, { desc = "Buffer schließen" })
|
end, { desc = "Close buffer" })
|
||||||
|
|
||||||
-- Autocommands für Dashboard (beim Start und beim Löschen von Buffern)
|
-- Autocommands for Dashboard (on startup and when deleting buffers)
|
||||||
vim.api.nvim_create_autocmd({ "VimEnter", "BufDelete" }, {
|
vim.api.nvim_create_autocmd({ "VimEnter", "BufDelete" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
force_dashboard()
|
force_dashboard()
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
-- Hilfsfunktion zum Zeichnen des Menüs
|
-- Helper function to draw the menu
|
||||||
local function draw_menu(lines, keymaps)
|
local function draw_menu(lines, keymaps)
|
||||||
local buf = vim.api.nvim_create_buf(false, true)
|
local buf = vim.api.nvim_create_buf(false, true)
|
||||||
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
|
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
|
||||||
vim.api.nvim_set_current_buf(buf)
|
vim.api.nvim_set_current_buf(buf)
|
||||||
|
|
||||||
-- Lokale Einstellungen für das Menü-Fenster
|
-- Local settings for the menu window
|
||||||
vim.opt_local.number = false
|
vim.opt_local.number = false
|
||||||
vim.opt_local.relativenumber = false
|
vim.opt_local.relativenumber = false
|
||||||
vim.opt_local.buftype = "nofile"
|
vim.opt_local.buftype = "nofile"
|
||||||
vim.opt_local.bufhidden = "wipe"
|
vim.opt_local.bufhidden = "wipe"
|
||||||
vim.opt_local.cursorline = true
|
vim.opt_local.cursorline = true
|
||||||
|
|
||||||
-- Keymaps für dieses Menü setzen
|
-- Set keymaps for this menu
|
||||||
local opts = { buffer = buf, noremap = true, silent = true }
|
local opts = { buffer = buf, noremap = true, silent = true }
|
||||||
for key, cmd in pairs(keymaps) do
|
for key, cmd in pairs(keymaps) do
|
||||||
vim.keymap.set("n", key, cmd, opts)
|
vim.keymap.set("n", key, cmd, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Das Plugin-Untermenü (wird bei 'p' aufgerufen)
|
-- The plugin sub-menu (called with 'p')
|
||||||
function M.open_plugins_menu()
|
function M.open_plugins_menu()
|
||||||
local lines = {
|
local lines = {
|
||||||
" PLUGINS VERWALTEN",
|
" MANAGE PLUGINS",
|
||||||
"========================",
|
"========================",
|
||||||
"",
|
"",
|
||||||
" [u] Update (Sync)",
|
" [u] Update (Sync)",
|
||||||
" [i] Install",
|
" [i] Install",
|
||||||
" [a] Add (Öffne Liste)",
|
" [a] Add (Open List)",
|
||||||
" [b] Zurück",
|
" [b] Back",
|
||||||
"",
|
"",
|
||||||
"========================",
|
"========================",
|
||||||
}
|
}
|
||||||
@@ -37,12 +37,12 @@ function M.open_plugins_menu()
|
|||||||
u = ":PaqSync<CR>",
|
u = ":PaqSync<CR>",
|
||||||
i = ":PaqInstall<CR>",
|
i = ":PaqInstall<CR>",
|
||||||
a = ":edit ~/.config/nvim/lua/plugins.lua<CR>",
|
a = ":edit ~/.config/nvim/lua/plugins.lua<CR>",
|
||||||
b = function() M.open() end, -- Geht zurück zum Hauptmenü
|
b = function() M.open() end, -- Returns to the main menu
|
||||||
}
|
}
|
||||||
draw_menu(lines, keys)
|
draw_menu(lines, keys)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Das Hauptmenü
|
-- The main menu
|
||||||
function M.open()
|
function M.open()
|
||||||
local lines = {
|
local lines = {
|
||||||
" Mono VIM - 0.17",
|
" Mono VIM - 0.17",
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.update = function()
|
M.update = function()
|
||||||
print("MonoVim Core wird aktualisiert...")
|
print("Updating MonoVim Core...")
|
||||||
local config_path = vim.fn.stdpath("config")
|
local config_path = vim.fn.stdpath("config")
|
||||||
local handle = io.popen("cd " .. config_path .. " && git pull 2>&1")
|
local handle = io.popen("cd " .. config_path .. " && git pull 2>&1")
|
||||||
local result = handle:read("*a")
|
local result = handle:read("*a")
|
||||||
handle:close()
|
handle:close()
|
||||||
|
|
||||||
if result:find("Already up to date") then
|
if result:find("Already up to date") then
|
||||||
print("MonoVim ist bereits aktuell.")
|
print("MonoVim is already up to date.")
|
||||||
else
|
else
|
||||||
print("Update erfolgreich! Bitte neu starten.")
|
print("Update successful! Please restart.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
"savq/paq-nvim", -- Der Manager selbst
|
"savq/paq-nvim", -- The manager itself
|
||||||
"neovim/nvim-lspconfig", -- LSP Support
|
"neovim/nvim-lspconfig", -- LSP Support
|
||||||
"nvim-treesitter/nvim-treesitter", -- Syntax Highlighting
|
"nvim-treesitter/nvim-treesitter", -- Syntax Highlighting
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
|
|||||||
Reference in New Issue
Block a user