Vim LOVE Docs
Vim syntax highlighting and helpfile for LÖVE.
Building the Plugin
The source can be installed from vim.org, or can be built, from the source. If you wish to build it from source, follow the steps below:
Ensure that the following commands will run from the command line:
You may also edit
src/env.txtto set custom values. For instance, if want to use Lua 5.2 instead of 5.3, you may change the line with
lua="lua5.2"(assuming this command brings up the Lua 5.2 interpreter on your system).
You may need to allow the files to be able to run. You need to do this for every file that ends with
.bat if you're on Windows, or
.sh for Mac/Linux. Windows users will need to "Unblock" the
.bat files. See here for how to unblock files. For Mac/Linux users, you will need to
.sh files to allow execution.
Installing the Plugin
Installation varies depending on the plugin manager, but every method requires you to have the plugin built.
Move the directory containing the generated plugin code to
vimfiles\bundle (Windows) or
Point Vundle to the
build branch of the repository:
Move the plugin code to their corresponding directory in
vimfiles\ (Windows) or
~/.vim/ (Mac/Linux). See here for methods of how to install a plugin without a plugin manager.
The syntax portion of the plugin highlights LÖVE functions, such as
love.graphics.rectangle, and more. It also highlights
conf.lua flags, such as
The style of the syntax highlighting can be changed by setting
g:lovedocs_color in your
.vimrc. You can set the string to any valid highlighting specification (see
:help highlight-args). By default, it is set to
g:lovedocs_color = 'guifg=#ff60e2 ctermfg=206'.
The plugin also includes help files for LÖVE, called
love.txt. This file includes help for all of LÖVE's functions, as well as its types, enums, etc. It is generated from love-api, so any discrepancies should be reported there.
The help file can be opened with
:help love.txt, or by specifying a function, enum, or other identifier. The form for searching differs based on what is being searched, but each follows the same basic format:
Functions are found first by their full name. For instance, if you wanted to see the parameters for
love.window.setMode, you could search
Each function features a brief description of what the function does, as well as the different forms of the function (called
Variants) available. Each variant includes a function's return values and types (if any), as well as its parameters and their types (if any).
Types are found by their name. For instance, if I wanted to look up the
File type, I would do so with
:help love-File. The documentation includes a brief description of what the type handles, as well as a list of constructors, supertypes, subtypes, and functions.
Type functions can also be found with the function name, using self-invocation syntax. For instance, if you wanted to read about the
isEOF, you would search
Searching for enums is similar to searching for types: just use the name. For instance, if you wanted to read about the
BufferMode enum, you would search
Constants are separated by dashes. If you want to read about
full, you could search