├── .gitignore ├── repo ├── snipmate │ └── snippets ├── neosnippets │ └── neosnippets ├── ultisnips │ └── UltiSnips │ │ └── pandoc.snippets ├── snippets │ └── pandoc.snippets └── unite │ └── autoload │ └── unite │ └── sources │ └── outline │ └── pandoc.vim ├── autoload └── pandoc │ ├── after │ ├── snipmate.vim │ ├── ultisnips.vim │ ├── neosnippets.vim │ ├── unite.vim │ ├── deoplete.vim │ ├── tablemode.vim │ ├── vimcompletesme.vim │ ├── fastfold.vim │ ├── supertab.vim │ └── nrrwrgn.vim │ └── after.vim ├── plugin └── pandoc-after.vim ├── README.md └── doc └── pandoc-after.txt /.gitignore: -------------------------------------------------------------------------------- 1 | doc/tags 2 | -------------------------------------------------------------------------------- /repo/snipmate/snippets: -------------------------------------------------------------------------------- 1 | ../snippets -------------------------------------------------------------------------------- /repo/neosnippets/neosnippets: -------------------------------------------------------------------------------- 1 | ../snippets -------------------------------------------------------------------------------- /autoload/pandoc/after/snipmate.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#snipmate#Init() 2 | call pandoc#after#AppendRTP("snipmate/") 3 | endfunction 4 | -------------------------------------------------------------------------------- /autoload/pandoc/after/ultisnips.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#ultisnips#Init() 2 | call pandoc#after#AppendRTP("ultisnips/") 3 | endfunction 4 | -------------------------------------------------------------------------------- /autoload/pandoc/after/neosnippets.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#neosnippets#Init() 2 | call pandoc#after#AppendRTP("neosnippets/") 3 | endfunction 4 | -------------------------------------------------------------------------------- /autoload/pandoc/after/unite.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#unite#Init() 2 | if exists(":Unite") == 2 3 | call pandoc#after#AppendRTP("unite/") 4 | endif 5 | endfunction 6 | -------------------------------------------------------------------------------- /autoload/pandoc/after/deoplete.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#deoplete#Init() 2 | " setup deoplete completion 3 | if exists('g:deoplete#omni_patterns') 4 | let g:deoplete#omni_patterns.pandoc = '@\w*' 5 | endif 6 | endfunction 7 | -------------------------------------------------------------------------------- /autoload/pandoc/after/tablemode.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#tablemode#Init() 2 | au User TableModeEnabled call pandoc#formatting#DisableAutoformat() 3 | au User TableModeDisabled call pandoc#formatting#EnableAutoformat() 4 | endfunction 5 | -------------------------------------------------------------------------------- /autoload/pandoc/after/vimcompletesme.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#vimcompletesme#Init() 2 | if stridx(&l:dictionary, 'spell') == -1 && &l:dictionary != "" 3 | setlocal dictionary.=",spell" 4 | endif 5 | let b:vcm_tab_complete = "dict" 6 | endfunction 7 | -------------------------------------------------------------------------------- /autoload/pandoc/after/fastfold.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#fastfold#Init() 2 | autocmd FileType pandoc 3 | \ if exists('#EnableFastFolds') | 4 | \ autocmd! EnableFastFolds | 5 | \ augroup! EnableFastFolds | 6 | \ endif 7 | let g:pandoc#folding#fastfolds = 0 8 | endfunction 9 | -------------------------------------------------------------------------------- /autoload/pandoc/after.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#Init() 2 | if !exists("b:pandoc_after_loaded") || b:pandoc_after_loaded != 1 3 | for module in g:pandoc#after#modules#enabled 4 | exe "call pandoc#after#".module."#Init()" 5 | endfor 6 | let b:pandoc_after_loaded = 1 7 | endif 8 | endfunction 9 | 10 | function! pandoc#after#AppendRTP(path) 11 | let &runtimepath = join([&runtimepath, g:pandoc#after#path . "/repo/". a:path], ",") 12 | endfunction 13 | -------------------------------------------------------------------------------- /autoload/pandoc/after/supertab.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#supertab#Init() 2 | if exists("g:SuperTabDefaultCompletionType") 3 | call SuperTabSetDefaultCompletionType("context") 4 | 5 | if exists('g:SuperTabCompletionContexts') 6 | if exists('g:pandoc#modules#enabled') && index(g:pandoc#modules#enabled, "completion") != -1 7 | let b:SuperTabCompletionContexts = 8 | \ ['pandoc#after#supertab#Context'] + g:SuperTabCompletionContexts 9 | endif 10 | endif 11 | 12 | " disable supertab completions after bullets and numbered list 13 | " items (since one commonly types something like `+` to 14 | " create a list.) 15 | let b:SuperTabNoCompleteAfter = ['\s', '^\s*\(-\|\*\|+\|>\|:\)', '^\s*(\=\d\+\(\.\=\|)\=\)'] 16 | endif 17 | endfunction 18 | 19 | function! pandoc#after#supertab#Context() 20 | return "\\" 21 | endfunction 22 | -------------------------------------------------------------------------------- /plugin/pandoc-after.vim: -------------------------------------------------------------------------------- 1 | " vim: set fdm=marker : 2 | " 3 | " plugin/pandoc-after.vim 4 | " 5 | " third party plugins integration for vim-pandoc 6 | " 7 | 8 | " We require vim-pantondoc 9 | if !exists("g:pandoc#filetypes#handled") 10 | finish 11 | endif 12 | 13 | " Defaults: {{{1 14 | " what plugins to integrate with. 15 | " "goyo" is enabled by default, because it solves a performance issue. 16 | if !exists("g:pandoc#after#modules#enabled") 17 | let g:pandoc#after#modules#enabled = [] 18 | endif "}}}1 19 | 20 | " Globals: {{{1 21 | let g:pandoc#after#path = expand(":p:h:h") 22 | " }}}1 23 | 24 | " Autocommands: {{{1 25 | augroup pandoc_after 26 | let s:exts = [] 27 | for ext in g:pandoc#filetypes#handled 28 | call extend(s:exts, map(g:pandoc_extensions_table[ext], 'v:val')) 29 | endfor 30 | execute 'au BufRead,BufNewFile '.join(s:exts, ",").' call pandoc#after#Init()' 31 | augroup END "}}}1 32 | 33 | -------------------------------------------------------------------------------- /autoload/pandoc/after/nrrwrgn.vim: -------------------------------------------------------------------------------- 1 | function! pandoc#after#nrrwrgn#Init() 2 | if exists(":NR") == 2 3 | noremap cn :call pandoc#after#nrrwrgn#NarrowCodeblock() 4 | noremap tn :call pandoc#after#nrrwrgn#NarrowTeXBlock() 5 | endif 6 | endfunction 7 | 8 | function! pandoc#after#nrrwrgn#NarrowCodeblock() 9 | if markdown#codeblocks#InsideCodeblock() == 1 10 | if exists("b:nrrw_aucmd_create") 11 | let old_hook = b:nrrw_aucmd_create 12 | endif 13 | let b:nrrw_aucmd_create = 'set ft='.markdown#codeblocks#Lang() 14 | let range = markdown#codeblocks#BodyRange() 15 | exe range[0].','.range[1].'NR' 16 | if exists("old_hook") 17 | let b:nrrw_aucmd_create = old_hook 18 | endif 19 | endif 20 | endfunction 21 | 22 | function! pandoc#after#nrrwrgn#NarrowTeXBlock() 23 | if markdown#tex#InsideTeXBlock() == 1 24 | if exists("b:nrrw_aucmd_create") 25 | let old_hook = b:nrrw_aucmd_create 26 | endif 27 | let b:nrrw_aucmd_create = 'set ft=tex' 28 | let range = markdown#tex#BodyRange() 29 | exe range[0].','.range[1].'NR' 30 | if exists("old_hook") 31 | let b:nrrw_aucmd_create = old_hook 32 | endif 33 | endif 34 | endfunction 35 | -------------------------------------------------------------------------------- /repo/ultisnips/UltiSnips/pandoc.snippets: -------------------------------------------------------------------------------- 1 | extends mkd 2 | 3 | snippet %% "Title block" b 4 | % ${1:`!v Filename('', 'title')`} 5 | % ${2:`!v g:snips_author`} 6 | % ${3:`!v strftime("%d %b %Y")`} 7 | 8 | $0 9 | endsnippet 10 | 11 | snippet %%v "Title block" b 12 | % ${VISUAL:`!v Filename('', 'title')`} 13 | % ${2:`!v g:snips_author`} 14 | % ${3:`!v strftime("%d %b %Y")`} 15 | 16 | $0 17 | endsnippet 18 | 19 | snippet :: "Definition" b 20 | ${1:term} 21 | ~ ${2:definition} 22 | endsnippet 23 | 24 | snippet === 25 | `!p 26 | snip.rv = '=' * len(vim.current.buffer[vim.current.window.cursor[0] - 2]) 27 | ` 28 | endsnippet 29 | 30 | snippet --- 31 | `!p 32 | snip.rv = '-' * len(vim.current.buffer[vim.current.window.cursor[0] - 2]) 33 | ` 34 | endsnippet 35 | 36 | snippet [ 37 | [${1:link}](http://${2:url} "${3:title}")$0 38 | endsnippet 39 | 40 | snippet [: 41 | [${1:id}]: http://${2:url} "${3:title}" 42 | endsnippet 43 | 44 | snippet [@ 45 | [${1:link}](mailto:${2:email})${3} 46 | endsnippet 47 | 48 | snippet ![ 49 | ![${1:alt}](${2:url} "${3:tirle}")$0 50 | endsnippet 51 | 52 | snippet ![: 53 | ![${1:id}]: ${2:url} "${3:title}" 54 | endsnippet 55 | 56 | snippet [^: 57 | [^${1:id}]: ${2:note} 58 | endsnippet 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-pandoc-after 2 | 3 | Handles vim-pandoc's integration with third-party plugins. 4 | 5 | ## plugins supported 6 | 7 | (The names used to enable the corresponding modules [see below] are in italics) 8 | 9 | * [ultisnips](https://github.com/SirVer/ultisnips) - *ultisnips* 10 | * [neosnippet](https://github.com/Shougo/neosnippet.vim) - *neosnippets* 11 | * [vim-snipsmate](https://github.com/garbas/vim-snipmate) - *snipmate* 12 | * [unite.vim](https://github.com/Shougo/unite.vim) - *unite* 13 | * [supertab](https://github.com/ervandew/supertab) - *supertab* 14 | * [nrrwrgn](https://github.com/chrisbra/NrrwRgn) - *nrrwrgn* 15 | * [vim-table-mode](https://github.com/dhruvasagar/vim-table-mode/) - *tablemode* 16 | * [vimcompletesme](https://github.com/ajh17/VimCompletesMe) - *vimcompletesme* 17 | * [FastFold](https://github.com/Konfekt/Fastfold) - *fastfold* 18 | 19 | ## Configuration 20 | 21 | To enable plugins' support, you must set the variable 22 | `g:pandoc#after#modules#enabled`. For example, to enable NrrwRgn and ultisnips 23 | support, add the following to your vimrc: 24 | 25 | let g:pandoc#after#modules#enabled = ["nrrwrgn", "ultisnips"] 26 | 27 | ## Other projects worth checking out 28 | 29 | - [unite-bibtext](https://github.com/msprev/unite-bibtex) 30 | -------------------------------------------------------------------------------- /doc/pandoc-after.txt: -------------------------------------------------------------------------------- 1 | *vim-pandoc-after* 2 | 3 | Third-party plugin integration for vim-pandoc. 4 | 5 | - PLUGINS SUPPORTED *vim-pandoc-after-modules* 6 | 7 | * ultisnips (https://github.com/SirVer/ultisnips) 8 | * neosnippet (https://github.com/Shougo/neosnippet.vim) 9 | * vim-snipsmate (https://github.com/garbas/vim-snipmate) 10 | * unite.vim (https://github.com/Shougo/unite.vim) 11 | * supertab (https://github.com/ervandew/supertab) 12 | * nrrwrgn (https://github.com/chrisbra/NrrwRgn) 13 | * vim-table-mode (https://github.com/dhruvasagar/vim-table-mode/) 14 | * vimcompletesme (https://github.com/ajh17/VimCompletesMe) 15 | 16 | Please consult the files in `autoload/pandoc/after` to know what each 17 | module provides. 18 | 19 | - CONFIGURATION *g:pandoc#after#modules#enabled* 20 | 21 | By default, vim-pandoc-after only enables the "goyo" module, because it solves 22 | a performance issue with the interaction of vim-pandoc's folding module and 23 | Goyo. To enable other plugins' support, you must set the variable 24 | `g:pandoc#after#modules#enabled`. For example, to enable NrrwRgn and ultisnips 25 | support, add the following to your vimrc: 26 | 27 | let g:pandoc#after#modules#enabled = ["nrrwrgn", "ultisnips"] 28 | 29 | The valid values are the names of the files in `autoload/pandoc/after/`. 30 | 31 | -------------------------------------------------------------------------------- /repo/snippets/pandoc.snippets: -------------------------------------------------------------------------------- 1 | # 2 | # Snipmate Snippets for Pandoc Markdown 3 | # 4 | # Many snippets have starred versions, i.e., versions 5 | # that end with an asterisk (`*`). These snippets use 6 | # vim's `"*` register---i.e., the contents of the 7 | # system clipboard---to insert text. 8 | 9 | # Insert Title Block 10 | snippet %% 11 | % ${1:`Filename('', 'title')`} 12 | % ${2:`g:snips_author`} 13 | % ${3:`strftime("%d %b %Y")`} 14 | 15 | ${4} 16 | snippet %%* 17 | % ${1:`Filename('', @*)`} 18 | % ${2:`g:snips_author`} 19 | % ${3:`strftime("%d %b %Y")`} 20 | 21 | ${4} 22 | 23 | # Insert Definition List 24 | snippet :: 25 | ${1:term} 26 | ~ ${2:definition} 27 | 28 | # Underline with `=`s or `-`s 29 | snippet === 30 | `repeat('=', strlen(getline(line(".") - 1)))` 31 | 32 | ${1} 33 | snippet --- 34 | `repeat('-', strlen(getline(line(".") - 1)))` 35 | 36 | ${1} 37 | 38 | # Links and their kin 39 | # ------------------- 40 | # 41 | # (These don't play very well with delimitMate) 42 | # 43 | 44 | snippet [ 45 | [${1:link}](http://${2:url} "${3:title}")${4} 46 | snippet [* 47 | [${1:link}](${2:`@*`} "${3:title}")${4} 48 | 49 | snippet [: 50 | [${1:id}]: http://${2:url} "${3:title}" 51 | snippet [:* 52 | [${1:id}]: ${2:`@*`} "${3:title}" 53 | 54 | snippet [@ 55 | [${1:link}](mailto:${2:email})${3} 56 | snippet [@* 57 | [${1:link}](mailto:${2:`@*`})${3} 58 | 59 | snippet [:@ 60 | [${1:id}]: mailto:${2:email} "${3:title}" 61 | snippet [:@* 62 | [${1:id}]: mailto:${2:`@*`} "${3:title}" 63 | 64 | snippet ![ 65 | ![${1:alt}](${2:url} "${3:title}")${4} 66 | snippet ![* 67 | ![${1:alt}](${2:`@*`} "${3:title}")${4} 68 | 69 | snippet ![: 70 | ![${1:id}]: ${2:url} "${3:title}" 71 | snippet ![:* 72 | ![${1:id}]: ${2:`@*`} "${3:title}" 73 | 74 | snippet [^: 75 | [^${1:id}]: ${2:note} 76 | snippet [^:* 77 | [^${1:id}]: ${2:`@*`} 78 | -------------------------------------------------------------------------------- /repo/unite/autoload/unite/sources/outline/pandoc.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " File : autoload/unite/sources/outline/pandoc.vim 3 | " Author : David Sanson 4 | " Updated : 2013-05-29 5 | " 6 | " This is just a copy of the default markdown file that ships with 7 | " [unite-outline](https://github.com/h1mesuke/unite-outline), with the 8 | " function name edited so it will work with the 'pandoc' filetype. 9 | " 10 | " File : autoload/unite/sources/outline/defaults/markdown.vim 11 | " Author : h1mesuke 12 | " Updated : 2012-01-11 13 | " 14 | " Licensed under the MIT license: 15 | " http://www.opensource.org/licenses/mit-license.php 16 | " 17 | "============================================================================= 18 | 19 | " Default outline info for pandoc 20 | " Version: 0.0.5 21 | 22 | function! unite#sources#outline#pandoc#outline_info() 23 | return s:outline_info 24 | endfunction 25 | 26 | "----------------------------------------------------------------------------- 27 | " Outline Info 28 | 29 | let s:outline_info = { 30 | \ 'heading' : '^#\+', 31 | \ 'heading+1': '^[-=]\+$', 32 | \ } 33 | 34 | function! s:outline_info.create_heading(which, heading_line, matched_line, context) 35 | let heading = { 36 | \ 'word' : a:heading_line, 37 | \ 'level': 0, 38 | \ 'type' : 'generic', 39 | \ } 40 | 41 | if a:which ==# 'heading' 42 | let heading.level = strlen(matchstr(a:heading_line, '^#\+')) 43 | let heading.word = substitute(heading.word, '^#\+\s*', '', '') 44 | let heading.word = substitute(heading.word, '\s*#\+\s*$', '', '') 45 | elseif a:which ==# 'heading+1' 46 | if a:matched_line =~ '^=' 47 | let heading.level = 1 48 | else 49 | let heading.level = 2 50 | endif 51 | endif 52 | 53 | if heading.level > 0 54 | let heading.word = substitute(heading.word, '\s*]*>\s*\%(\s*\)\=$', '', '') 55 | return heading 56 | else 57 | return {} 58 | endif 59 | endfunction 60 | --------------------------------------------------------------------------------