Skip to content

Instantly share code, notes, and snippets.

@jsks
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsks/11123066 to your computer and use it in GitHub Desktop.
Save jsks/11123066 to your computer and use it in GitHub Desktop.
DistractFree vim plugin patch
--- DistractFree.vim 2014-04-21 21:17:14.312742931 -0500
+++ DistractFree.vim.1 2014-04-21 21:21:49.645868844 -0500
@@ -39,6 +39,11 @@
let g:distractfree_width = '90%'
endif
+ " The desired column height. Defaults to 90%
+ if !exists( "g:distractfree_height" )
+ let g:distractfree_height = '90%'
+ endif
+
" The colorscheme to load
if !exists( "g:distractfree_colorscheme" )
let g:distractfree_colorscheme = ""
@@ -49,6 +54,11 @@
let g:distractfree_font = ""
endif
+ " Line spacing. Disabled by default
+ if !exists("g:distractfree_linespace")
+ let g:distractfree_linespace = "0"
+ endif
+
if exists("g:distractfree_nomap_keys")
let s:distractfree_nomap_keys = g:distractfree_nomap_keys
@@ -62,8 +72,9 @@
" the cursor at all times? Defaults to 999 (which centers your cursor in the
" active window).
let s:_def_opts = {'t_mr': '', 'scrolloff': get(g:, 'distractfree_scrolloff', 999),
- \ 'laststatus': 0, 'textwidth': winwidth(winnr()), 'number': 0,
- \ 'relativenumber': 0, 'linebreak': 1, 'wrap': 1, 'g:statusline': '%#Normal#',
+ \ 'laststatus': 0, 'textwidth': 0, 'number': 0,
+ \ 'relativenumber': 0, 'linebreak': 1, 'linespace': g:distractfree_linespace,
+ \ 'wrap': 1, 'g:statusline': '%#Normal#',
\ 'l:statusline': '%#Normal#', 'cursorline': 0, 'cursorcolumn': 0,
\ 'ruler': 0, 'guioptions': '', 'fillchars': 'vert:|', 'showtabline': 0,
\ 'showbreak': ''}
@@ -74,11 +85,11 @@
let s:minwidth = float2nr(round(&columns *
\ (matchstr(g:distractfree_width, '\d\+')+0.0)/100.0))
let s:minheight = float2nr(round(&lines *
- \ (matchstr(g:distractfree_width, '\d\+')+0.0)/100.0))
+ \ (matchstr(g:distractfree_height, '\d\+')+0.0)/100.0))
else
" assume g:distractfree_width contains columns
let s:minwidth = matchstr(g:distractfree_width, '\d\+')
- let s:minheight = s:minwidth/2
+ let s:minheight = matchstr(g:distractfree_height, '\d\+')
endif
if !exists("s:sessionfile")
let s:sessionfile = tempname()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment