From d2fc21ae088e0c078c39f7fb9f313b808e7e90b7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 1 May 2021 14:26:11 +0200 Subject: Removed bloat, added some sweet features, synced with Lunarvim repo --- .config/nvim/lua/_autocommands/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.config/nvim/lua/_autocommands') diff --git a/.config/nvim/lua/_autocommands/init.lua b/.config/nvim/lua/_autocommands/init.lua index a94cb0f..1642127 100644 --- a/.config/nvim/lua/_autocommands/init.lua +++ b/.config/nvim/lua/_autocommands/init.lua @@ -7,9 +7,13 @@ if O.python.autoformat then table.insert(auto_formatters, python_autoformat) end local javascript_autoformat = {'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} local javascriptreact_autoformat = {'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} +local typescript_autoformat = {'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} +local typescriptreact_autoformat = {'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} if O.tsserver.autoformat then table.insert(auto_formatters, javascript_autoformat) table.insert(auto_formatters, javascriptreact_autoformat) + table.insert(auto_formatters, typescript_autoformat) + table.insert(auto_formatters, typescriptreact_autoformat) end local lua_format = {'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} @@ -20,7 +24,7 @@ if O.json.autoformat then table.insert(auto_formatters, json_format) end utils.define_augroups({ _general_settings = { - {'TextYankPost','*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, + {'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, {'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, @@ -51,4 +55,4 @@ utils.define_augroups({ {'FileType', 'floaterm', 'nnoremap q :q'}, }, _auto_formatters = auto_formatters -}) +}) -- cgit v1.2.3-70-g09d2