mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-18 09:02:29 +00:00
25 lines
870 B
Lua
25 lines
870 B
Lua
-- autocommands: disable line numbers when a terminal buffer is open
|
|
-- This function is taken from https://github.com/norcalli/nvim_utils
|
|
local function nvim_create_augroups(definitions)
|
|
for group_name, definition in pairs(definitions) do
|
|
vim.api.nvim_command("augroup " .. group_name)
|
|
vim.api.nvim_command("autocmd!")
|
|
for _, def in ipairs(definition) do
|
|
local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
|
|
vim.api.nvim_command(command)
|
|
end
|
|
vim.api.nvim_command("augroup END")
|
|
end
|
|
end
|
|
|
|
local autocmds = {
|
|
terminal_job = {
|
|
{ "TermOpen", "*", [[tnoremap <buffer> <Esc> <c-\><c-n>]] },
|
|
{ "TermOpen", "*", "startinsert" },
|
|
{ "TermOpen", "*", "setlocal listchars= nonumber norelativenumber" },
|
|
},
|
|
}
|
|
|
|
nvim_create_augroups(autocmds)
|
|
-- autocommands END
|