Code Monkey home page Code Monkey logo

vim-pandoc's Introduction

vim-pandoc

Vint

vim-pandoc provides facilities to integrate Vim with the pandoc document converter and work with documents written in its markdown variant (although textile documents are also supported).

vim-pandoc's goals are 1) to provide advanced integration with pandoc, 2) a comfortable document writing environment, and 3) great configurability.

IMPORTANT

  • vim-pandoc doesn't provide syntax support. The user needs to install vim-pandoc/vim-pandoc-syntax alongside it (see below). The reason for this is we have found cleaner to keep the bug tracking of the syntax file and the rest of the system separate.

Outstanding features

  • Modular architecture, so the user is in control of what the plugin does. For example, if you decide you don't want to use our folding rules, you can disable them without it affecting other parts of vim-pandoc. Modules are simple to develop, too.
  • Sets up a comfortable environment for editing prose, either for soft or hard wraps.
  • Can execute pandoc asynchronously, through the :Pandoc command, which can accept any argument pandoc takes, both in regular vim and in neovim.
  • pandoc is a filetype plugin, but it can also attach itself to different filetypes, like textile or restructuredText. The user is not limited to use pandoc with markdown.
  • Useful custom mappings for markdown writers (partially implemented, perpetually ongoing). For example, we provide WYSIWYG-style style toggles for emphasis, strong text, subscripts, etc. Suggestions are welcome.
  • Advanced folding support (syntax assisted, relative ordering...).
  • TOC functionality, using vim's quickfix system.
  • Bibliographies support, like autocompletion of cite keys. We plan to display additional information on the bibliography items on request.
  • Basic hypertext support: follow internal and external links.
  • Annotations: add metadata to your files (comments, TODOs, etc.)

Requirements

  • Vim 7.4/Neovim (we make use of the new python API).
  • Python 3
  • Pandoc 2.x

Installation

The plugin follows the usual bundle structure, so it's easy to install it using pathogen, Vundle or NeoBundle.

The most recent version is available at github. For those who need it, a tarball is available from here.

For Vundle users, it should be enough to add

Plugin 'vim-pandoc/vim-pandoc'

to .vimrc, and then run :PluginInstall.

It is very strongly recommended that all users of vim-pandoc install vim-pandoc-syntax too:

Plugin 'vim-pandoc/vim-pandoc-syntax' 

Contributing

fmoralesc is the project maintainer, and he tries to solve all issues as soon as possible. Help is very much appreciated, in the form of bug reports, fixes, code and suggestions.

If you have a problem, it is better to open a issue in the issue tracker at github. Please state the problem clearly, and if possible, provide a document sample to reproduce it.

Join the chat at https://gitter.im/vim-pandoc/vim-pandoc

vim-pandoc's People

Contributors

1earch avatar adgitate1 avatar alerque avatar alex-chew avatar alok avatar andswitch avatar anuvyklack avatar ayamnova avatar bertin0 avatar blaenk avatar danielwe avatar doronbehar avatar fmoralesc avatar gitter-badger avatar joshtch avatar jtanguy avatar kbro237 avatar kdm9 avatar konfekt avatar lyokha avatar manolomartinez avatar mehalter avatar mhminai avatar nickwynja avatar sapek avatar sh9temp avatar stfl avatar tc-mint avatar thpani avatar tlvince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-pandoc's Issues

Keyboard ToggleOperator register

This is a spring from #58 for the specific issue of keyboard commands.

In ToggleOperator you are using @@ to refer to the @ register, then pasting its contents using P in normal mode. AFAIK P will paste the unnamed register content unless you tell it otherwise. So I assume somehow @ is the unnamed register for you but I couldn't find this usage documented anywhere. Nevertheless, changing @ to another registry (say a) and then pasting from it (normal "aP) solves the problem for me.

Auto-completion of citations fails if there are json files in the folder

Simple to reproduce:

put a JSON file in the local folder, write @a, press C-x C-o: it fails. Remove/rename the json file, it works well.

It seems to be because json files are read localyl first, no matter whether or not they have any references within. I really often add json files to give meta-data about the manuscript, so (although I might be the edge-case), this is quite problematic.

Keyboard mappings for link navigation

There are at least to use cases.

  • First, external links could be opened by xdg-open or its non-unix equivalents. As a special subcase, if a local markdown file exists with the same name than a linked file but a different extension (for example, the URL is /x/y.html and there is a file /x/y.md) a mapping could be offered to open the md file, thus implementing a poor man's wiki.
  • Second, internal links, jumping to them is an important use case. I would add that some support for auto identifiers would be a must have for this internal link jumping to be really useful.

Indent settings for the project

I'm not sure whether the current indent settings for the project are intentional or more or less accidental, but I'm finding it a bit difficult to contribute code consistently formatted. For example:

function! pandoc#keyboard#ToggleOperator(type, ends)$
    let sel_save = &selection$
    let &selection = "inclusive"$
    let reg_save = @@$
    if a:type ==# "v"$
>---execute "normal! `<".a:type."`>x"$
    elseif a:type ==# "char"$
>---let cline = getline(".")$
>---let ccol = getpos(".")[2]$
>---let nchar = cline[ccol]$
>---let pchar = cline[ccol-2]$
>---if cline[ccol] == ""$
>---    " at end$

A tabstop of 6 looks pretty fine but still not completely consistent. Wouldn't it be better to avoid the space/tab mix? What do you think?

Unassorted issues

I've been doing some testing and following is a report of the results. Feel free to reorganize the items you consider relevant in different issues.

Docs:

  • Documentation of the syntax folding#mode is a bit confusing as it's really expr mode at the vim level. Maybe a note like "pandoc syntax mode is implemented as a foldexpr so don't confuse it with vim syntax folding" would help. Another option would be to rename the mode to "absolute" (which is more consistent with "relative", IMO).

Customization

  • Allow custom markers for folders besides 'fold-begin' and 'fold-end'. To use, for example, with Voom '{{{...}}}'-style markers.
  • Add additional map to jump from the TOC but closing the TOC window afterwards (say ).

Quirks

  • At the message buffer pressing the arrow keys will left you in the document buffer with something weird inserted. I guess this is because those keys are sending esc sequences (note: I'm testing this at the terminal).

  • Before the output message buffer I get:

    "pandoc output" [New File]
    vim-pandoc:execute:pandoc -t html -o "test.html" "test.md"
    Press ENTER or type command to continue

So there is the annoying sequence of "press ..." from vim and then "press ..." from the plugin. What is your goal here? Wouldn't it be enough to use the standard makeprg mechanism? Is this additional buffer useful for pandoc background execution? I guess you are addressing these concerns here:

  • A background process launches so notify the user.
  • A background process finishes so notify the user.

As the process usually run pretty fast I get a quick sequence of more or less equivalent messages forcing me to press the , sequence. I've to take a look at the code yet but if you make clear your goals in advance it would be helpful for me.

Bugs:

  • I'm unable to use keyboard shortcuts as i, both in normal and visual modes. The opfunc is rightly set but I think it's not triggering autoloading of pandoc#keyboard.

Problem with plugin and python

Whenever I try to open an .md file I have the error:

"~/Downloads/tesi.md" 3007L, 107658C
Error detected while processing function pandoc#bibliographies#Init..pandoc#bibliographies#Find_Bibliographies:
line 2:
Traceback (most recent call last):
File "", line 1, in
File "/Users/oran/.vim/bundle/vim-pandoc/pythonx/vim_pandoc/bib.py", line 7, in
import subprocess as sp
File "/anaconda/lib/python2.7/subprocess.py", line 427, in
import select
ImportError: dlopen(/anaconda/lib/python2.7/lib-dynload/select.so, 2): Symbol not found: __PyInt_AsInt
Referenced from: /anaconda/lib/python2.7/lib-dynload/select.so
Expected in: dynamic lookup
line 3:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'vim_pandoc' is not defined
E858: Eval did not return a valid python object
Press ENTER or type command to continue

I am using vim under macosx 10.9 and anaconda python install

pantondoc#folding#MarkdownLevelSA is _very_ slow

So lately I've had some time to update some stuff on my site again and I noticed that typing is ridiculously slow, to the point where it freezes up every 2-3 seconds and then ~10 words I typed appear, and this repeats. I was git reseting to previous commits one by one in vim-pandoc-syntax and found that commit 3bfa541a168e097db1ee7e34caf12452a3ce9be0 in vim-pandoc-syntax triggered this. I then cross-referenced it in this project which is where I figured it was being checked for and I noticed it's used to determine whether or not to use the syntax-assisted foldexpr function pantondoc#folding#MarkdownLevelSA.

I'm not sure what can be done to improve the performance of this function. It includes a lot of branches, string/regex compares, and syntax attribute fetching. I was wondering though, since we're using manual syntax checking, why not just use fold-syntax with the foldmethod option? The syn-fold help section shows this:

syn region myFold start="{" end="}" transparent fold
syn sync fromstart
set foldmethod=syntax

Then we can simply add the fold to header syntax groups? I imagine you have a reason for not having done that, but in case it slipped past you or something. If we don't switch to using that entirely, then perhaps we can switch to using that if g:vim_pandoc_syntax_exists? Just some ideas. Right now for me the folding renders everything unusable since it really hinders my typing speed.

folding non-linear headings

By non-linear I mean:

## some heading
## another heading

As opposed to gradually increasing:

# some
## thing
### here
# another

In the first case, it folds all of the headings under one, I guess anonymous, # heading. So you have to open that to see the next two to then expand those.

I use this sometimes for shorter posts to avoid using huge headings for very small content, since it looks better that way.

Obviously this isn't too big of a deal, and from my understanding, if it's even possible to account for, would probably over-complicate things. I know it's not a bug to be exact, but thought I'd mention it in case you can come up with some crazy solution to this.

If the pandoc filetype is set in a modeline, pantondoc doesn't load

Since we don't have a pandoc ftplugin, and instead use an autocommand, if the filetype is set in a modeline, only the syntax file is loaded.

Possible solutions:

  • soft link ftplugin/pandoc.vim to ftplugin/pantondoc.vim
  • copy ftplugin/pantondoc.vim to ftplugin/pandoc.vim

Workaround:

  • call

    runtime ftplugin/pantondoc.vim 
    

fails to execute :Pandoc command when followed by args like -V or -i

The full traceback:

Traceback (most recent call last):
File "", line 1, in
File "/home/bercio/.vim/bundle/vim-pantondoc/pythonx/vim_pandoc/command.py", line 165
self.execute(should_open)
File "/home/bercio/.vim/bundle/vim-pantondoc/pythonx/vim_pandoc/command.py", line 177
vim.command('echoe "vim-pandoc: could not execute pandoc asynchronously"')
vim.error: Vim(echoerr):vim-pandoc: could not execute pandoc asynchronously

I'm on an updated archlinux, vim 7.4 with python support.

bib: ValueError thrown in empty buffers

Error detected while processing function pantondoc_biblio#InitBiblio..pantondoc_biblio#Find_Bibliographies:
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/tom/.vim/bundle/vim-pantondoc/pythonx/pantondoc/bib.py", line 15, in find_bibfiles
    file_name = ".".join(os.path.relpath(vim.current.buffer.name).split(".")[:-1])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 420, in relpath
    raise ValueError("no path specified")
ValueError: no path specified
E858: Eval did not return a valid python object

Steps to reproduce:

  1. Start Vim (in an empty buffer)
  2. :set ft=pandoc

TOC

as in plasticboy/vim-markdown would be a fine convenience.

RMarkdown

Consider adding support for rmarkdown+knitr that is currently just pandoc-markdown with embedded R, preprocessed by knitr to generate pure pandoc-markdown. I think vim-pandoc has all the elements there to implement this in a more or less straightforward way. RMarkdown is a very important tool for the R community but proper tool support is currently confined to RStudio. Despite this, a lot of people uses R outside an IDE and could find a vim-based alternative very attractive.

non-linear folding edge case

I'm not quite sure what's causing this or how to explain it. Load this file with non-linear folding. Notice how 'tmux' is correctly a 'top level' folding, but somehow the rest of the headers of the same level (##) are folded within 'tmux'.

If I had to guess, it's caused by the codeblocks that contain a # for comments. This probably tricks whatever mechanism you're using for non-linear folds into thinking that a level 1 header preceded them.

Keep header text on folds?

Thanks for your plugins supporting pandoc for vim, they are fantastic! Just a minor suggestion here: While the folded headers show the number of lines behind the fold, they don't actually show the header title (the way, say, vim-latex does), which is often more useful. Seems like something that would be easy enough to do?

Cheers,

Replace vim-pandoc

vim-pantondoc/vim-pandoc-syntax has been mature enough to replace vim-pandoc since a while ago. New users are usually confused about the status of the project, and tend to use vim-pandoc or vim-pandoc-syntax. The old vim-pandoc should be deleted and vim-pantondoc should be renamed to vim-pandoc.

To do this we have to

  • Improve the documentation regarding the use of vim-pantondoc+vim-pandoc-syntax.
  • Notify users, through the READMEs and the pandoc mailing list
  • Improve the documentation, make it at least as good as vim-pandoc's.
  • Delete vim-pandoc, after a grace period.
  • Rename vim-pantondoc to vim-pandoc.

Feature request: Enhanced source-code-block editing

It would be fantastic, if there would be a key binding, which drops me into a programming language specific buffer, while editing a certain source-code-block.

For example: While being in a block like

 ```bash
 cd blub
```

I would like to press, say <localleader>s, which drops me into a buffer with filetype bash. Saving and closing the buffer should insert the contents into my markdown document.

folding breaks if codeblock ends in closing tag

If a codeblock ends in a closing tag such as </div>, it interrupts the folding somehow. Also I noticed that right angle brackets > are highlighted as in blockquotes, given the group pandocBlockQuoteinDelimitedCodeBlock. I didn't notice this was added; it kind of messes up the highlighting in my opinion.

Sample:

# test

something something something

# another test

something at the beginning

``` html
something something
this breaks
</div>
```

something at the end

# for good measure

something else

Unfolded:

unfoled

Folded:

folded

Fails to Run in Windows 8.1

I installed both vim-pantondoc and vim-pandoc-syntax via pathogen. Folding and syntax highlighting work, but I receive an error when I run the Pantondoc command (via command mode and the gVim menu). I verified my PC meets the prerequisites by ensuring :echo has("python") && v:version >= 704 reruns a 1.

I have also tried re-installing Pantondoc.

As the error messages I receive as shown below indicate a potential issue related to the Python code and I do not know what else to try to resolve this issue, I'm opening up this issue.

image

indent formatting breaks (?) lists

Lately I've noticed that entering certain things automatically indents the next line. For example, if I am writing a numbered list, then I press enter to write the second item, pressing enter to go to the next line indents it a bit.

Is this expected behavior? I did notice there were some indentation commits lately. It's kind of annoying to have to backspace to undo the indent. If it is I guess I'll just have to blacklist formatting, although I think I do like the rest of that module. Would it make sense to put indentation in its own module?

Of course, if this isn't intended behavior, I would really appreciate it if it were fixed!

Customizable previewer

Please add an option to allow to user to set the command line to preview a file given its type (html, pdf, etc). Ideally this should be a user provided function that builds the command from path and type parameters. Defaulting to xdg-open is fine but sometimes finer control is needed. For example, I script firefox with mozrepl to only reload a page when already opened.

Namespace configuration variables

We should follow this convention for variable naming

 SCOPE:#pandoc#MODULE#SETTING

This makes it more clear where the setting takes effect. For example, now we have g:pantondoc_use_message_buffers, which should be g:pandoc#command#use_message_buffers, g:pantondoc_mark, which should be g:pandoc#keyboard#mark, b:pantondoc_use_basic_folding, which should be b:pandoc#folding#basic, etc.

pandoc.out file created every time :Pandoc is run

everytime I run the :Pandoc command (or :Pandoc!) a pandoc.out within console vim, a file containing:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 21 2014 13:01:41)
Unknown option argument: "--remote-expr"
More info with: "vim -h"

is created. this doesn't happen when i run :Pandoc from gvim. I'm on an updated archlinux.

Suggestions for YAML folding

g:pantondoc_folding_fold_yaml is a really great option. Thanks for doing it! Here are 2 suggestions, that I would love to see:

  1. Only fold the YAML regions (delimited by ---, ...). Currently, any text after the YAML region is also included in the fold, up until a section heading. This interstitial text---between the YAML region and the section heading---plays a logically distinct role to the metadata and so it should be given its own fold.
  2. Add info on the line when folded to cue the reader (e.g. 'xx lines: YAML metadata'). Currently, the YAML fold line is blank.

Thanks!

Multiline tables

Hey!

Pantondoc conceals the contents of my table when I'm trying to do a multiline table (pandoc referece) such as

---------------
my table
-- ------------
1  test

   multiline
---------------

The only thing I see is the header line.

I have these "bundles" installed: vim-pandoc-after, vim-pandoc-syntax, vim-pantondoc

Add folding for `div` blocks

Wrapping a block of text in HTML div tags is the way to add extra
semantic markup to pandoc documents to indicate structure not already
covered by section headings (e.g. marking up some text block as a
speaker's notes on a presentation by wrapping in <div class='notes'></div>:
http://johnmacfarlane.net/pandoc/demo/example9/producing-slide-shows-with-pandoc.html)

Since divs play this important structure-marking role in pandoc, it would be great if they could be folded automatically.

Doesn't set filetype of *.md files to pandoc as default

With only the default g:pantondoc_handled_filetypes = ["markdown", "rst", "textile"], .md files were detected as markdown but not as pandoc. The extra setting g:pantondoc_use_pandoc_markdown = 1 in my .vimrc was required to automatically detect .md files as pandoc filetype. Since this second variable is not documented, maybe this counts as a bug?

ImportError: No module named site

Whenever I try to open a pandoc (markdown) file, vim dies with the error:

ImportError: No module named site

The problem goes away if I disable/remove the vim-pantondoc plugin

Some possibly helpful debugging information:

chris@deathstar:~$ which python
/usr/local/bin/python
chris@deathstar:~$ python --version
Python 2.7.7
chris@deathstar:~$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 28 2014 11:45:21)
MacOS X (unix) version
Included patches: 1-258
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_binary
+arabic          +find_in_path    -mouse_sysmouse  +tag_old_static
+autocmd         +float           +mouse_urxvt     -tag_any_white
+balloon_eval    +folding         +mouse_xterm     +tcl
+browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +fullscreen      -mzscheme        +textobjects
+cindent         -gettext         +netbeans_intg   +title
+clientserver    -hangul_input    +odbeditor       +toolbar
+clipboard       +iconv           +path_extra      +transparency
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
+farsi           +mouse_netterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/System/Library/Frameworks/Tcl.framework/Headers  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_DARWIN_C_SOURCE=1  
Linking: clang   -L. -L/usr/local/lib -L. -L/usr/local/lib -L/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -F/usr/local/Cellar/python/2.7.6_1/Frameworks -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa   -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE -lperl -framework Python  -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby

TOC on document with setext headers yields error

When solely using setext headers and invoking :TOC the following error is shown:

Error detected while processing function pandoc#toc#Show..pandoc#toc#ReDisplay:
line 6:
E486: Pattern not found: \v^([^|]*|){2,2} #

Implement useful mappings, operators and text-objects

I'll keep this issue open for stuff I think should be implemented. Suggestions are most welcome.

Text objects

  • list items
  • definitions
  • codeblocks
  • spans
  • sections

With these, we could, for example, change stuff with natural vim idioms (cipp for changing inside a pandoc paragraph, dipli for deleting a list item, etc.)

Text style operators

  • Apply italics, bold.
  • Apply verbatim formatting,
  • Apply superscript, subscripts, strikeouts, etc.

Commands

Mappings for operations like inserting a table row, creating a reference, etc.

  • Create a reference.
  • Navigate references.
  • Apply a header level
  • Navigate headers.
  • Toggle ordered/unordered list items
  • Create list items
  • Navigate lists.
  • Turn implicit links into explicit.
  • Handle tables. (see #95)

Other

  • indent list item when pressing Tab key in insert mode
  • add the possibility to use different list item characters based on the indentation level (ex: '*' for level 1, '-' for level 2)

Folding #. as a level 1 section

I recently updated vim-pandoc after a long while of not updating it. Before the update, vim-pandoc worked correctly but now it detects a #. sign as a section instead of an item and creates a level 1 fold for it.
I guess it should be an easy fix but since I'm not an expert in vim plugin development it will be difficult for me to locate the exact place which should be fixed.

Cheers!
Omri

Error messages when opening markdown file on Win 8.1

I get the following errors when I open a markdown file (say gvim temp.markdown) on Windows 8.1.

image

I can clear the errors and edit a file, and compile to pdf with Pandoc! pdf, but I would love to never see the errors (and I'm just getting started, so I'm not sure what other features are affected). Please let me know what information you need to troubleshoot.

Thanks for pantondoc!

Maybe rename the plugin?

I find the name of this plugin vim-pantondoc quite confusing. It confuses both the packager and the user. They know pandoc but not pantondoc. Also, the other two plugins are called vim-pandoc-syntax and vim-pandoc-after. Probably this one should also be called vim-pandoc-something?

:Pandoc pdf creates (and leaves) pandoc.out on Windows 8.1 update

When I run :Pandoc pdf almost everything works fine. Pandoc creates the desired pdf output and removes the temporary folder, but leaves an error log. The pandoc.out error log always has the following.

Traceback (most recent call last):
  File "C:\Users\richa_000\vimfiles\bundle\vim-pandoc-master/pythonx\vim_pandoc\async.py", line 35, in <module>
    Popen(command)
  File "C:\Users\richa_000\Anaconda\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Users\richa_000\Anaconda\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

I only lightly use Python, so I really can't say that I do or don't have other problems with my Python install. I use Anaconda python.

FWIW, this error is the same if I use the "Compile and view" menu drop down (I think this is :Pandoc! pdf) and the pdf doesn't open. I use SumatraPDF as my pdf viewer, but have no problems opening it from vim with the latex suite.

xdg-open pollutes display

my xdg-open (Fedora 20) opens both html and pdf with error messages. When it opens html page in firefox it prints to stderr something like

(process:26600): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

When it opens a PDF viewer it prints lots of fontconfig warnings (because i use fonts from ~/.fonts directory). These messages pollute screen and i have to press Ctrl-L every time.

Probably it makes sense to suppress warnings and errors. I did it by replacing line

                pid = Popen([pandoc_open_command,  self._output_file_path + pandoc_open_command_tail])

in command.py by

                with open(os.devnull, 'wb') as fnull:
                    pid = Popen([pandoc_open_command,  self._output_file_path + pandoc_open_command_tail], stderr=fnull)

Passing long arguments to :Pandoc does not work

I want to use a custom template for generating a PDF file. I'm trying to use this command : :Pandoc pdf --template lualatex.template. The pandoc.out file is generated but not the PDF one.

For some additional information, these two commands are currently working :

  • :Pandoc pdf
  • :Pandoc pdf -S

The issue only occurs when I try the first command.

fold level indication with # repeat

I think I remember that in the past, the folds would show the amount of #'s for that particular fold, so I could determine at a glance what level I was at if I couldn't see the surrounding folds. It seems like now the way to tell this is by looking at the number of -'s that precede the # but this isn't as straightforward. When the folds are close to each other you can distinguish the level by looking at its indentation with respect to the surrounding folds, but I think repeating the number of #'s would be much nicer.

I'm wondering how you'd feel about making that change (or revert? I vaguely remember this used to be the behavior). It's not that big of a deal if not, but I think its more useful that way.

:Pandoc! does not work

When I want vim-pantondoc to convert a file to PDF then open it in Preview, I type this : :Pandoc! pdf, as seen in the doc. Unfortunately, it doesn't seem to work. Instead of generating a PDF file, it generates an empty pandoc.out file and does nothing then. When I call :Pandoc pdf, all work correctly.

I can't find what's causing the issue. If I find something else, I'll keep you informed.

python module seems not to load properly

See this reddit thread.

When I run :Pandoc html I get the following error:

 Error detected while processing function pantondoc_command#Pandoc:
 line    3:
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
 NameError: name 'vim' is not defined

Seems to me that the python module vim is not imported. If I do that manually by issuing :py import vim then I no longer get the error message. Instead - nothing happens. Same for the other :Pandoc commands, eg. :Pandoc pdf, :Pandoc! html.

The Pandoc command does nothing, it seems to fail before the execution path (async or sync) is determined.

I've made the plugin import the vim module eagerly, as of commit ebd0fc0. Not sure if it fixed the issue, I can't reproduce the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.