summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/_autocommands/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/_autocommands/init.lua')
-rw-r--r--.config/nvim/lua/_autocommands/init.lua8
1 files changed, 6 insertions, 2 deletions
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 <silent> <buffer> q :q<CR>'},
},
_auto_formatters = auto_formatters
-})
+})