Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♡   LÖVE Vim syntax  ♡

Generate love2d-vim-syntax License Lua LÖVE API Vim

Beautiful syntax highlighting 📝

📜 About

love2d-vim-syntax is a comprehensive plugin for Vim that highlight LÖVE syntax in your editor.

  • 🎨 Syntax Highlighting — Colors LÖVE functions, modules, types, and callbacks
  • 🔧 Customizable — Flexible styling options for Vim

Table of Contents

🚀 Features

✨ Highlighting

highlight-feat
-- LÖVE functions light up automatically
love.graphics.rectangle("fill", 100, 100, 200, 200)

-- Callbacks are specially highlighted
function love.load()
end

-- Configuration flags in conf.lua get special treatment
function love.conf(t)
    t.window.width = 800
    t.window.height = 600
end

📦 Installation

Plug "yorik1984/love2d-vim-syntax"

🔧 Settings

The style of the syntax highlighting can be changed by setting g:love_colors_<name> in your .vimrc:

let g:love_colors_love = 'guifg=#E54D95 ctermfg=162 gui=bold cterm=bold'

You can set the string to any valid highlighting specification (see :help highlight-args). Defaults are:

Highlight Group Variable Name Parameters (GUI/CTERM)
Love g:love_colors_love guifg=#E54D95 ctermfg=162 gui=bold cterm=bold
Lovet g:love_colors_module guifg=#E54D95 ctermfg=162
LoveDot g:love_colors_module guifg=#E54D95 ctermfg=162
LoveModule g:love_colors_module guifg=#E54D95 ctermfg=162
LoveType g:love_colors_type guifg=#E54D95 ctermfg=162
LoveFunction g:love_colors_function guifg=#2FA8DC ctermfg=38
LoveMethod g:love_colors_function guifg=#2FA8DC ctermfg=38
LoveCallback g:love_colors_callback guifg=#2FA8DC ctermfg=38
LoveConf g:love_colors_conf guifg=#2FA8DC ctermfg=38

🔄 Rebuilding the API

🤖 Automated Workflow

This plugin uses GitHub Actions to automatically stay up-to-date with the latest LÖVE API:

Feature Details
Schedule Every Monday at 00:30 UTC
Trigger Manual dispatch via Actions tab
Source love2d-community/love-api
Updates Vim syntax files

How it works:

  1. 🔄 Fetches the latest LÖVE API specification
  2. 🎨 Updates syntax highlighting rules
  3. 🚀 Automatically commits changes to the repository
  4. 📌 Creates version branches (e.g., 11.5, 12.0) for API version tracking

Note

The badge at the top of this README always shows the current LÖVE API version supported by this plugin.

✋ Manual Generation (Optional)

Tip

You don't need to do this! The automated workflow keeps everything up-to-date.
Manual generation is only for:

  • Testing custom modifications
  • Contributing to plugin development
  • Offline environments without GitHub Actions

If you still want to generate files manually:

  • Prerequisites:
# Ensure these are installed
git --version
lua -v           # Lua 5.1
  • Configure (optional): Edit build/env.txt to set custom paths:
lua="lua5.1"     # Change to your Lua version
  • Run the generator:
# On Linux/Mac
chmod +x build/gen.sh
./build/gen.sh

# On Windows
build/gen.bat

🎨 Screenshots

papercolor-theme

Vim screenshot

📚 References & Related Projects

  • love2d-snippets
    A snippet generator and collection for the LÖVE framework, compatible with VS Code, Neovim (via LuaSnip), and any editor that supports VS Code-style snippets.

    • 🤖 Automated Updates: GitHub Actions parses the official love-api and generates up-to-date snippets whenever the API changes.
    • 📦 Full API Coverage: Includes snippets for all modules, functions, callbacks, type methods, constructors, getters/setters, enums, and conf.lua.
    • ⌨️ Tabs for Indentation: Uses tab characters (\t) for indentation, allowing each developer to configure their preferred display width (2, 4, 8 spaces, etc.) without changing the actual files.
    • 📌 Version Branches: Repository branches match LÖVE versions (e.g., branch 11.5 for LÖVE 11.5), while the main branch always contains the latest API.
  • love2d-definitions
    LuaCATS definition for LÖVE framework. Creates ---@class and ---@alias definitions for perfect autocompletion and type checking in IDEs with LuaCATS.

    • 🤖 Automated Updates: Uses GitHub Actions to stay in sync with the official love-api, just like this plugin.
    • 📦 Ready-to-Use: Provides a pre-generated library/ folder that you can directly add to your workspace library.
    • 🧠 Smart Type System: Intelligently handles type unions, plural forms (e.g., tablestable[]), optional parameters, and function overloads.
    • 📌 Version Branches: Includes branches for specific LÖVE versions (e.g., 11.5), so you can use annotations that match your project.
  • love2d-docs.nvim
    Is a comprehensive plugin for Neovim and Vim that brings the entire LÖVE game framework documentation right into your editor.

    • 📖 Built-in Help — Complete LÖVE API documentation accessible via :help LOVE-*
  • love2d-tresitter.nvim
    Is a comprehensive plugin for Neovim that highlight LÖVE syntax in your editor. Provides complete LÖVE API syntax highlighting for LÖVE functions, modules, types, and callbacks, with full Treesitter support.

    • 🤖 Automated Updates: Uses GitHub Actions to stay in sync with the official love-api, just like this plugin.
    • ⚙️ Fully Customizable: Offers flexible styling options for colors and font styles (bold, italic, etc.).
    • 📌 Version Branches: Maintains version-specific branches (e.g., 11.5) to match different LÖVE releases.

🙏 Credits

Built with ♡ for the LÖVE community
Report Issue · Discussion · LÖVE

About

Enhanced LÖVE syntax highlighting for Vim

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages