简体   繁体   中英

Vim 8 terminal standard `termkey' CTRL-W_N opens new split instead of switching to normal mode

The relevant man section says:

Special in the terminal window:         *CTRL-W_.*  *CTRL-W_N* 
    CTRL-W .    send a CTRL-W to the job in the terminal
    CTRL-W N    go to Terminal-Normal mode, see |Terminal-mode|
    CTRL-\ CTRL-N   go to Terminal-Normal mode, see |Terminal-mode|

In terminal, CTRL-\\ CTRL-N switches to Terminal-Normal mode without problem.

In terminal, CTRL-W N opens a new split, instead of Terminal-Normal mode. Why?

Also, what is the exact purpose of CTRL-W . ? It doesn't seem to do anything in term window.

Vim does listen to CTRL-W in terminal splits (of course also in normal splits). Which allows you to change the splits with the normal mappings. But this means, any application running in the terminal, will never recieve the CTRL-W press you did. That's why there is the CTRL-W . command, which "fakes" a CTRL-W press in the Terminal.

You can test this by opening a new vim in the vim-terminal-mode, and try to issue CTRL-W commands there.

CTRL-W N workes fine for me, are your sure you are not pressing CTRL-W n instead? or have some mappings?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM