Vim as IDE, Part 1

I spent all my time transforming VIM into an IDE, and this is an account of it.

June 25, 2016 - 2 minute read -
observations hacks tutorials

I still see myself as a learning developer. I mean am not a superhero when it comes to programming 0’s and 1’s. Today, I want to just talk about VIM => a scary linux terminal editor. It is so scary that, I had to spend all my time yesterday configuring it to be an IDE. To bring everyone onboard I will like to explain the major terms I have used in this writeup.

An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger.

Vim (Vi Improved) is an advanced text editor that seeks to provide the power of the de-facto Unix editor ‘Vi’, with a more complete feature set. It’s useful whether you’re already using vi or using a different editor.

I know I can’t explain it much better so let me kill you with what I have done. I wanted to change the all the IDEs I was using so I decided to make Vim a more sophisticated text-editor. To do that I had to edit my vim configuration file (~/.vimrc). Enough of the talk, lets see what I did:

Use all the power of vim

The following code should always be at the top of your vim configuration file.

set nocompatible

Exploring vims settings

The following block of code highlights mostly vim’s general settings. I have not used all but you should be able to see most of these settings here.

set backspace=indent,eol,start
set history=500
set ruler
set number
set showcmd
set incsearch
set linebreak
set scrolloff=3
set splitright
set timeoutlen=100
set fillchars=fold:\,
set tildeop

if exists('&breakindent')
	set breakindent
endif

set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4

syntax on

The block of code above when explained just does something small. First let’s make backspace work everywhere when we are in insert mode. Then we want to keep only 500 lines of command line history. We also want to see the cursor position all the time. Moving on we will want to at least show the linenumbers and also make sure we can be able to show incomplete commands. We should be able to do incremental searching and line wrapping or linebreaks should be done based on words. I don’t like my cursor touching the edge of the viewport. In case I want to split my viewport vertically just use the right half of the screen. This is all the explaining I can do. Let’s hold it on for the rest of this article some other time. Am so excited by #LetsAllWrite.