From 1d14e44126b153943abc8559e3c2a8ccce9fe931 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 19:00:29 -0500 Subject: [PATCH] add autocommands --- init.lua | 1 + lua/user/auocommands.lua | 32 ++++++++++++++++++++++++++++++++ lua/user/lualine.lua | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 lua/user/auocommands.lua diff --git a/init.lua b/init.lua index 7dc5c05..f8eec0f 100644 --- a/init.lua +++ b/init.lua @@ -18,3 +18,4 @@ require "user.impatient" require "user.indentline" require "user.alpha" require "user.whichkey" +require "user.auocommands" diff --git a/lua/user/auocommands.lua b/lua/user/auocommands.lua new file mode 100644 index 0000000..8433a46 --- /dev/null +++ b/lua/user/auocommands.lua @@ -0,0 +1,32 @@ +vim.cmd [[ + augroup _general_settings + autocmd! + autocmd FileType qf,help,man,lspinfo nnoremap q :close + autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}) + autocmd BufWinEnter * :set formatoptions-=cro + augroup end + + augroup _git + autocmd! + autocmd FileType gitcommit setlocal wrap + autocmd FileType gitcommit setlocal spell + augroup end + + augroup _markdown + autocmd! + autocmd FileType markdown setlocal wrap + autocmd FileType markdown setlocal spell + augroup end + + augroup _auto_resize + autocmd! + autocmd VimResized * tabdo wincmd = + augroup end + + augroup _alpha + autocmd! + autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 + augroup end + +]] + diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua index 50484cb..3318ecd 100644 --- a/lua/user/lualine.lua +++ b/lua/user/lualine.lua @@ -68,7 +68,7 @@ lualine.setup({ theme = "auto", component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, - disabled_filetypes = { "dashboard", "NvimTree", "Outline" }, + disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" }, always_divide_middle = true, }, sections = {