Meditating on Code
Sometimes you need to gather all your attention and focus on a few lines of code. Vim has a great plugin which can help you minimize distractions.
Introducing limelight.vim
limelight.vim can greatly increase your concentration when you need it. It's written by Junegunn Choi - creator of fzf, vim-plug and many other useful things.
Live demonstration
Key mapping suggestions
nmap <silent> gl :Limelight!!<CR>
xmap gl <Plug>(Limelight)
gl
is one of this few vim keys that has no default mapping.
In normal mode gl
will toggle limelight. In visual - its apply limelight for visual selection.
Options
Dim level: 0 - brighter, 1 - darker (default: 0.5)
let g:limelight_default_coefficient = 0.7
You can define your own color for dimming, both for gui and terminal versions. Use this table to choose right cterm color.
let g:limelight_conceal_guifg = '#171717'
let g:limelight_conceal_ctermfg = 238
Number of preceding/following paragraphs to include (default: 0)
let g:limelight_paragraph_span = 1
Other suggestions
You can use this option for automatically keep current working line in center of the screen:
set scrolloff=999
And that is all for today.