Open D0ot opened 3 years ago
You can use <C-\><C-n>
to go to normal mode, and then use <C-w>w
to focus on different windows. This will work for both vim and neovim.
I have tried <C-w>N
in default :terminal
in vim, this could also bring you back to normal mode, but it's not work in neovim.
The instruction of keymap is also mentioned what are <Fn>
s mapping for.
map <Esc>
with <c-\><c-n>
like below
tmap <Esc> <c-\><c-n> --for vim
vim.cmd([[ tmap <Esc> <c-\><c-n> ]]) --for neovim
now you can press ESC
and do things as you do in normal mode, for example, you can press <C-w><C-w>
and it will do what you asked in question
Is there a way to get a window to not ever lose focus?
For example in lazygit, i never want the cursor to leave the window. that way i dont press the wrong key on accident and have to do C-wC-w
I found out its from moving the mouse simply OUTSIDE the window. I made an issue about it
https://github.com/voldikss/vim-floaterm/issues/417
Do you know if theres a way to turn this off?
I went a step further in my Neovim setup to close my window each time I hit escape:
vim.cmd([[ tmap <Esc> <c-\><c-n> :FloatermToggle<CR> ]])
Just like the effect in README: