From 5b7665557d5c67520b47f9601e68b6589809e9f9 Mon Sep 17 00:00:00 2001 From: gutz430 Date: Tue, 11 Feb 2025 11:28:09 +0100 Subject: [PATCH] first commit --- init.lua | 22 ++++++++++++++++++++++ lazy-lock.json | 12 ++++++++++++ lua/config/lazy.lua | 19 +++++++++++++++++++ lua/plugins/cattpuccin.lua | 9 +++++++++ lua/plugins/lazygit.lua | 19 +++++++++++++++++++ lua/plugins/lualine.lua | 11 +++++++++++ lua/plugins/neo-tree.lua | 10 ++++++++++ lua/plugins/telescope.lua | 3 +++ lua/plugins/treesitter.lua | 13 +++++++++++++ 9 files changed, 118 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/config/lazy.lua create mode 100644 lua/plugins/cattpuccin.lua create mode 100644 lua/plugins/lazygit.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/neo-tree.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/treesitter.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..5634941 --- /dev/null +++ b/init.lua @@ -0,0 +1,22 @@ +-- vim config +vim.g.mapleader = " " -- Leertaste wird als leader konfiguriert +vim.cmd("set expandtab") -- Tabs werden als zwei leerzeichen konfiguriert +vim.cmd("set tabstop=2") +vim.cmd("set softtabstop=2") +vim.cmd("set shiftwidth=2") + +require("config.lazy") + +-- Keybinds + +-- Telescope +vim.keymap.set('n', 'ff', ':Telescope find_files', { desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg', ':Telescope live_grep', { desc = 'Telescope live grep' }) + +-- Neotree +vim.keymap.set('n', 'n', ':Neotree filesystem toggle left') +vim.cmd("Neotree filesystem toggle left") + +-- Lazygit +vim.keymap.set('n', 'lg', ':LazyGit') + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..68c1490 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,12 @@ +{ + "catppuccin": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-treesitter": { "branch": "master", "commit": "39904fd016120d87010a93ccb9845c821ba2f1dd" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..7ac525f --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,19 @@ +-- Installiert Lazy, wenn es noch nicht installiert ist +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Initialisiert Plugins mit config Dateien unter ~/.config/nvim/lua/plugins/*.lua +require("lazy").setup("plugins") diff --git a/lua/plugins/cattpuccin.lua b/lua/plugins/cattpuccin.lua new file mode 100644 index 0000000..00e5f5f --- /dev/null +++ b/lua/plugins/cattpuccin.lua @@ -0,0 +1,9 @@ +return { + { "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function () + vim.cmd.colorscheme "catppuccin" + end + } +} diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua new file mode 100644 index 0000000..9936e91 --- /dev/null +++ b/lua/plugins/lazygit.lua @@ -0,0 +1,19 @@ +return { + { "kdheepak/lazygit.nvim", + lazy = true, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + }, + config = function() + require("telescope").load_extension("lazygit") + end, + } +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..365b64e --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,11 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup({ + options = { + theme = "dracula" + } + }) + end +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..944c3d6 --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -0,0 +1,10 @@ +return { + { "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + } + } +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..ccaa7d5 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,3 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', dependencies = { 'nvim-lua/plenary.nvim' } + } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..9d63691 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,13 @@ +return { + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { "lua", "vim", "yaml" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end + } +}