diff --git a/vim/lua/.luarc.json b/vim/lua/.luarc.json new file mode 100644 index 0000000..23b9ee2 --- /dev/null +++ b/vim/lua/.luarc.json @@ -0,0 +1,3 @@ +{ + "workspace.checkThirdParty": false +} \ No newline at end of file diff --git a/vim/lua/formatter_config.lua b/vim/lua/formatter_config.lua index 104781d..bc46884 100644 --- a/vim/lua/formatter_config.lua +++ b/vim/lua/formatter_config.lua @@ -7,10 +7,17 @@ local prettier = function() end require('formatter').setup({ + log_level = vim.log.levels.INFO, filetype = { javascript = { prettier }, typescript = { prettier }, typescriptreact = { prettier }, + + -- https://github.com/JohnnyMorganz/StyLua + -- cargo install stylua --features lua54 + lua = { + require("formatter.filetypes.lua").stylua + }, } }) @@ -18,7 +25,7 @@ require('formatter').setup({ vim.api.nvim_exec2([[ augroup FormatAutogroup autocmd! - autocmd BufWritePost *.js,*.ts,*.tsx silent FormatWrite + autocmd BufWritePost *.js,*.ts,*.tsx,*.lua silent FormatWrite augroup END ]], { output = true })