Skip to content

Instantly share code, notes, and snippets.

@vsl-iil
Created July 30, 2024 18:47
Show Gist options
  • Select an option

  • Save vsl-iil/4442816c3e1c7b7427e35e6260ea2f2b to your computer and use it in GitHub Desktop.

Select an option

Save vsl-iil/4442816c3e1c7b7427e35e6260ea2f2b to your computer and use it in GitHub Desktop.
NvChad-like terminal functionality for Neovim
local map = vim.api.nvim_set_keymap
-- convinient keybind for escaping terminal insert mode
map('t', '<C-x>', '<C-\\><C-n>', {noremap = true})
-- open horizontal or vertical split-terminal
map('n', '<leader>h', '<C-w>s<C-w>w:term<CR>i', {noremap = true})
map('n', '<leader>v', '<C-w>v<C-w>w:term<CR>i', {noremap = true})
-- disable line numbers in terminal
vim.api.nvim_create_autocmd(
{ "TermOpen"},
{ pattern = "*",
callback = function()
vim.wo.number = false
vim.wo.relativenumber = false
end,
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment