From e22718dfa30cf9b2987d17a7334bc47b0572b7a9 Mon Sep 17 00:00:00 2001 From: Pieter Joost van de Sande Date: Fri, 3 Jan 2025 13:19:12 +0100 Subject: [PATCH] nvim: open telescope if vim is opened without files or folder as an argument --- nvim/lua/chadrc.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua index 82045090..e6a786f5 100644 --- a/nvim/lua/chadrc.lua +++ b/nvim/lua/chadrc.lua @@ -20,4 +20,13 @@ vim.api.nvim_create_autocmd("BufWritePost", { command = "!killall -SIGUSR1 kitty", }) +-- Open telescope on startup if no files were passed +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + if #vim.fn.argv() == 0 then + require("telescope.builtin").find_files() + end + end, +}) + return M