commit 0bec76456770b03563fc7065b59713b3a96b71e8
parent dc67ce001c20f542bb371a3118cb1319cc3cf38f
Author: Andrew Laack <andrew@laack.co>
Date: Sun, 24 May 2026 15:04:40 -0500
Started working on listing / reading md files
Diffstat:
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/plugin/init.lua b/plugin/init.lua
@@ -1,3 +1,33 @@
-print('testing init')
+function flash()
+ local cwd = vim.fn.getcwd()
+ local files = vim.split(vim.fn.glob(cwd .. "/*.md"), "\n")
-vim.keymap.set("n", "asdf", ":echo \"hello\" <N>")
+ local buf = vim.api.nvim_create_buf(false, true)
+ local currentWin = vim.api.nvim_get_current_win()
+
+ local row = 0
+ local col = 0
+
+ local width = vim.fn.winwidth(currentWin)
+ local height = vim.fn.winheight(currentWin)
+
+ local opts = {
+ width = width,
+ height = height,
+ row = row,
+ col = col,
+ border = "rounded",
+ relative = "win",
+ title = "Flashcards",
+ title_pos = "center"
+ }
+
+ local _ = vim.api.nvim_open_win(buf, true, opts)
+
+ local file = vim.fn.readfile(files[1])
+ vim.api.nvim_buf_set_lines(buf, 0, 10, false, file)
+
+
+end
+
+vim.api.nvim_create_user_command('Flash', flash, {})