diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-28 18:49:44 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-28 18:51:50 +0100 |
commit | 5cd9f33cd2dcd7a54fc46a57fd5402ff1c1ea276 (patch) | |
tree | 90a71cd04df41cf44c77dfb2177b257e1bbd5ae3 /.config/nvim/lua/mango/lib.lua | |
parent | 8b9a6b26b520bbbdb462c15f0b2bcbbd22856fc9 (diff) |
nvim: Add <leader>s and <leader>S for creating scratch buffers
Diffstat (limited to '.config/nvim/lua/mango/lib.lua')
-rw-r--r-- | .config/nvim/lua/mango/lib.lua | 12 |
1 files changed, 12 insertions, 0 deletions
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 |