Skip to content

smart-splits cannot use with toggleterm and tmux #199

Closed Answered by gxt-kt
gxt-kt asked this question in Q&A
Discussion options

You must be logged in to vote

Really thanks for your reply.
I check the keymap and find the keymap in terminal.
So i change the following toggleterm config and solve the problem.

  if pcall(require, "smart-splits") then
    -- for smart-splits
    vim.keymap.set("t", "<C-h>", [[<cmd>lua require('smart-splits').move_cursor_left()<cr>]], opts)
    vim.keymap.set("t", "<C-j>", [[<cmd>lua require('smart-splits').move_cursor_down()<cr>]], opts)
    vim.keymap.set("t", "<C-k>", [[<cmd>lua require('smart-splits').move_cursor_up()<cr>]], opts)
    vim.keymap.set("t", "<C-l>", [[<cmd>lua require('smart-splits').move_cursor_right()<cr>]], opts)
  else
    vim.keymap.set("t", "<C-h>", [[<Cmd>wincmd h<CR>]], opts)
    vim.keymap.set

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mrjones2014
Comment options

Answer selected by mrjones2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants