vim's split screen feature

Original link: https://www.cnblogs.com/manziluo/p/5789700.html


vim's split screen feature

To sum up, it is basically ctrl+w and then adding a certain key letter to trigger a function.
(1) Open several files in the shell and split the screen:
  vim -On file1 file2 ...
  vim -on file1 file2 ...

Big O means vertical division (vertical), small o means horizontal division (default horizontal), and the following n means dividing into several screens. In fact, I don’t think it is necessary to write. By default, the number of files to be divided will be used to decide how many screens to divide.
(2) Open a split screen in vim:
  Create a blank split screen:
  :new
  Open any file:
  :vsplit(:vsp) filename
  :sp(split) filename
  Open the current file:
  ctrl+w and s(split)
  ctrl+w and v(vsplit)

(3) Close a split screen:
  :only or ctrl+w and o to cancel other split screens, keep only the current split screen
  ctrl+w and c(close)
  and launch only the last split screen:
  ctrl+w and q(quit )
(4) Move the cursor, that is, switch the split screen; you can also move the split screen, such as moving the left split screen to the right.
  ctrl+w and w (various switching, it is more convenient when there are only two split screens)
  ctrl+w and h(H) left
  ctrl+w and j(J) down
  ctrl+w and k(K) up
  ctrl +w and l(L) Right
(5) is the last operation to change the split screen size.
  ctrl+w and < left
  ctrl+w and > right
  ctrl+w and + up
  ctrl+w and - down
  ctrl+w and = restore equal

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325901412&siteId=291194637