about summary refs log tree commit diff
path: root/update_index.lua
diff options
context:
space:
mode:
authoriurii plugatarov <[email protected]>2024-08-02 23:14:43 +0200
committeriurii plugatarov <[email protected]>2024-08-02 23:14:43 +0200
commitd2f6073cb4e9c4026041288cd5cab2b2a0337c5a (patch)
treee56f52a63696410a3227e08577779a0a491a53bb /update_index.lua
parentf4a1319352d466308cd85eb1263aef9fd2c54293 (diff)
downloadsketchbook.nvim-d2f6073cb4e9c4026041288cd5cab2b2a0337c5a.tar.gz
move to lua dir
Diffstat (limited to 'update_index.lua')
-rw-r--r--update_index.lua22
1 files changed, 0 insertions, 22 deletions
diff --git a/update_index.lua b/update_index.lua
deleted file mode 100644
index 1a6044e..0000000
--- a/update_index.lua
+++ /dev/null
@@ -1,22 +0,0 @@
-local M = {}
-
-function M.update_index()
-  local notes_dir = vim.g.notes_directory or "~/notes/"
-  notes_dir = vim.fn.expand(notes_dir)
-  local index_file = notes_dir .. "index.md"
-  local notes = vim.fn.globpath(notes_dir, "*.md", false, true)
-  local content = { "# Index", "" }
-  for _, note in ipairs(notes) do
-    if vim.fn.fnamemodify(note, ":t") ~= "index.md" then
-      table.insert(content, "- [" .. vim.fn.fnamemodify(note, ":t:r") .. "](" .. note .. ")")
-    end
-  end
-  local file = io.open(index_file, "w")
-  for _, line in ipairs(content) do
-    file:write(line .. "\n")
-  end
-  file:close()
-  print "Index updated"
-end
-
-return M