From 345feb68e83fdcfca389135003a42f6c3ff1a59a Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Mon, 9 Mar 2026 10:07:05 +0100 Subject: Neovim: Bessere Ausnutzung von lazy.nvim --- nvim/init.lua | 1 - nvim/lua/config/keymaps.lua | 26 -------------------------- nvim/lua/plugins/editing.lua | 4 ++-- nvim/lua/plugins/telescope.lua | 7 +++++++ nvim/lua/plugins/treesitter.lua | 3 ++- 5 files changed, 11 insertions(+), 30 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 9630b9d..c9bdaf1 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -2,7 +2,6 @@ require("config.options") local keymaps = require("config.keymaps") keymaps.global() -keymaps.telescope() require("config.autocmds") require("config.lazy") diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 123e039..b193d5c 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -42,32 +42,6 @@ function M.lsp(buffer, client) set_python_bindings() end -function M.telescope() - local opts = { - silent = true, - } - - map("n", "ff", function() - require("telescope.builtin").find_files() - end, opts) - - map("n", "fg", function() - require("telescope.builtin").live_grep() - end, opts) - - map("n", "fb", function() - require("telescope.builtin").buffers() - end, opts) - - map("n", "fh", function() - require("telescope.builtin").help_tags() - end, opts) - - map("n", "dd", function() - require("telescope.builtin").diagnostics() - end, opts) -end - function M.gitsigns() map("n", "tb", require("gitsigns").toggle_current_line_blame) end diff --git a/nvim/lua/plugins/editing.lua b/nvim/lua/plugins/editing.lua index 4a80d2b..d1c3447 100644 --- a/nvim/lua/plugins/editing.lua +++ b/nvim/lua/plugins/editing.lua @@ -1,6 +1,6 @@ return { - { "tpope/vim-repeat" }, - { "tpope/vim-surround" }, + { "tpope/vim-repeat", event = "VeryLazy" }, + { "tpope/vim-surround", event = "VeryLazy" }, { "romainl/vim-cool", diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 7633892..8c2cae5 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -5,5 +5,12 @@ return { "nvim-lua/plenary.nvim", }, lazy = true, + keys = { + { "ff", "Telescope find_files", desc = "Find files" }, + { "fg", "Telescope live_grep", desc = "Live grep" }, + { "fb", "Telescope buffers", desc = "Buffers" }, + { "fh", "Telescope help_tags", desc = "Help tags" }, + { "dd", "Telescope diagnostics", desc = "Diagnostics" }, + }, }, } diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 235c0b5..66cd717 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -9,7 +9,8 @@ return { "nvim-treesitter/nvim-treesitter", branch = "main", build = ":TSUpdate", - lazy = false, + event = "BufReadPost", + lazy = true, config = function() local treesitter = require("nvim-treesitter") local langs = require("config.treesitter").languages -- cgit v1.3