mirror of
https://github.com/arkorty/Neolite.git
synced 2026-05-07 10:02:15 +00:00
Add autocommands to remove line numbers in the terminal buffer
This commit is contained in:
parent
42c91dc2c7
commit
91b28340cb
2 changed files with 25 additions and 0 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue