From: U-EMEA\59698 <59698@N104828.emea.group.grundfos.com> Date: Wed, 8 Aug 2018 07:34:40 +0000 (+0200) Subject: Add markdown preview X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=1b7742a297ca2e7250c7a45b450b4ec3461aab5a;p=vimfiles.git Add markdown preview --- diff --git a/.gitmodules b/.gitmodules index eeb62fa..87d2d48 100644 --- a/.gitmodules +++ b/.gitmodules @@ -47,13 +47,13 @@ path = pack/async/opt/ale url = https://github.com/w0rp/ale.git [submodule "pack/markdown/opt/vim-javascript"] - path = pack/standard/opt/vim-javascript + path = pack/markdown/opt/vim-javascript url = https://github.com/pangloss/vim-javascript [submodule "pack/markdown/opt/vim-pandoc"] - path = pack/standard/opt/vim-pandoc + path = pack/markdown/opt/vim-pandoc url = https://github.com/vim-pandoc/vim-pandoc.git [submodule "pack/markdown/opt/vim-pandoc-syntax"] - path = pack/standard/opt/vim-pandoc-syntax + path = pack/markdown/opt/vim-pandoc-syntax url = https://github.com/vim-pandoc/vim-pandoc-syntax.git [submodule "pack/async/opt/completor.vim"] path = pack/async/opt/completor.vim @@ -62,7 +62,7 @@ path = pack/async/opt/validator.vim url = https://github.com/maralla/validator.vim.git [submodule "pack/syntax/opt/vim-syntax-extra"] - path = pack/standard/opt/vim-syntax-extra + path = pack/markdown/opt/vim-syntax-extra url = https://github.com/justinmk/vim-syntax-extra.git [submodule "pack/github/opt/supertab"] path = pack/github/opt/supertab @@ -88,9 +88,15 @@ [submodule "pack/async/start/gen_tags.vim"] path = pack/async/opt/gen_tags.vim url = https://github.com/jsfaint/gen_tags.vim.git -[submodule "pack/standard/start/bclose.vim"] - path = pack/standard/start/bclose.vim - url = https://github.com/rbgrouleff/bclose.vim.git [submodule "pack/tpope/start/vim-vinegar"] path = pack/tpope/start/vim-vinegar url = https://github.com/manasthakur/vim-vinegar.git +[submodule "pack/markdown/opt/previm"] + path = pack/markdown/start/previm + url = https://github.com/previm/previm.git +[submodule "pack/markdown/start/open-browser.vim"] + path = pack/markdown/start/open-browser.vim + url = https://github.com/tyru/open-browser.vim.git +[submodule "pack/markdown/start/vim-markdown"] + path = pack/markdown/start/vim-markdown + url = https://github.com/plasticboy/vim-markdown.git diff --git a/pack/markdown/opt/vim-javascript b/pack/markdown/opt/vim-javascript new file mode 160000 index 0000000..39e332a --- /dev/null +++ b/pack/markdown/opt/vim-javascript @@ -0,0 +1 @@ +Subproject commit 39e332a3c36c0115e1eab85c34cf121b7585869d diff --git a/pack/markdown/opt/vim-pandoc b/pack/markdown/opt/vim-pandoc new file mode 160000 index 0000000..0060e5c --- /dev/null +++ b/pack/markdown/opt/vim-pandoc @@ -0,0 +1 @@ +Subproject commit 0060e5c6ac9e4a2391e8a36359dcbbb5827978cb diff --git a/pack/markdown/opt/vim-pandoc-syntax b/pack/markdown/opt/vim-pandoc-syntax new file mode 160000 index 0000000..56e8e41 --- /dev/null +++ b/pack/markdown/opt/vim-pandoc-syntax @@ -0,0 +1 @@ +Subproject commit 56e8e41ef863a0a7d33d85c3c0c895aa6e9e62d3 diff --git a/pack/markdown/opt/vim-syntax-extra b/pack/markdown/opt/vim-syntax-extra new file mode 160000 index 0000000..2290b72 --- /dev/null +++ b/pack/markdown/opt/vim-syntax-extra @@ -0,0 +1 @@ +Subproject commit 2290b72ba48c808d741db300110944a484b8ee9c diff --git a/pack/markdown/start/open-browser.vim b/pack/markdown/start/open-browser.vim new file mode 160000 index 0000000..de4eeb0 --- /dev/null +++ b/pack/markdown/start/open-browser.vim @@ -0,0 +1 @@ +Subproject commit de4eeb085051e9b56dd5574eba7c7e72feb21246 diff --git a/pack/markdown/start/previm b/pack/markdown/start/previm new file mode 160000 index 0000000..6ab010b --- /dev/null +++ b/pack/markdown/start/previm @@ -0,0 +1 @@ +Subproject commit 6ab010bd5a76afcd3772559bc78e76edcd0107d0 diff --git a/pack/markdown/start/vim-markdown b/pack/markdown/start/vim-markdown new file mode 160000 index 0000000..f19506b --- /dev/null +++ b/pack/markdown/start/vim-markdown @@ -0,0 +1 @@ +Subproject commit f19506b1bfe5e60c39581dd53f6913a09385f5dd diff --git a/pack/standard/opt/vim-javascript b/pack/standard/opt/vim-javascript deleted file mode 160000 index 39e332a..0000000 --- a/pack/standard/opt/vim-javascript +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 39e332a3c36c0115e1eab85c34cf121b7585869d diff --git a/pack/standard/opt/vim-pandoc b/pack/standard/opt/vim-pandoc deleted file mode 160000 index 0060e5c..0000000 --- a/pack/standard/opt/vim-pandoc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0060e5c6ac9e4a2391e8a36359dcbbb5827978cb diff --git a/pack/standard/opt/vim-pandoc-syntax b/pack/standard/opt/vim-pandoc-syntax deleted file mode 160000 index 56e8e41..0000000 --- a/pack/standard/opt/vim-pandoc-syntax +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 56e8e41ef863a0a7d33d85c3c0c895aa6e9e62d3 diff --git a/pack/standard/opt/vim-syntax-extra b/pack/standard/opt/vim-syntax-extra deleted file mode 160000 index 2290b72..0000000 --- a/pack/standard/opt/vim-syntax-extra +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2290b72ba48c808d741db300110944a484b8ee9c diff --git a/pack/standard/start/bclose.vim b/pack/standard/start/bclose.vim deleted file mode 160000 index dd55ebc..0000000 --- a/pack/standard/start/bclose.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dd55ebc4097d40b0335f3be15656d31b8fa250ef diff --git a/vimrc b/vimrc index 1f5d6d3..3e2222b 100644 --- a/vimrc +++ b/vimrc @@ -194,9 +194,15 @@ function! s:Iar() endfunction command! -bang -nargs=0 -complete=file Iar call s:Iar() +function! Markdown_Preview() + let b:curr_file = expand('%:p') + call system('pandoc --standalone "' . b:curr_file . '" > markdown-preview.html') + call system('firefox markdown-preview.html 1>/dev/null 2>/dev/null &') +endfunction + " Autocommands if has('autocmd') - augroup expandtabs + augroup tabstospaces autocmd! autocmd FileType c setlocal expandtab softtabstop=2 shiftwidth=2 autocmd FileType cpp setlocal expandtab softtabstop=2 shiftwidth=2 @@ -209,21 +215,21 @@ if has('autocmd') augroup filetypes autocmd! - autocmd bufnewfile,bufread *.md set filetype=pandoc - autocmd bufnewfile,bufread *.gradle set filetype=groovy - autocmd bufnewfile,bufread *.json set filetype=json - autocmd bufnewfile,bufread *.yml set filetype=yaml + autocmd BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} set filetype=markdown + autocmd BufNewfile,BufRead *.gradle set filetype=groovy + autocmd BufNewfile,BufRead *.json set filetype=json + autocmd BufNewfile,BufRead *.yml set filetype=yaml augroup end augroup saveall autocmd! - autocmd focuslost * silent! wa + autocmd FocusLost * silent! wa augroup end augroup numbers autocmd! - autocmd bufenter,focusgained,insertleave * set relativenumber - autocmd bufleave,focuslost,insertenter * set norelativenumber + autocmd BufEnter,FocusGained,InsertLeave * set relativenumber + autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber augroup end augroup vimrc @@ -309,21 +315,18 @@ packadd supertab "let g:validator_c_checkers = ['clang-tidy'] "let g:validator_cpp_checkers = ['clang-tidy'] -" 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('firefox markdown-preview.html 1>/dev/null 2>/dev/null &') -endfunction -nnoremap md :call Markdown_Preview() +" markdown +"packadd vim-pandoc +"packadd vim-pandoc-syntax +packadd vim-markdown +"nnoremap md :call Markdown_Preview() +nnoremap md :PrevimOpen " Pick packadd pick.vim -nnoremap p :call PickFile() -nnoremap b :call PickBuffer() -nnoremap ] :call PickTag() +nnoremap pf :call PickFile() +nnoremap pb :call PickBuffer() +nnoremap pt :call PickTag() let g:pick_height = 10 " javascript