(Optional) Setting Up a Vim Development Environment

Length: 00:05:47

Lesson Summary:

To get started with the course you're going to need a few things installed:

  • Python 3
  • Git
  • A text editor of your choice

My preferred text editor is Vim and that's what I'll be using throughout the course.

This course is focused on using Python on a Linux system. You can definitely follow along on a mac or windows machine, but we won't be convering potential differences with those system or how to install Python on Windows.

I will be using CentOS 7 and if you'd like to follow along exactly we'll go through what you need to be able to use one of your Linux Academy Cloud Playground servers.

Installing Development tools and Vim

We've already installed most of what we need, but attempting to install development tools again won't hurt. Vim has yet to be installed, so we'll add that now:

$ sudo yum update -y
$ sudo yum groupinstall -y "development tools"
$ sudo yum install -y vim-enhanced

Configure git:

This is just a best practice, but we'll want to configure Git to have our name and email address so that we can sign any commits that we make as we're developing.

$ git config --global user.name "Keith Thompson"
$ git config --global user.email "keith@linuxacademy.com"

Pull down sample bashrc

Having a comfortable development environment makes life easier. For this course, I'm going to use a slightly customized bash configuration to improve my experience in the terminal. You can chose to skip this step if you'd like. We can download this file from this course's Github repository:

$ curl https://raw.githubusercontent.com/linuxacademy/content-intro-to-python-development/master/helpers/bashrc -o ~/.bashrc
$ exec $SHELL

The exec $SHELL reloaded our shell session and we can now see the customizations to the prompt. We'll come back to this in a second to see some enhancements that only show up when working within git repositories.

Pull down sample vimrc

Vim is a great text editor, but it doesn't have the best default settings. I've created a simple, yet usable vim configuration to use with this course that will improve our experience while writing Python code. Let's fetch this file now:

$ curl https://raw.githubusercontent.com/linuxacademy/content-intro-to-python-development/master/helpers/vimrc -o ~/.vimrc

Demonstrat PS1 changes

One of the big changes in the bash configuration is that it adds support for showing information about the git repository that we're currently working in. Let's create a sample project so we can see what it shows:

$ mkdir sample
$ cd sample
$ touch file.txt
$ git init
$ git add --all .
$ git commit -m 'Initial commit'

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson

Or Log In

Looking For Team Training?

Learn More