1

I'm using vim with the python-mode plugin. All windows (runtime, documentation, Error, etc) opened by python-mode split the window horizontally. How can I change the default behavior to split vertically?

1
  • added the following to .vimrc autocmd BufEnter {__run__,__doc__} :wincmd L Commented Jan 21, 2015 at 2:54

1 Answer 1

4

It doesn't appear that python-mode provides an option that allows you to control the direction of its splits. However, you can create an autocommand which will automatically move the window to the right side when it opens.

autocmd BufEnter {window_name_list} :wincmd L

So for python-mode, the command should look like this:

autocmd BufEnter __run__,__doc__ :wincmd L

NOTE

This autocommand will move the window to the very right of the screen. You can replace L with H if you want it to split to the left instead of the right.

If you need help on autocommands and wincmd, read these help topics:

:help :autocmd
:help autocmd-events
:help :wincmd
:help CTRL-W
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks this works great. I added the following to .vimrc. autocmd BufEnter {__run__,__doc__} :wincmd L
That's good, but the brackets aren't necessary. Just autocmd BufEnter __run__,__doc__ :wincmd L will work just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.