summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua2
-rw-r--r--lua/lvim/core/autocmds.lua65
2 files changed, 36 insertions, 31 deletions
diff --git a/init.lua b/init.lua
index 97a1780c..cd7c6598 100644
--- a/init.lua
+++ b/init.lua
@@ -19,5 +19,3 @@ local commands = require "lvim.core.commands"
commands.load(commands.defaults)
require("lvim.lsp").setup()
-
-vim.opt.laststatus = 3
diff --git a/lua/lvim/core/autocmds.lua b/lua/lvim/core/autocmds.lua
index acacc1b4..e8135fc4 100644
--- a/lua/lvim/core/autocmds.lua
+++ b/lua/lvim/core/autocmds.lua
@@ -32,35 +32,6 @@ function M.load_defaults()
end,
})
- vim.api.nvim_create_autocmd({ "FileType" }, {
- pattern = {
- "alpha",
- },
- callback = function()
- vim.cmd [[
- nnoremap <silent> <buffer> q :qa<CR>
- nnoremap <silent> <buffer> <esc> :qa<CR>
- set nobuflisted
- ]]
- end,
- })
-
- vim.api.nvim_create_autocmd({ "FileType" }, {
- pattern = { "lir" },
- callback = function()
- vim.opt_local.number = false
- vim.opt_local.relativenumber = false
- end,
- })
-
- -- TODO: figure out what keeps overriding laststatus
- vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
- pattern = { "*" },
- callback = function()
- vim.opt.laststatus = 3
- end,
- })
-
local definitions = {
{
"TextYankPost",
@@ -124,6 +95,42 @@ function M.load_defaults()
command = "tabdo wincmd =",
},
},
+ {
+ "FileType",
+ {
+ group = "_filetype_settings",
+ pattern = "alpha",
+ callback = function()
+ vim.cmd [[
+ nnoremap <silent> <buffer> q :qa<CR>
+ nnoremap <silent> <buffer> <esc> :qa<CR>
+ set nobuflisted
+ ]]
+ end,
+ },
+ },
+ {
+ "FileType",
+ {
+ group = "_filetype_settings",
+ pattern = "lir",
+ callback = function()
+ vim.opt_local.number = false
+ vim.opt_local.relativenumber = false
+ end,
+ },
+ },
+ -- TODO: figure out what keeps overriding laststatus
+ {
+ "BufWinEnter",
+ {
+ group = "_last_status",
+ pattern = "*",
+ callback = function()
+ vim.opt.laststatus = 3
+ end,
+ },
+ },
}
M.define_autocmds(definitions)