This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface A { | |
foo: { | |
bar: number; | |
}; | |
hee: { | |
hoo?: string; | |
haa?: { | |
test: number; | |
}[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Dump value of a variable in a formatted string | |
-- | |
--- @param o table Dumpable object | |
--- @param tbs string|nil Tabulation string, ' ' by default | |
--- @param tb number|nil Initial tabulation level, 0 by default | |
--- @return string | |
local function dump(o, tbs, tb) | |
tb = tb or 0 | |
tbs = tbs or ' ' | |
if type(o) == 'table' then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Format = function() | |
vim.api.nvim_command(":w") -- save first | |
local formatCmds = { -- these are just commands that formatting files next to them 'in-place' for each filetype | |
lua = 'lua-format --indent-width=2 --spaces-inside-table-braces -i', | |
go = 'gofmt -w', | |
javascript = 'prettier -w --loglevel error', | |
typescript = 'prettier -w --loglevel error', | |
javascriptreact = 'prettier -w --loglevel error', | |
typescriptreact = 'prettier -w --loglevel error', |