tybenz / vimdeck

VIM as a presentation tool
MIT License
1.41k stars 57 forks source link

Can't open file presentation/script.vim #19

Closed xautjzd closed 10 years ago

xautjzd commented 10 years ago

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?

tybenz commented 10 years ago

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

tybenz commented 10 years ago

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

dubspeed commented 10 years ago

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

tybenz commented 10 years ago

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.

tybenz commented 10 years ago

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 9 years ago

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