change plugin init to config terminal on load extensions, change mappings to use new chadterm
This commit is contained in:
parent
b9e8f489ed
commit
1face444b8
2 changed files with 24 additions and 5 deletions
|
@ -6,6 +6,7 @@ local map_wrapper = utils.map
|
||||||
local maps = config.mappings
|
local maps = config.mappings
|
||||||
local plugin_maps = maps.plugins
|
local plugin_maps = maps.plugins
|
||||||
local nvChad_options = config.options.nvChad
|
local nvChad_options = config.options.nvChad
|
||||||
|
local terminal_options = config.options.terminal
|
||||||
|
|
||||||
local cmd = vim.cmd
|
local cmd = vim.cmd
|
||||||
|
|
||||||
|
@ -95,14 +96,26 @@ M.misc = function()
|
||||||
-- get out of terminal mode
|
-- get out of terminal mode
|
||||||
map("t", term_maps.esc_termmode, "<C-\\><C-n>")
|
map("t", term_maps.esc_termmode, "<C-\\><C-n>")
|
||||||
-- hide a term from within terminal mode
|
-- hide a term from within terminal mode
|
||||||
map("t", term_maps.esc_hide_termmode, "<C-\\><C-n> :lua require('core.utils').close_buffer() <CR>")
|
map("t", term_maps.esc_hide_termmode, "<CMD>lua require('nvchad.terminal').hide() <CR>")
|
||||||
-- pick a hidden term
|
-- pick a hidden term
|
||||||
map("n", term_maps.pick_term, ":Telescope terms <CR>")
|
map("n", term_maps.pick_term, ":Telescope terms <CR>")
|
||||||
-- Open terminals
|
-- Open terminals
|
||||||
-- TODO this opens on top of an existing vert/hori term, fixme
|
-- TODO this opens on top of an existing vert/hori term, fixme
|
||||||
map("n", term_maps.new_horizontal, ":execute 15 .. 'new +terminal' | let b:term_type = 'hori' | startinsert <CR>")
|
map(
|
||||||
map("n", term_maps.new_vertical, ":execute 'vnew +terminal' | let b:term_type = 'vert' | startinsert <CR>")
|
{ "n", "t" },
|
||||||
map("n", term_maps.new_window, ":execute 'terminal' | let b:term_type = 'wind' | startinsert <CR>")
|
term_maps.new_horizontal,
|
||||||
|
"<CMD>lua require('nvchad.terminal').new_or_toggle('horizontal', "
|
||||||
|
.. tostring(terminal_options.window.split_height)
|
||||||
|
.. ")<CR>"
|
||||||
|
)
|
||||||
|
map(
|
||||||
|
{ "n", "t" },
|
||||||
|
term_maps.new_vertical,
|
||||||
|
"<CMD>lua require('nvchad.terminal').new_or_toggle('vertical', "
|
||||||
|
.. tostring(terminal_options.window.vsplit_width)
|
||||||
|
.. ")<CR>"
|
||||||
|
)
|
||||||
|
--map("n", term_maps.new_window, "") not supported yet
|
||||||
-- terminal mappings end --
|
-- terminal mappings end --
|
||||||
|
|
||||||
-- Add Packer commands because we are not loading it at startup
|
-- Add Packer commands because we are not loading it at startup
|
||||||
|
|
|
@ -8,7 +8,6 @@ end
|
||||||
local override_req = require("core.utils").override_req
|
local override_req = require("core.utils").override_req
|
||||||
|
|
||||||
local plugins = {
|
local plugins = {
|
||||||
{ "NvChad/extensions" },
|
|
||||||
{ "nvim-lua/plenary.nvim" },
|
{ "nvim-lua/plenary.nvim" },
|
||||||
{ "lewis6991/impatient.nvim" },
|
{ "lewis6991/impatient.nvim" },
|
||||||
{ "nathom/filetype.nvim" },
|
{ "nathom/filetype.nvim" },
|
||||||
|
@ -18,6 +17,13 @@ local plugins = {
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"NvChad/extensions",
|
||||||
|
config = function ()
|
||||||
|
vim.schedule_wrap(require("nvchad.terminal").init())
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"NvChad/nvim-base16.lua",
|
"NvChad/nvim-base16.lua",
|
||||||
after = "packer.nvim",
|
after = "packer.nvim",
|
||||||
|
|
Loading…
Reference in a new issue