home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

Source A File Every Time It's Saved In Neovim

This is what I'm using when I'm working on Lua script for Neovim. It sources/reloads the file every time I save it.

NOTE: THIS ISN"T CURRNET WORKING

October 2023
Code
function start_source_buffer_on_save()
  print("Activated start_source_buffer_on_save")
  vim.api.nvim_create_autocmd("BufWritePost", {
    group = vim.api.nvim_create_augroup("AutoRunCurrentFile", { clear = true }),
    pattern = vim.api.nvim_buf_get_name(0),
    callback = function()
      vim.cmd("so %")
      -- print("got save")
    end,
  })
end

start_source_buffer_on_save()
═══ § ═══