Vim syntax highlighting and helpfile for LÖVE.
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:
git
lua
vim
You may also edit
src/env.txt
to set custom values. For instance, if want to use Lua 5.2 instead of 5.3, you may change the line withlua="lua"
to belua="lua5.2"
(assuming this command brings up the Lua 5.2 interpreter on your system). -
Next, run
gen.bat
(Windows) orgen.sh
(Mac/Linux). This should generate the plugin code.
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 chmod
the .sh
files to allow execution.
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 ~/.vim/bundle
(Mac/Linux).
Point Vundle to the build
branch of the repository:
Plugin 'https://github.com/davisdude/vim-love-docs/tree/build'
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.
This plugin is comprised of two parts: syntax and the help file.
The syntax portion of the plugin highlights LÖVE functions, such as love.udpate
, love.graphics.rectangle
, and more. It also highlights conf.lua
flags, such as t.console
, t.window.width
, etc.
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: :help love-SEARCH
.
Functions are found first by their full name. For instance, if you wanted to see the parameters for love.window.setMode
, you could search :help love-love.window.setMode
.
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 File
function isEOF
, you would search :help love-File:isEOF
.
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 :help love-BufferMode
.
Constants are separated by dashes. If you want to read about BufferMode
's constant full
, you could search :help love-BufferMode-full
.
Plugins: