aboutsummaryrefslogtreecommitdiff
path: root/fnl/settings.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/settings.fnl')
-rw-r--r--fnl/settings.fnl16
1 files changed, 16 insertions, 0 deletions
diff --git a/fnl/settings.fnl b/fnl/settings.fnl
new file mode 100644
index 0000000..0a4178c
--- /dev/null
+++ b/fnl/settings.fnl
@@ -0,0 +1,16 @@
+(local path (.. (vim.fn.stdpath :data) :/_owo_))
+
+(lambda _get [_ key]
+ (local file (io.open (.. path key) :rb))
+ (when (= file nil) nil)
+
+ (local value (file:read :*a))
+ (io.close file)
+ value)
+
+(lambda _set [_ key value]
+ (local file (io.open (.. path key) :w))
+ (file:write value)
+ (io.close file))
+
+(setmetatable {} {:__index _get :__newindex _set})