Background
I’m using fugitive.vim for efficient verson control.1
Problem
Tonight, I wrote an article about Venn diagram, and I attempted to publish it using the Vim editor command
:Gpush|!rake gen_deploy && rake notify
After that, the following error message popped up.
[owner@localhost ~/octopress]$ vi
To git@github.com:VincentTam/vincenttam.github.io.git
c6c422a..fc8d6b8 source -> source
## Generating Site with Jekyll
write source/stylesheets/screen.css
Configuration file: /home/owner/octopress/_config.yml
Source: source
Destination: public
Generating...
done.
Auto-regeneration: disabled. Use --watch to enable.
cp -r source/_posts/.2016-02-09-my-venn-diagram-mistake.markdown.swp public/_posts/.2016-02-09-my-venn-diagram-mistake.markdown.swp
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - public/_posts/.2016-02-09-my-venn-diagram-mistake.markdown.swp
/home/owner/octopress/Rakefile:276:in `block (2 levels) in <top (required)>'
/home/owner/octopress/Rakefile:275:in `block in <top (required)>'
/home/owner/octopress/Rakefile:265:in `block in <top (required)>'
/home/owner/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/home/owner/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => copydot
(See full trace by running task with --trace)
shell returned 1
Press ENTER or type command to continue
When one sees an error message like above for the first time, one needs not look directly into code, even though one is writing code in an IDE. Instead, one may view the error log to see what’s wrong.
From the command cp -r ...
, I realised that the problem came from
Rakefile
, which tried to copy the non-existent
.2016-blablabla.markdown.swp
in the public
folder in the local
folder for this blog to the _deploy
folder.2 (There are
no _posts
folder under the public
folder.)
How can I do the task within Vim?