Files
dotFiles/.config/nvim/plugin/terminal.lua
Kulvir Singh 8c703b74f8 added stow
2024-09-26 02:39:46 +05:30

24 lines
641 B
Lua

local set = vim.opt_local
-- Set local settings for terminal buffers
vim.api.nvim_create_autocmd("TermOpen", {
group = vim.api.nvim_create_augroup("custom-term-open", {}),
callback = function()
set.number = false
set.relativenumber = false
set.scrolloff = 0
end,
})
-- 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()
vim.cmd.new()
vim.cmd.wincmd "J"
vim.api.nvim_win_set_height(0, 12)
vim.wo.winfixheight = true
vim.cmd.term()
end)