DEV Community

Jason
Jason

Posted on

Must-have Vim config

.vimrc

Get the most out of Vim.

Vim is pretty great right out of the box but .vimrc settings are a simple way to elevate your enjoyment of vim and speed up your workflow.

:imap jj <Esc>
:imap kk <C-N>

:set tabstop=4
:set shiftwidth=4
:set expandtab
:set autoindent
:set number
:set term=screen-256color
:set pastetoggle=<f5>

:colorscheme 256_noir
Enter fullscreen mode Exit fullscreen mode

Just drop these lines in a file called .vimrc file and save it to your home directory.

This config file includes the 256_noir Vim color scheme. You can download the scheme here:
https://github.com/andreasvc/vim-256noir

Drop this file here:
~/.vim/colors

If this scheme doesn't work for you, you can omit the last line in the .vimrc file or download and use a different scheme.

As for mapping to jj, I can't tell you how much this improves my workflow. Being able to quickly type jj instead of reaching for the esc every time I need to enter command mode is invaluable.

This is just the beginning. My .vimrc file is over 100 lines. Let me know if you want me to share it. I hope this helps get you started. Let me know what you think.

Top comments (1)

Collapse
 
jingxue profile image
Jing Xue

Looks cool, just don't try to write a story about Asajj Ventress. ;-)