Method1: map <F7> <ESC>:windo exe "normal \<foobar<C-W>C-W>K"<CR>
Method2: map <F8> <ESC>:windo wincmd K<CR>
Method3: map <F9> <ESC>:call HorizontAll()<cr>
function! HorizontAll()
windo exe "normal \<c-w>K"
endfunction
Summary:
1 In the string of map {RHS}, Ctrl-W is converted to a DELETE command in insert mode, which deletes the previous word in the current position, foobar in method 1 is used to neutralize this conversion.
The first method is also the method that I first thought of. The conversion of Ctrl-w made the ing ineffective, which made me angry with vim for the first time. After one night, I thought of adding a word in the middle for neutralization. In the morning, a try took effect.
2. When we are complacent about the "brilliant" approach of the first method, we find that there are two more elegant and flexible methods. The first method is so ugly, I can't help but lament that my imagination is limited! Benefiting from exam-oriented education in the great motherland? I don't know.
3. The methods 1st and 3rd were created after I slept for one night. The 2nd methods were met by wincmd when I flipped through the document, and they were considered half original, this also demonstrates that innovation stems from continuous efforts.
Three ways for VIM to horizontally display all windows