| 
			
			 | 
		#1 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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>"))
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 frumious Bandersnatch 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,570 
				Karma: 20150435 
				Join Date: Jan 2008 
				Location: Spaniard in Sweden 
				
				
				Device: Cybook Orizon, Kobo Aura 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Great tip, thank you!  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 frumious Bandersnatch 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,570 
				Karma: 20150435 
				Join Date: Jan 2008 
				Location: Spaniard in Sweden 
				
				
				Device: Cybook Orizon, Kobo Aura 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			On Unix it uses 
		
	
		
		
		
		
		
		
		
		
		
		
	
	zip -u which will only affect the changed files.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Enthusiast 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48 
				Karma: 1916 
				Join Date: Sep 2010 
				
				
				
				Device: Cybook Opus 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Great tip, thanks Kovid!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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!  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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)  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| epub, ePub, EPUB, warum blos ePub? | flowoeB | Lounge | 5 | 11-27-2009 10:37 AM |