[HN Gopher] Show HN: Actually Portable Vim (With a Cute Vimrc)
       ___________________________________________________________________
        
       Show HN: Actually Portable Vim (With a Cute Vimrc)
        
       Author : csdvrx
       Score  : 31 points
       Date   : 2023-12-25 22:44 UTC (1 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | 38 wrote:
       | It's not clear what this is. Is it Vim as a single executable? Is
       | so, what is this doing?
       | 
       | ./vim.com -u /zip/usr/share/vim/vimrc
        
         | hoosieree wrote:
         | Looks like Vim compiled with Actually Portable Executable [1]
         | headers to make a cross-platform (and perhaps also bare metal)
         | vim binary.
         | 
         | But I apparently am distracted by shiny things and couldn't
         | focus on any of the other stuff after seeing rainbow
         | indentation for the first time.
         | 
         | [1]: https://justine.lol/ape.html
        
           | tomcam wrote:
           | > Rock musicians have a love-hate relationship with dynamic
           | range compression, since it removes a dimension of complexity
           | from their music, but is necessary in order to sound
           | professional. Bloat might work by the same principles,
           | 
           | Speaking of which I am a bloated rock musician. I don't feel
           | seen.
        
         | brirec wrote:
         | The actual binary (vim.com in this case) is also a valid zip
         | file, which it can read and write as a private virtual mount
         | point. /zip refers to files inside the binary, inside the zip
         | file.
         | 
         | Redbean web server (by the author of Cosmopolitan, Justine.lol)
         | also uses this method to store its web root.
        
         | yjftsjthsd-h wrote:
         | > Is it Vim as a single executable?
         | 
         | Basically; it's using the "Actually Portable Executable" system
         | to make a single binary that includes everything it needs
         | including enough portability stuff to run on different systems
         | directly.
         | 
         | > Is so, what is this doing?
         | 
         | When I say "everything it needs", that includes files; APE
         | binaries, AIUI, include some code to transparently read files
         | embedded in themselves, so that line says "run this vim binary,
         | but when it starts instead of reading the user's normal .vimrc
         | (if any), read the vimrc that we embedded in this binary under
         | the virtual /zip path"
        
       | yellow_lead wrote:
       | > saving backups of files in ~/.vim/backup every time you save,
       | and keeping an undo-per file
       | 
       | Is this a security risk? Not complaining, as it can be changed in
       | the vimrc, just want to pose the question.
        
       ___________________________________________________________________
       (page generated 2023-12-26 23:00 UTC)