From 2ed354f163a9c53f9e489c0573998615d51e1fa4 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 6 Aug 2018 21:31:22 +0200 Subject: [PATCH] Add markdown preview --- vimrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 -- 2.43.0