merged vim-thematic-gui into this project

This commit is contained in:
Reed Esau
2014-01-01 13:07:51 -07:00
parent 1168d4f689
commit ae115dff26
5 changed files with 450 additions and 23 deletions

View File

@@ -17,10 +17,12 @@ let g:thematic#theme_name = ''
" Preserve original settings
let g:thematic#original = {
\ 'laststatus': &laststatus,
\ 'ruler': &ruler,
\ }
let g:thematic#original = {}
let g:thematic#original.laststatus = &laststatus
let g:thematic#original.ruler = &ruler
if has('fullscreen')
call thematic#gui#initFullscreen()
endif
" Defaults
if !exists('g:thematic#defaults')

50
plugin/thematic/gui.vim Normal file
View File

@@ -0,0 +1,50 @@
" ============================================================================
" File: plugin/gui.vim
" Description: script for vim-thematic-gui plugin
" Maintainer: Reed Esau <github.com/reedes>
" Last Change: December 30, 2013
" License: The MIT License (MIT)
" ============================================================================
if exists('g:loaded_thematic_gui') || &cp | finish | endif
let g:loaded_thematic_gui = 1
" Save 'cpoptions' and set Vim default to enable line continuations.
let s:save_cpo = &cpo
set cpo&vim
function! thematic#gui#init(...)
let l:th = a:0 ? a:1 : {}
call thematic#gui#setFont(l:th)
call thematic#gui#setTransparency(l:th)
call thematic#gui#setLinespace(l:th)
call thematic#gui#setFullscreen(l:th)
call thematic#gui#setColumnsAndLines(l:th)
endfunction
function! thematic#gui#initFullscreen()
" Take control of fullscreen behavior from Vim, specifically to
" override its default behavior of maximizing columns and lines
" in fullscreen Vim.
if has('fullscreen')
let l:fuopts = split(&fuoptions, ',')
if index(l:fuopts, 'maxvert') != -1
let g:thematic#original.maxvert = 1
" NOTE removing maxvert results in a screen redraw problem
" if Ctrl+Command+F hit before switching themes,
" so we'll remove it here.
"set fuoptions-=maxvert
endif
if index(l:fuopts, 'maxhorz') != -1
let g:thematic#original.maxhorz = 1
set fuoptions-=maxhorz
endif
endif
endfunction
command -nargs=0 ThematicNarrow call thematic#gui#adjustColumns(-5)
command -nargs=0 ThematicWiden call thematic#gui#adjustColumns(5)
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:ts=2:sw=2:sts=2