Skip to content

Commit

Permalink
Updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Aug 3, 2014
1 parent b92f0f2 commit 2a9908e
Show file tree
Hide file tree
Showing 88 changed files with 2,827 additions and 2,002 deletions.
44 changes: 34 additions & 10 deletions sources_non_forked/goyo.vim/plugin/goyo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function! s:setup_pad(bufnr, vert, size)
execute win . 'wincmd w'
execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size])
augroup goyop
autocmd WinEnter <buffer> call s:blank()
autocmd WinEnter,CursorMoved <buffer> call s:blank()
augroup END

" To hide scrollbars of pad windows in GVim
Expand Down Expand Up @@ -127,6 +127,7 @@ function! s:goyo_on(width)
\ { 'laststatus': &laststatus,
\ 'showtabline': &showtabline,
\ 'fillchars': &fillchars,
\ 'winminwidth': &winminwidth,
\ 'winwidth': &winwidth,
\ 'winminheight': &winminheight,
\ 'winheight': &winheight,
Expand All @@ -145,6 +146,12 @@ function! s:goyo_on(width)
silent! GitGutterDisable
endif

" vim-signify
let t:goyo_disabled_signify = exists('b:sy') && b:sy.active
if t:goyo_disabled_signify
SignifyToggle
endif

" vim-airline
let t:goyo_disabled_airline = exists("#airline")
if t:goyo_disabled_airline
Expand Down Expand Up @@ -177,10 +184,10 @@ function! s:goyo_on(width)
endif

" Global options
set winwidth=1
let &winheight = max([&winminheight, 1])
set winminheight=1
set winheight=1
set winminwidth=1 winwidth=1
set laststatus=0
set showtabline=0
set noruler
Expand Down Expand Up @@ -241,6 +248,7 @@ function! s:goyo_off()

let goyo_revert = t:goyo_revert
let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter
let goyo_disabled_signify = t:goyo_disabled_signify
let goyo_disabled_airline = t:goyo_disabled_airline
let goyo_disabled_powerline = t:goyo_disabled_powerline
let goyo_disabled_lightline = t:goyo_disabled_lightline
Expand All @@ -258,6 +266,10 @@ function! s:goyo_off()
execute printf('normal! %dG%d|', line, col)
endif

let wmw = remove(goyo_revert, 'winminwidth')
let ww = remove(goyo_revert, 'winwidth')
let &winwidth = ww
let &winminwidth = wmw
let wmh = remove(goyo_revert, 'winminheight')
let wh = remove(goyo_revert, 'winheight')
let &winheight = max([wmh, 1])
Expand All @@ -273,6 +285,12 @@ function! s:goyo_off()
silent! GitGutterEnable
endif

if goyo_disabled_signify
silent! if !b:sy.active
SignifyToggle
endif
endif

if goyo_disabled_airline && !exists("#airline")
AirlineToggle
silent! AirlineRefresh
Expand All @@ -296,20 +314,26 @@ function! s:goyo_off()
endif
endfunction

function! s:goyo(...)
function! s:goyo(bang, ...)
let width = a:0 > 0 ? a:1 : get(g:, 'goyo_width', 80)

if exists('#goyo') == 0
call s:goyo_on(width)
elseif a:0 > 0
let t:goyo_width = width
call s:resize_pads()
if a:bang
if exists('#goyo')
call s:goyo_off()
endif
else
call s:goyo_off()
if exists('#goyo') == 0
call s:goyo_on(width)
elseif a:0 > 0
let t:goyo_width = width
call s:resize_pads()
else
call s:goyo_off()
end
end
endfunction

command! -nargs=? Goyo call s:goyo(<args>)
command! -nargs=? -bar -bang Goyo call s:goyo('<bang>' == '!', <args>)

let &cpo = s:cpo_save
unlet s:cpo_save
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/nerdtree/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ __Q. How can I open a NERDTree automatically when vim starts up if no files were
A. Stick this in your vimrc

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if !argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

__Q. How can I map a specific key or shortcut to open NERDTree?__

Expand Down
Loading

0 comments on commit 2a9908e

Please sign in to comment.