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

Send A Neovim Buffer Filepath To An External Process

Example from a neovim plugin

August 2023
Code
local function export_to_file()
  local Job = require 'plenary.job'
  print("Exporting from: " .. vim.uri_from_bufnr(0))
  Job:new({
    command = 'grimoire_caster',
    args = { '--action', 'export_file', '--path', vim.uri_from_bufnr(0) },
    on_exit = function(job, return_val)
      print(vim.inspect(job:result()))
    end,
  }):sync()
  print("Exported from: " .. vim.uri_from_bufnr(0))
end

return {
  export_to_file = export_to_file
}
═══ § ═══

Footnotes And References