I use CtrlP to quickly find and open files, and NERDTree to explore and manipulate the folder/file structure. I use two plugins for file-related operations: CtrlP and NERDTree. Ctrl+w =: reset the size of all windowsĮvery window can be extracted from the layout, and be opened in a separate tab with Ctrl+w T.To resize a window, first navigate to it by using the commands above, then use any of the following: To switch focus from one window to another, use Ctrl+w, where direction can be an arrow key or one of the h j k l characters. To open a new file in a split, you can just pass the path as an argument to :split or :vsplit. Note: The same thing can be achieved with tabs by :tabedit %, as the % refers to the current file in commands. It’s also good to know that Vim synchronizes the windows opened for the same file, so you can freely edit in any of them without accidentally overwriting something.Ĭtrl+w s and Ctrl+w v are shortcuts for :split and :vsplit. At first, this might not sound interesting, but it can be handy if you have to edit a large file in multiple different places, or you have to refer to other parts of the same file while editing. If issued without arguments, it opens the current file in the new window. To split the current window horizontally or vertically, use the :split or :vsplit commands. On smaller displays, I rarely use them, but on a large screen, they can come handy. Splitting a window in half is useful if you have to reference contents from other files, or that you have to jump between multiple files in rapid succession. If you are a heavy tab user, I recommend the following posts: There are other ways to work with tabs effectively, but I don’t use them because I usually have very few tabs open at a time. You can cycle between tabs with Ctrl+PgDown and Ctrl+PgUp.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |