Skip to content

How to toggle terminal on the left side? #2813

Answered by men232
men232 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, seems i found solution, let me know about it

map({ "n", "t" }, "<C-`>", function()
  require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" }

  if vim.opt.buftype:get() == "terminal" then
    local current_win = vim.api.nvim_get_current_win()

    vim.cmd "wincmd H"

    local new_win = vim.api.nvim_get_current_win()

    if current_win ~= new_win then
      vim.cmd "wincmd L"
    end
  end
end, { desc = "terminal toggleable vertical term" })

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by siduck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant