Add terminal settings
This commit is contained in:
parent
18b4f4429f
commit
23bad15ab1
|
@ -107,3 +107,9 @@ set("n", "<leader>et", function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
set("n", "<leader>ec", ":edit composer.json")
|
set("n", "<leader>ec", ":edit composer.json")
|
||||||
|
|
||||||
|
-- These mappings control the size of splits (height/width).
|
||||||
|
set("n", "<M-,>", "<c-w>5<")
|
||||||
|
set("n", "<M-.>", "<c-w>5>")
|
||||||
|
set("n", "<M-t>", "<C-W>+")
|
||||||
|
set("n", "<M-s>", "<C-W>-")
|
||||||
|
|
25
config/neovim/plugin/terminal.lua
Normal file
25
config/neovim/plugin/terminal.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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)
|
Loading…
Reference in a new issue