Skip to content

Instantly share code, notes, and snippets.

View arfadmuzali's full-sized avatar

arfadmuzali arfadmuzali

View GitHub Profile
local function quickType(lang)
-- source from clipboard registry
local buf = vim.fn.getreg('+')
local tmp = vim.fn.tempname() .. '.json'
local f = io.open(tmp, 'w')
f:write(buf)
f:close()
local cmd = 'quicktype ' .. tmp .. ' --lang ' .. lang .. ' --just-types 2>&1'
local output = vim.fn.systemlist(cmd)