From aab0bd1279a8a59102e9d13de3050fd7cd360d8c Mon Sep 17 00:00:00 2001 From: REmerald <55359236+REmerald@users.noreply.github.com> Date: Tue, 19 Jul 2022 13:31:50 +0000 Subject: [PATCH] Update autocommands.lua --- lua/user/autocommands.lua | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index c17c95d..603081b 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -41,25 +41,15 @@ vim.api.nvim_create_autocmd( "VimResized", {group = au_res, command = "tabdo wincmd ="} ) --- Autoformat --- local au_lsp = vim.api.nvim_create_augroup("_lsp", {clear = true}) --- vim.api.nvim_create_autocmd( --- "BufWritePre", {group = au_lsp, command = "lua vim.lsp.buf.formatting()"} --- ) - --- Using instead of | caused my neovim to either error out or remove tabline completely --- Which is really weird and must be a bug --- If it still happens to you anyways, use vim.cmd as a fallback local aulpha = vim.api.nvim_create_augroup("_alpha", {clear = true}) vim.api.nvim_create_autocmd( "User", {group = aulpha, pattern = "AlphaReady", command = "set showtabline=0 | autocmd BufUnload set showtabline=2" } ) --- autocmd! remove all autocommands, if entered under a group it will clear that group --- vim.cmd [[ --- augroup _alpha --- autocmd! --- autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 --- augroup end --- ]] + +-- Autoformat +-- local au_lsp = vim.api.nvim_create_augroup("_lsp", {clear = true}) +-- vim.api.nvim_create_autocmd( +-- "BufWritePre", {group = au_lsp, command = "lua vim.lsp.buf.formatting()"} +-- )