Open promitheas17j opened 4 months ago
I have a similar setup (Alacritty, Ubuntu 22) and I had this issue. I found that the chord <C->
Could you please clarify how you made it work in your setup? If you could paste your mapping line here it would really help me :)
Thanks.
The only mapping I have is
require("toggleterm").setup({
open_mapping = [[<c-\>]],
})
and using shift just seems to work.
I think I understand what you mean. If I press Ctrl+Shift followed by Ctrl+n it does exit terminal mode, but my problem is that it does not work if I map it to escape, probably because I swapped my caps lock and escape keys. I want to just press the escape key and have it execute the necessary stuff to exit terminal mode.
Ah yeah unfortunately I think the terminal captures the escape so it can’t be remapped.
I should’ve clarified I was unable to get the escape mapping to work. I also have my caps lock and escape key swapped, and was also unable to set this map so I have had to retrain myself to use the ctrl shift \.
I am not sure if this is 100% related, but in my case I remap it to jk
using:
map("t", "jk", "<C-\\><C-n>") -- exit terminal mode
And it does the job done of exiting terminal mode.
Is there an existing issue for this?
Current Behavior
When i open a horizontal terminal (for example) and press my escape button it does not exit terminal mode.
Expected Behavior
When pressing the escape key to exit terminal mode and enter normal mode.
Steps To Reproduce
Note: I have swapped the mapping of escape key with Capslock key at the OS level.
Environment
Anything else?
I have looked at this closed issue (#93) as well as this one (#77) and while I understand the concept and reasoning behind why we need a mapping to get back into normal mode if we want to open multiple terminals, I'm starting to not be sure that I mapped it correctly. Here is the specific line in my config for getting out of terminal mode:
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
Is this because I have swapped my escape key with the capslock? If so, how can I get the same functionality? I have also tried the following two variations of the line above with the same resultvim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<leader>jk', [[<C-\><C-n>]], opts)