Three ways for VIM to horizontally display all windows

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.