mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-18 00:57:12 +00:00
Add autocommands to remove line numbers in the terminal buffer
This commit is contained in:
24
lua/setup/terminal.lua
Normal file
24
lua/setup/terminal.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- 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
|
||||
Reference in New Issue
Block a user