summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/_autocommands/init.lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-05-01 14:26:11 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-05-01 14:26:11 +0200
commitd2fc21ae088e0c078c39f7fb9f313b808e7e90b7 (patch)
tree443371c080af2a5ffca5c87799c0cd6f97948252 /.config/nvim/lua/_autocommands/init.lua
parent296b2245da8fda7c96080e96e238f97839e74411 (diff)
Removed bloat, added some sweet features, synced with Lunarvim repo
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
-})
+})