0

I want IDE-like look when I start vim.

3 columns. Leftmost, at 15% width, file & symbol browser, then 60% width of main editor space and 25% showing debug points and run logs on right most part.

When I start vim, I can do all this using verticalsplit, NerdTree, ctags, etc. etc. but the process is repetitive.

How can I automate these steps so when I start vim I can just get to work?

1
  • 4
    Welcome to this site :) A kind advice from someone who has been playing with vim for a few years and who has see a lot of questions about that: Don't try to use NerdTree as an always open file drawer that will create nothing but troubles (see this). Also you should search a bit more on this site there are questions about how to use -c to execute commands at startup, how to use autocommands and how to use vim's session feature. Your question is most probably a duplicate of one we already have on this site.
    – statox
    Apr 28 at 16:26
1

Once you have vim how you like it, it's possible to save the session (so any files you have open, the arrangement of splits you have etc.). See :help mksession

Basically, you can just do:

:mksession!

and vim will write a file into the currentent directory. As I've written it above, I provided no file name and therefore vim will default to naming the file Session.vim

Also, the ! will overwrite any previous files of the same name. This means you can choose to have multilple session stats saved if you wish.

To load the vim sesssion again, you can either do:

$ vim -S Session.vim

(on launching vim) or you can do it after launching vim with:

:source Session.vim

on vim's command line.

2
  • Cf this question with several different answers about how to use the sessions.
    – statox
    Apr 28 at 17:07
  • @statox Oh cool thanks! I didn't know about the tpope Obsession plugin. It looks like it'll make things nice and smooth!
    – mattb
    Apr 28 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.