• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created about 11 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vim plugin to remove distractions

LiteDFM

A lightweight plugin to remove distractions from Vim.

This is based loosely on Distraction Free Mode in Sublime Text.

A key differentiator from most other implementations of distraction free writing in Vim is that support for vsplits remains uncrippled. This comes at the expense of proper centering, though, so there's a tradeoff.

Demo

Installation

For Pathogen:

git clone https://github.com/bilalq/lite-dfm ~/.vim/bundle

For Vundle, add this to your vimrc and run BundleInstall:

Bundle 'bilalq/lite-dfm'

Usage

There are 3 commands that are exposed:

  • LiteDFM
  • LiteDFMClose
  • LiteDFMToggle

For convenience, I would recommend setting up a mapping to quickly toggle.

nnoremap <Leader>z :LiteDFMToggle<CR>

If you dislike the fact that the last run command shows up as a message, use this mapping instead:

nnoremap <Leader>z :LiteDFMToggle<CR>i<Esc>`^

If you're a tmux user and really want to get fancy, this should interest you:

nnoremap <Leader>z :LiteDFMToggle<CR>:silent !tmux set status > /dev/null 2>&1<CR>:redraw!<CR>

Customization

Colors

You can manually specify the color to be used for hiding UI elements. There are two global variables that can be used to override the one that is normally detected. One is for CLI Vim, while the other is for gui Vim. You can set these in your vimrc like so:

let g:lite_dfm_normal_bg_cterm = 234
let g:lite_dfm_normal_bg_gui = '#abcabc'

If you are using a value of none for your background color, this is the only way you will be able to make this plugin properly hide your UI elements.

Left offset

This plugin doesn't center, but instead offsets text from the left. You can specify exactly how many columns you want this offset to be. Any value from 1 to 22 is valid. By default, 22 is used.

let g:lite_dfm_left_offset = 16

Keeping the ruler

You may prefer to have the ruler on when you have LiteDFM active. You can do so by adding this to your vimrc:

let g:lite_dfm_keep_ruler=1

Similar Plugins

More Repositories

1

Tranquillity-Editor

An IDE for poets
PHP
141
star
2

eight-bit-color-picker

Color Picker for 256 color palettes
JavaScript
57
star
3

iex-api

Unofficial SDK for using the IEX API
TypeScript
43
star
4

villustrator

Web GUI for creating Vim colorschemes
CoffeeScript
21
star
5

dotfiles

My customized dotfiles
Lua
14
star
6

flinch

Node CLI tool to facilitate async workflows
JavaScript
13
star
7

LoremWisdom

HackRU Spring 2013 Hack
JavaScript
3
star
8

blog

My blog
CSS
3
star
9

DataVu

PHP
2
star
10

Nameless

A web application that greatly simplifies the process of creating names.
PHP
2
star
11

Trendy

See whats trending with the people you follow.
PHP
2
star
12

localhostdemo

Sample code used in my localhost demo
PHP
2
star
13

StoryMap

A visual tool for finding out the happenings of the world.
JavaScript
2
star
14

inkwell

A diary in your terminal
JavaScript
2
star
15

HackerLeague-Android

Android app for hackerleague
Java
1
star
16

xterm-256color-palette

JS module exposing xterm-256color's palette as a list of Strings
JavaScript
1
star
17

RU-Scheduled

An Android/iOS app that allows Rutgers students to share their schedules with one another.
JavaScript
1
star
18

Pendulum

Micro framework for Java Swing
Java
1
star
19

troll.sh

A safe, quick, and hilarious way to prank your friends
Shell
1
star
20

strtomoney

PHP Library for parsing "human" money amounts to workable objects.
PHP
1
star
21

TransLaTeX

An alternative syntax for writing math in Latex that's clean, simple, and elegant.
Ruby
1
star
22

Hacker-League-Mobile

Mobile app for HackerLeague
JavaScript
1
star
23

lambda-promise-interop

Small JavaScript/TypeScript library for converting between AWS Lambda Handlers and (Event, Context) => Promise<Result> functions.
TypeScript
1
star