From: Edward Delaporte Date: Mon, 10 Feb 2025 21:20:49 +0000 (-0600) Subject: Add neovim journal config X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/bb2bdf021a4e7f79c7c2d9f8480c2f61ca24fa0f?ds=inline Add neovim journal config --- diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index 76dfcf5..ae447fe 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -51,6 +51,7 @@ $maybe_mods | ForEach-Object { } } +$env:nvim_config = "$HOME\AppData\Local\nvim" # Load local source modules # Import-Module $env:src\powershell-scripts\modules\MarkdownGitHub.psm1 diff --git a/files/neovim/nvjournal.lua b/files/neovim/nvjournal.lua new file mode 100644 index 0000000..6107aef --- /dev/null +++ b/files/neovim/nvjournal.lua @@ -0,0 +1,20 @@ +local function new_note() + local month = os.date("%m") + local input = vim.fn.input("Topic: ") + local linput = string.lower(input) + local cleaned_input = string.gsub(linput, " ", "-") + local filename = "~/Box/Journal/" .. month .. "-" .. cleaned_input .. ".md" + if #linput == 0 then + filename = "~/Box/Journal/" + end + vim.cmd("edit " .. filename) +end + +local function setup() + vim.api.nvim_create_user_command("Note", new_note, {}) +end + +return { + setup = setup, + new_note = new_note, +}