Vigemus / iron.nvim

Interactive Repl Over Neovim
BSD 3-Clause "New" or "Revised" License
1.02k stars 81 forks source link

How to go back to normal mode in REPL window #305

Closed tdyoshida closed 2 years ago

tdyoshida commented 2 years ago

Hi, this is probably very basic question, but I couldn't find an answer myself.

After switching to REPL window by IronFocus and start insert mode, I could not figure out the way to go back to normal mode. Esc or my key binding (jj) do not work, and I could not run any commands (since it just types in in the REPL window).

Thanks for the help!

yqwu905 commented 2 years ago

May you try <C-\><C-n>? You could map it to any keymap with tnoremap.

tdyoshida commented 2 years ago

It worked! Thank you so much @yqwu905 !

vhristev commented 1 year ago

@tdyoshida

Here is what im doing i stole it from official doc. https://neovim.io/doc/user/nvim_terminal_emulator.html

vimrc :tnoremap <Esc> <C-\><C-n>

lua

map('t', '<Esc>', '<C-\\><C-n>', {noremap = true, silent = false})

Some other options are to use another terminal, not the embeded one: https://github.com/kassio/neoterm