1
0
mirror of https://github.com/amix/vimrc synced 2025-07-10 03:25:00 +08:00

add Previm and window management

This commit is contained in:
Max Alcala
2016-02-23 14:35:43 -06:00
parent f3143286d3
commit 14bf4d01c6
45 changed files with 3967 additions and 77 deletions

View File

@ -0,0 +1,32 @@
" AUTHOR: kanno <akapanna@gmail.com>
" License: This file is placed in the public domain.
if exists('g:loaded_previm') && g:loaded_previm
finish
endif
let g:loaded_previm = 1
let s:save_cpo = &cpo
set cpo&vim
function! s:setup_setting()
augroup Previm
autocmd! * <buffer>
if get(g:, "previm_enable_realtime", 0) ==# 1
" NOTE: It is too frequently in TextChanged/TextChangedI
autocmd CursorHold,CursorHoldI,InsertLeave,BufWritePost <buffer> call previm#refresh()
else
autocmd BufWritePost <buffer> call previm#refresh()
endif
augroup END
command! -buffer -nargs=0 PrevimOpen call previm#open(previm#make_preview_file_path('index.html'))
endfunction
augroup Previm
autocmd!
autocmd FileType *{mkd,markdown,rst,textile}* call <SID>setup_setting()
augroup END
let &cpo = s:save_cpo
unlet! s:save_cpo