dotfiles/nvim/plugin/terminal.lua
Oliver Davies 69a397e624 Move Nix files into a nix directory
Move everything from `config` to the root level.
2024-11-21 08:56:12 +00:00

26 lines
640 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
vim.bo.filetype = "terminal"
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", ",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)