From 1b7742a297ca2e7250c7a45b450b4ec3461aab5a Mon Sep 17 00:00:00 2001 From: "U-EMEA\\59698" <59698@N104828.emea.group.grundfos.com> Date: Wed, 8 Aug 2018 09:34:40 +0200 Subject: [PATCH] Add markdown preview --- .gitmodules | 20 ++++++--- .../{standard => markdown}/opt/vim-javascript | 0 pack/{standard => markdown}/opt/vim-pandoc | 0 .../opt/vim-pandoc-syntax | 0 .../opt/vim-syntax-extra | 0 pack/markdown/start/open-browser.vim | 1 + pack/markdown/start/previm | 1 + pack/markdown/start/vim-markdown | 1 + pack/standard/start/bclose.vim | 1 - vimrc | 43 ++++++++++--------- 10 files changed, 39 insertions(+), 28 deletions(-) rename pack/{standard => markdown}/opt/vim-javascript (100%) rename pack/{standard => markdown}/opt/vim-pandoc (100%) rename pack/{standard => markdown}/opt/vim-pandoc-syntax (100%) rename pack/{standard => markdown}/opt/vim-syntax-extra (100%) create mode 160000 pack/markdown/start/open-browser.vim create mode 160000 pack/markdown/start/previm create mode 160000 pack/markdown/start/vim-markdown delete mode 160000 pack/standard/start/bclose.vim 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/standard/opt/vim-javascript b/pack/markdown/opt/vim-javascript similarity index 100% rename from pack/standard/opt/vim-javascript rename to pack/markdown/opt/vim-javascript diff --git a/pack/standard/opt/vim-pandoc b/pack/markdown/opt/vim-pandoc similarity index 100% rename from pack/standard/opt/vim-pandoc rename to pack/markdown/opt/vim-pandoc diff --git a/pack/standard/opt/vim-pandoc-syntax b/pack/markdown/opt/vim-pandoc-syntax similarity index 100% rename from pack/standard/opt/vim-pandoc-syntax rename to pack/markdown/opt/vim-pandoc-syntax diff --git a/pack/standard/opt/vim-syntax-extra b/pack/markdown/opt/vim-syntax-extra similarity index 100% rename from pack/standard/opt/vim-syntax-extra rename to pack/markdown/opt/vim-syntax-extra 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/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 -- 2.43.0