add floatingterm
This commit is contained in:
parent
25744bdd73
commit
af1cfebdbb
@ -43,6 +43,7 @@
|
||||
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "19aad0f41f47affbba1274f05e3c067e6d718e1e" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "affb21a81e6d7de073378eb86d02864c594104d9" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "490f7fe6d227f4f7a64f00be8c7dcd7a508ed271" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "d6ca7f77eeaf61b3e6ce9f0e5a978d606df44298" },
|
||||
|
@ -1,3 +1,17 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
--
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set("t", "<esc>", [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set("t", "jk", [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set("t", "<C-h>", [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set("t", "<C-j>", [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set("t", "<C-k>", [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set("t", "<C-l>", [[<Cmd>wincmd l<CR>]], opts)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||
|
26
lua/plugins/toggleterm.lua
Normal file
26
lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,26 @@
|
||||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
config = function()
|
||||
require("toggleterm").setup({
|
||||
shading_factor = 2,
|
||||
open_mapping = [[<C-T>]],
|
||||
insert_mapping = true,
|
||||
terminal_mapping = true,
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>t",
|
||||
"<cmd>ToggleTerm<CR>",
|
||||
desc = "Open a terminal",
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user