tybenz/vimdeck

Can't open file presentation/script.vim

Closed this issue · 6 comments

I installed markdown syntax highlighting plugin(tpope/vim-markdown) and SyntaxRange plugin as README, but when I run gem install vimdeck, get errors as follow:

ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/home/xautjzd/.rvm/rubies/ruby-2.0.0-head/bin/ruby extconf.rb
checking for Ruby version >= 2.0.0... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config i
...

after run yum install ImageMagick-devel and reinstall vimdeck, it's OK. So I think vimdeck may depend on rmagick. will it be better to add it to README.?

after installing vimdeck successfully, I write a test.md file,it's content as follows:

## page1
page1


## page2
page2


## page3
page3

when finishing, I run vimdeck test.md, I get the error:

slide001.md 92L, 389C
Error detected while processing command line:
E484: Can't open file presentation/script.vim

but I can find presentation/script.vim in the same directory as test.md.Why?

Are you still seeing this issue? Can you show a list of the files/directories in the folder you're trying to run vimdeck test.md

Any update on this? Did you ever get it to work? Maybe try a newer version?

For me this is related with changing the working directory on opening files, like my spf-13 .vimrc does :

    if !exists('g:spf13_no_autochdir')
        autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
        " Always switch to the current file directory
    endif

So after opening vimdeck the lcd is presentation and source presentation/script.vim fails, but source script.vim works. Maybe you can add a check to see if you are already inside of the presentation folder?

Cheers

That's odd. Vimdeck is simply running vim presentation/*.md -S presentation/script.vim to open the presentation. You'd think that it would run any scripts defined with -S before it ran your normal vimrc stuff.

I can't really add anything to vimdeck to help avoid this. Vimdeck's ruby script doesn't know what your vimrc is going to do, and script.vim isn't loading so I can't detect it at runtime. Even if I could, automatically changing into the file's directory isn't the only concern. Some people may put crazy stuff like cd ~/src into their vimrc.

The best thing I can do is provide a workaround. I recommend putting something like this in your bashrc/bash_profile:

alias vdeck='vimdeck generate slides.md && vim presentation/*.md -S script.vim'
teto commented

I had the same problem. I removed the "autochdir" option in my vimrc and vimdeck then worked normally.