about summary refs log tree commit diff
path: root/lua/sketchbook/create_note.lua
diff options
context:
space:
mode:
authoriurii plugatarov <[email protected]>2024-08-03 01:23:05 +0200
committeriurii plugatarov <[email protected]>2024-08-03 01:23:05 +0200
commit8132961a78def44238bb257bd96f4774fc87ca84 (patch)
tree55280641a5ebcd4d0bd4217f648d7433cad5888e /lua/sketchbook/create_note.lua
parent614b50a5cd2efcd1d88aa72c5a36aa4ef238dbfd (diff)
downloadsketchbook.nvim-8132961a78def44238bb257bd96f4774fc87ca84.tar.gz
remove templating main
Diffstat (limited to 'lua/sketchbook/create_note.lua')
-rw-r--r--lua/sketchbook/create_note.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/lua/sketchbook/create_note.lua b/lua/sketchbook/create_note.lua
index d85e267..7bd2815 100644
--- a/lua/sketchbook/create_note.lua
+++ b/lua/sketchbook/create_note.lua
@@ -1,20 +1,20 @@
 local M = {}
 
 function M.create_new_note()
-  local notes_dir = vim.g.notes_directory or "~/notes/"
-  local filename = os.date "%Y-%m-%d_%H-%M-%S" .. ".md"
-  local filepath = vim.fn.expand(notes_dir) .. filename
-  local title = "Title " .. os.date "%Y-%m-%d %H:%M:%S"
-  local template = {
-    "# " .. title,
-    "",
-  }
-  local file = io.open(filepath, "w")
-  for _, line in ipairs(template) do
-    file:write(line .. "\n")
-  end
-  file:close()
-  vim.cmd("edit " .. filepath)
+	local notes_dir = vim.g.notes_directory or "~/notes/"
+	local filename = os.date("%Y-%m-%d_%H-%M-%S") .. ".md"
+	local filepath = vim.fn.expand(notes_dir) .. filename
+	local title = "Title " .. os.date("%Y-%m-%d %H:%M:%S")
+	local template = {
+		"# " .. title,
+		"",
+	}
+	local file = io.open(filepath, "w")
+	for _, line in ipairs(template) do
+		file:write(line .. "\n")
+	end
+	file:close()
+	vim.cmd("edit " .. filepath)
 end
 
 return M