Python and Vim
How to quickly set up a biostatistics project

 

If you ask how to get started with Python, AI chatbots will recommend the mainstream things: Jupyter Notebook, Anaconda, etc. R is even worse, e.g. RStudio etc. A more natural, minimal setup is desirable, to stay in the terminal and work across languages. This video shows how you can achieve that while limiting Vim plugins and key mappings, making it easier to move between machines and replicate workflow (as long as Vim is available). There is no need to build an IDE; Vim is sufficient.

It might be obvious that Linux Mint is used in the video and the install commands will differ for other Linux distros. Documentation for the survival analysis functions and data are available1. Developed by industry statistician and open source advocate Sebastian Pölsterl2.

 

   

Timestamps

0:00: Check git and Python are installed. Python 3.10 or higher is fine (see scikit-survival documentation)

0:20: Install other required tools

1:09: Clone the repo (an empty repo if it’s a new project)

1:34: Set up and activate virtual environment (note command prompt changes)

1:49: Open program in vim with terminal in vertical split

2:00: Install Python packages for stats etc.

3:05: Open vimrc, confirm mapping to run program (not needed, can jump to term with ctrl w h and run from the command line)

3:30: Check Kaplan-Meier plot created by the program (vieb browser is used to view images to maintain vim key bindings)

3:52: Add code for Cox regression

6:09: Run code, fix typo

6:21: Move to term, switch to normal mode (ctrl w N) and save output

6:48: Backup setup, for reproducibility (on another machine, run: pip install -r requirements.txt)

7:08: Add swap files to gitignore

7:24: Push updates to the repo

7:50: Deactivate the virtual environment

You can control the size of Vim splits easily with mappings, and if the output is wide you may want to switch to horizontal splits with ctrl w K.

 


References


Updated: September 16, 2026 · Version: 0bd8989