I use VIM as my main text editor here at work and I often have 10-15 files open at once in a couple of Windows with several tabs, each of which has its own split Windows. I love using VIM, but I hate having to re-do my entire set-up every time the dev server gets bounced or my machine crashes.
Is there a way to get VIM to remember a setup, such as the "project" features in many IDEs? Or am I stuck having to open all the files in the same way each time?
Switch between files Here, N is capital (Type SHIFT+n). Start editing the files as the way you do with Vim editor. Press 'i' to switch to interactive mode and modify the contents as per your liking. Once done, press ESC to go back to normal mode.
:wa - save all tabs / unsaved buffers. :xa / :wqa - save all tabs / unsaved buffers and exit Vim.
Yes, Vim loads the whole file into memory.
To directly move to first tab or last tab, you can enter the following in command mode: :tabfirst or :tablast for first or last tab respectively. To move back and forth : :tabn for next tab and :tabp for previous tab. You can list all the open tabs using : :tabs. To open multiple files in tabs: $ vim -p source.
Have a look at the :mksession
command.
A Session keeps the Views for all windows, plus the global settings. You can save a Session and when you restore it later the window layout looks the same. You can use a Session to quickly switch between different projects, automatically loading the files you were last working on in that project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With