0

I am currently doing some python development with Ubuntu and am annoyed about having to organise and rearrange my windows every time I log in. I'm using Vim and another terminal window to run my python scripts.

Is there a way to say run a script that will rearrange the windows how I like and initiate a virtual environment? Also, is this something people tend to do?

Jakey
  • 160
  • 1
  • 2
  • 10
  • Would be better of on https://askubuntu.com/, I am pretty sure this must be solved specifically for the WM (In your case probably `compiz`). Have a look [here](https://askubuntu.com/questions/7798/how-do-i-arrange-my-windows-automatically) – Doktor OSwaldo Jul 13 '18 at 05:42
  • question is not clear. you want to re-arrange vim windows? or terminal windows? or your X windows? – Kent Jul 13 '18 at 08:04
  • well, I want to rearrange my terminal windows - one that is running vim and the other that I run scripts with. I also want to be able to have both terminal sessions to run `source venv/bin/activate` without me having to type that in every time. Would a bash script do the trick? – Jakey Jul 13 '18 at 08:15

2 Answers2

1

Try the Terminator terminal emulator. It allows you to save a workspace configuration which will be loaded everytime you run it. As for the virtual environment part of your question, you can create a virtual environment using virtualenv:

virtualenv venv 

and then activate it when you want to use it:

source venv/bin/activate
1

I found this answer very helpful Running Python code in Vim. You can edit your Python code in Vim and fire the Python interpreter with a shortkey (F5 in this example). Vim opens up a new vim(!)-window where the Python output is redirected to.

PS: to save the layout of your vim-windows, have a look at "Views and Sessions" in vim-help (:h views-sessions)

ViVeteran
  • 86
  • 1
  • 6