Two open tabs can be swapped: ctrl + w + r ... Can two vertical be changed to horizontal?

The O (or o) key creates a new line and enters edit mode. Is there a similar command, but without entering edit mode?

Somehow I came across information about writing macros, with the q command.
At that time it was not necessary, but now I can not find where I read about it. How does the q command work? If I'm not mistaken, does the macro work until the editor is closed? Can you save written macros to use later?

    1 answer 1

    Almost all the answers just googling.

    First question:

    Ctrl+w, t, Ctrl+w, K 

    to move from vertical to horizontal,

     Ctrl+w, t, Ctrl+w, H 

    to go from horizontal to vertical, see on EnSO, here .

    Second:

    They propose to define in vimrc commands:

     nmap <S-Enter> O<Esc> nmap <CR> o<Esc> 

    Or these, so that after adding a new line, stay the same:

     nmap <S-Enter> O<Esc>j nmap <CR> o<Esc>k 

    see here .

    On the third:

    You can use it like this:

     qa # далее действия, которые вы хотите записать, а в конце q 

    Instead of a, you can use any Latin letter.

    To apply a macro for a number of lines, you can use this:

     Shift-V # выделяете нужное количество строк :norm! @a 

    thus, you will call a macro in register a for all selected lines.

    To save, I use the mks command, which, strictly speaking, saves not the macro, but the session itself, incl. all open buffers (which is often necessary):

     :mks vim_cfg 

    Next time you can download the session:

     vim -S vim_cfg 
    • On the answer to the third question. All non-empty registers are saved in ~ / .viminfo . See h: 21.3 - hobo-mts