diff options
author | Squibid <me@zacharyscheiman.com> | 2023-07-18 09:25:40 +0000 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-07-18 09:25:40 +0000 |
commit | 20ef83bcaaf46b45571879915e6df957a15e2504 (patch) | |
tree | 19e4ea2642d23f2a5f485832555de251f605a12e /lua/modules/buf.lua | |
download | git-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.tar.gz git-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.tar.bz2 git-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.zip |
aaa
Diffstat (limited to '')
-rw-r--r-- | lua/modules/buf.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/modules/buf.lua b/lua/modules/buf.lua new file mode 100644 index 0000000..458e202 --- /dev/null +++ b/lua/modules/buf.lua @@ -0,0 +1,15 @@ +local M = {} + +function M.create(a, b, n) + local buf = vim.api.nvim_create_buf(a, b) + vim.api.nvim_buf_set_name(buf, n) + return buf +end + +function M.lock(a) + a.nvim_buf_set_option(a, 'readonly', true) + a.nvim_buf_set_option(a, 'modifiable', false) + a.nvim_buf_set_option(a, 'modified', false) +end + +return M |