Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created March 24, 2015 03:56
Show Gist options
  • Save nefftd/c9d4bb93e41415087a7b to your computer and use it in GitHub Desktop.
Save nefftd/c9d4bb93e41415087a7b to your computer and use it in GitHub Desktop.
local buffer = vim.buffer()
local data = {}
for i = 1,#buffer do
-- NOTE: buffer is a userdata; must be copied into array
data[i] = buffer[i]
end
data = table.concat(data,'\n') -- join the table into a string, separated by new lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment