DEV Community

Jason
Jason

Posted on

4 1

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.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
jingxue profile image
Jing Xue

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay