Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Send A Neovim Buffer Filepath To An External Process

Example from a neovim plugin

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