wrote source code
This commit is contained in:
BIN
lua/.DS_Store
vendored
Normal file
BIN
lua/.DS_Store
vendored
Normal file
Binary file not shown.
67
lua/config/dashboard.lua
Normal file
67
lua/config/dashboard.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
local M = {}
|
||||
|
||||
-- Hilfsfunktion zum Zeichnen des Menüs
|
||||
local function draw_menu(lines, keymaps)
|
||||
local buf = vim.api.nvim_create_buf(false, true)
|
||||
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
|
||||
vim.api.nvim_set_current_buf(buf)
|
||||
|
||||
-- Lokale Einstellungen für das Menü-Fenster
|
||||
vim.opt_local.number = false
|
||||
vim.opt_local.relativenumber = false
|
||||
vim.opt_local.buftype = "nofile"
|
||||
vim.opt_local.bufhidden = "wipe"
|
||||
vim.opt_local.cursorline = true
|
||||
|
||||
-- Keymaps für dieses Menü setzen
|
||||
local opts = { buffer = buf, noremap = true, silent = true }
|
||||
for key, cmd in pairs(keymaps) do
|
||||
vim.keymap.set("n", key, cmd, opts)
|
||||
end
|
||||
end
|
||||
|
||||
-- Das Plugin-Untermenü (wird bei 'p' aufgerufen)
|
||||
function M.open_plugins_menu()
|
||||
local lines = {
|
||||
" PLUGINS VERWALTEN",
|
||||
"========================",
|
||||
"",
|
||||
" [u] Update (Sync)",
|
||||
" [i] Install",
|
||||
" [a] Add (Öffne Liste)",
|
||||
" [b] Zurück",
|
||||
"",
|
||||
"========================",
|
||||
}
|
||||
local keys = {
|
||||
u = ":PaqSync<CR>",
|
||||
i = ":PaqInstall<CR>",
|
||||
a = ":edit ~/.config/nvim/lua/plugins.lua<CR>",
|
||||
b = function() M.open() end, -- Geht zurück zum Hauptmenü
|
||||
}
|
||||
draw_menu(lines, keys)
|
||||
end
|
||||
|
||||
-- Das Hauptmenü
|
||||
function M.open()
|
||||
local lines = {
|
||||
" Mono VIM - 0.16",
|
||||
"========================",
|
||||
"",
|
||||
" [n] New File",
|
||||
" [r] Recent Files",
|
||||
" [p] Plugins...",
|
||||
" [q] Quit",
|
||||
"",
|
||||
"========================",
|
||||
}
|
||||
local keys = {
|
||||
n = ":ene | startinsert<CR>",
|
||||
r = ":oldfiles<CR>",
|
||||
p = function() M.open_plugins_menu() end,
|
||||
q = ":q!<CR>",
|
||||
}
|
||||
draw_menu(lines, keys)
|
||||
end
|
||||
|
||||
return M
|
||||
18
lua/core/update.lua
Normal file
18
lua/core/update.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- ~/.config/nvim/lua/monovim/updater.lua
|
||||
local M = {}
|
||||
|
||||
M.update = function()
|
||||
print("MonoVim Core wird aktualisiert...")
|
||||
local config_path = vim.fn.stdpath("config")
|
||||
local handle = io.popen("cd " .. config_path .. " && git pull 2>&1")
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
if result:find("Already up to date") then
|
||||
print("MonoVim ist bereits aktuell.")
|
||||
else
|
||||
print("Update erfolgreich! Bitte neu starten.")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
7
lua/plugins.lua
Normal file
7
lua/plugins.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"savq/paq-nvim", -- Der Manager selbst
|
||||
"neovim/nvim-lspconfig", -- LSP Support
|
||||
"nvim-treesitter/nvim-treesitter", -- Syntax Highlighting
|
||||
"tpope/vim-fugitive",
|
||||
"echasnovski/mini.nvim",
|
||||
}
|
||||
Reference in New Issue
Block a user