10-18-2010, 10:14 PM | #1 |
creator of calibre
Posts: 43,830
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
ePub and vim
I just discovered that vim can open and edit files inside a zip file automatically, which of course means it can do the same for epub. Which is awesome
Add the following to your .vimrc: Code:
au BufReadCmd *.epub call zip#Browse(expand("<amatch>")) |
10-19-2010, 02:04 AM | #2 |
Grand Sorcerer
Posts: 6,227
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Thank you very much. vim is my text editor at PC, so it's very useful for me.
|
Advert | |
|
10-19-2010, 04:36 AM | #3 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Great tip, thank you!
|
10-19-2010, 04:37 AM | #4 |
Author's pet-geek
Posts: 933
Karma: 1040670
Join Date: Sep 2010
Location: North Queensland, Australia
Device: Kindle 3 Wifi, Onyx Boox M96
|
Got to love the vim... I use gtk-vim a lot here, very nice spreading it all over large panels
|
10-19-2010, 10:53 AM | #5 |
Wizard
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Does it rezip correctly so the epub validates? I know 7zip doesn't.
|
Advert | |
|
10-19-2010, 11:09 AM | #6 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
10-19-2010, 12:47 PM | #7 |
creator of calibre
Posts: 43,830
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
On Unix it uses
zip -u which will only affect the changed files. |
10-25-2010, 09:57 AM | #8 |
Enthusiast
Posts: 48
Karma: 1916
Join Date: Sep 2010
Device: Cybook Opus
|
Great tip, thanks Kovid!
|
10-27-2010, 07:02 AM | #9 |
Avid Reader
Posts: 161
Karma: 36472
Join Date: Sep 2008
Location: Look for rain, hail and snow...
Device: PRS-505, PRS-600, PRS T1, Kobo Glo
|
Thank you very much, this really is handy!
|
07-06-2012, 04:49 PM | #10 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
|
vim and epub
Quote:
I used note pad to insert: "au BufReadCmd *.epub call zip#Browse(expand("<amatch>"))" into my .vimrc file. Any help? Thanks. |
|
07-07-2012, 12:00 AM | #11 |
creator of calibre
Posts: 43,830
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
vim can't find unzip on your system, you need to setup it up so that it can open zip files first, only then will this command work for .epub.
|
07-07-2012, 09:44 AM | #12 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
|
umm....ok thanks. I thought that was what the amendment was for. Have a good day.
|
07-07-2012, 10:17 AM | #13 |
Digital Amanuensis
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Thank you, Kovid.
Being a relative novice to Vim, I wrote a script to decompress an EPUB file, edit it with Vim and recompress it, but your way is much more convenient! |
07-07-2012, 12:41 PM | #14 |
creator of calibre
Posts: 43,830
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
FYI: calibre has such a script (which works for EPUB, HTMLZ and AZW3 files)
calibre-debug --tweak-book filename.epub (Essentially it is the command line version of the calibre GUI Tweak Book feature) |
07-07-2012, 02:06 PM | #15 |
Digital Amanuensis
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Thank you for letting me know.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epub, ePub, EPUB, warum blos ePub? | flowoeB | Lounge | 5 | 11-27-2009 09:37 AM |