2

Let's say I have been working in a given Vim session for some time, and come to a point where I really would like to have everything I am looking at in GVim instead.

The actual use-case is a terminal Vim session with a large number of windows... I'd like to click-activate them instead of going through Ctrl-W each time, something that can be done in GVim but not Vim (not mine, at least).

Is there a way to take the buffers / windows / tabs currently open in Vim, and open them in GVim instead?

  • All nice and well, but completely unnecessary to solve the actual use-case problem: set mouse=a activates mouse support for terminal Vim as well, making Vim windows click-activateable... – DevSolar Jun 26 '14 at 13:14
6

You can use the :gui command to open the current session in GVim.

See :help :gui for the gory details.

  • I actually found Ingo's answer to be more helpful overall, as I didn't know about sessions and could see where they can be useful outside the scope of my actual question. But you did answer the actual question more precisely, so I feel you should get the checkmark of honor. – DevSolar May 20 '14 at 12:02
5

That's what sessions are for. In terminal Vim, you save your current setup via :mksession Session.vim, quit Vim, and then launch GVIM with that session: $ gvim -S Session.vim.

You can influence what gets persisted via 'sessionoptions'. I'd recommend to remove storing the mappings, that reduces the session size significantly: :set sessionoptions-=options. Also, there are plugins like session.vim - Extended session management for Vim that simplify the handling.

  • So simple, yet so powerful. I don't think I will ever stop being amazed by Vim. Thanks! – DevSolar May 20 '14 at 9:06

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.