Files
dotFiles/.config/nvim/plugin/terminal.lua

24 lines
641 B
Lua
Raw Normal View History

2024-05-14 13:07:30 +05:30
local set = vim.opt_local
-- Set local settings for terminal buffers
vim.api.nvim_create_autocmd("TermOpen", {
2024-06-11 03:11:45 +05:30
group = vim.api.nvim_create_augroup("custom-term-open", {}),
callback = function()
set.number = false
set.relativenumber = false
set.scrolloff = 0
end,
2024-05-14 13:07:30 +05:30
})
-- Easily hit escape in terminal mode.
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
-- Open a terminal at the bottom of the screen with a fixed height.
vim.keymap.set("n", "<leader>st", function()
2024-06-11 03:11:45 +05:30
vim.cmd.new()
vim.cmd.wincmd "J"
vim.api.nvim_win_set_height(0, 12)
vim.wo.winfixheight = true
vim.cmd.term()
2024-05-14 13:07:30 +05:30
end)