Install and Set up Vim for Linux Kernel Development

tux_vim_logo

This post lists the steps to install and setup Vim for Linux kernel development.

Steps

1. Type sudo apt-get install vim

2. Type vi ~/.vimrc

3. Copy **:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab cindent cc=80 %retab autocmd BufWritePre * %s/\s\+$//e**

4. In vim type i

5. Paste the line you copied into the doc

6. Press ESC

7. Type :w ENTER

8. Press ESC

9. Press :q ENTER

Reference

Image is an amalgamation of images from [link] (Vim) and [link] (Tux)

Note

A post that covers fixing tabs is at [link].