nsbgn / vim-margin

Automatically center vim windows for comfortable typing in fullscreen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-margin

A small plugin to center your Vim windows if their width exceeds the &textwidth. This plugin is similar to the excellent Goyo, but it is much simpler and it is intended to be enabled by default --- not just in situations where you want to remove all distractions.

This plugin is good enough to solve my personal use case: comfortable writing on a widescreen monitor in fullscreen, while being unobtrusive otherwise. Although the basics work, it will likely exhibit strange behaviour in others' workflows. Pull requests are welcome!

Add it to your ~/.vimrc using, for example, vim-plug:

Plug 'https://github.com/slakkenhuis/vim-margin'

If you use this plugin, you will likely want to have more subtle dividers between splits:

highlight VertSplit cterm=NONE ctermfg=gray

... or hide them completely:

highlight VertSplit cterm=NONE
set fillchars+=vert:\ 

Usage

After installation, the margin will be active by default. If this is not desired, add the following to your .vimrc after loading the plugin:

let g:margin_enabled=1

To toggle the margins:

:Margin

Related

About

Automatically center vim windows for comfortable typing in fullscreen.

License:The Unlicense


Languages

Language:Vim Script 100.0%