adam_0
adam_0

Reputation: 7210

Open a Lua .love file in Vim

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.

Upvotes: 4

Views: 432

Answers (1)

Roxy Light
Roxy Light

Reputation: 5147

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>"))

Upvotes: 7

Related Questions