add: nvchad
This commit is contained in:
parent
0001c26dcd
commit
4430232787
11 changed files with 845 additions and 8 deletions
29
pkgs/nvchad/custom/term.lua
Normal file
29
pkgs/nvchad/custom/term.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
|
||||
local M = {}
|
||||
|
||||
M.lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "double",
|
||||
},
|
||||
-- function to run on opening the terminal
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
-- function to run on closing the terminal
|
||||
on_close = function(_)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
|
||||
M.htop = Terminal:new({
|
||||
cmd = "htop",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
})
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue