Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a Lua .love file in Vim

Tags:

vim

zip

lua

love2d

So today I learned that Vim opens zip files for viewing and modification in an interface very similar to the directory browser.

Is there a way to open .love files accordingly? I tried setting the filetype:

vim red-pill.love -c "set filetype=zip"

...but no luck. It opens as a binary file.

like image 582
adam_0 Avatar asked Mar 20 '23 18:03

adam_0


1 Answers

According to the zip.vim plugin docs:

Apparently there are a number of archivers who generate zip files that don't use the .zip extension (.jar, .xpi, etc). To handle such files, place a line in your <.vimrc> file:

au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>"))

Therefore, add this to your vimrc:

au BufReadCmd *.love call zip#Browse(expand("<amatch>"))
like image 51
Ross Light Avatar answered Mar 23 '23 07:03

Ross Light