From: Jannik ZANDER Date: Mon, 6 Aug 2018 19:31:22 +0000 (+0200) Subject: Add markdown preview X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=2ed354f163a9c53f9e489c0573998615d51e1fa4;p=vimfiles.git Add markdown preview --- diff --git a/vimrc b/vimrc index a591b98..1036769 100644 --- a/vimrc +++ b/vimrc @@ -155,12 +155,12 @@ nnoremap t :TagbarToggle "nnoremap php :-1read ~/.vim/template/php2ja "" Visual Mode -vnoremap jk +"vnoremap jk vmap < >gv " Insert Mode -inoremap jk +"inoremap jk inoremap u " Command Mode @@ -204,6 +204,7 @@ if has('autocmd') autocmd FileType python setlocal expandtab softtabstop=4 shiftwidth=4 \ formatoptions+=croq colorcolumn=79 \ cinwords=if,elif,else,for,while,try,except,finally,def,class,with + autocmd FileType netrw setlocal bufhidden=wipe augroup end augroup filetypes @@ -311,6 +312,12 @@ packadd supertab " Pandoc packadd vim-pandoc packadd vim-pandoc-syntax +function! Markdown_Preview() + let b:curr_file = expand('%:p') + call system('pandoc --standalone "' . b:curr_file . '" > markdown-preview.html') + call system('xdg-open markdown-preview.html 1>/dev/null 2>/dev/null &') +endfunction +nnoremap md :call Markdown_Preview() " Pick packadd pick.vim