From 5cd9f33cd2dcd7a54fc46a57fd5402ff1c1ea276 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 28 Nov 2023 18:49:44 +0100 Subject: nvim: Add s and S for creating scratch buffers --- .config/nvim/lua/mango/lib.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.config/nvim/lua/mango/lib.lua') diff --git a/.config/nvim/lua/mango/lib.lua b/.config/nvim/lua/mango/lib.lua index 5b46012..e062352 100644 --- a/.config/nvim/lua/mango/lib.lua +++ b/.config/nvim/lua/mango/lib.lua @@ -21,4 +21,16 @@ function M.remap(modes, from, to, opts) }) end +function M.scratch_buffer() + vim.cmd [[ + if bufexists('scratch') + buffer scratch + else + noswapfile hide enew + setlocal buftype=nofile bufhidden=hide + file scratch + endif + ]] +end + return M -- cgit v1.2.3