]> git.zndr.dk Git - vimfiles.git/commitdiff
Add markdown preview
authorJannik ZANDER <jannikz@gmail.com>
Mon, 6 Aug 2018 19:31:22 +0000 (21:31 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Mon, 6 Aug 2018 19:31:22 +0000 (21:31 +0200)
vimrc

diff --git a/vimrc b/vimrc
index a591b984f8db4daa798b912044b360acf041b77d..1036769c0b6267de90b48cf6c303161c4397ebe2 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -155,12 +155,12 @@ nnoremap <silent><Leader>t        :TagbarToggle<CR>
 "nnoremap <silent><leader>php      :-1read ~/.vim/template/php<CR>2ja
 
 "" Visual Mode
-vnoremap jk                       <esc>
+"vnoremap jk                       <esc>
 vmap < <gv
 vmap > >gv
 
 " Insert Mode
-inoremap jk                       <esc>
+"inoremap jk                       <esc>
 inoremap <C-U> <C-G>u<C-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 <Leader>md :call Markdown_Preview()<CR>
 
 " Pick
 packadd pick.vim