GithubHelp home page GithubHelp logo

buahaha / vim-love-docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davisdude/vim-love-docs

0.0 0.0 0.0 1.46 MB

Vim plugin for LÖVE syntax highlighting and help file

Home Page: http://www.vim.org/scripts/script.php?script_id=5298

License: MIT License

Shell 5.58% Lua 84.67% Batchfile 5.60% Vim Script 4.15%

vim-love-docs's Introduction

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:

  1. 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 with lua="lua" to be lua="lua5.2" (assuming this command brings up the Lua 5.2 interpreter on your system).

  2. Next, run gen.bat (Windows) or gen.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.

Installing the Plugin

Installation varies depending on the plugin manager, but every method requires you to have the plugin built.

Pathogen:

Move the directory containing the generated plugin code to vimfiles\bundle (Windows) or ~/.vim/bundle (Mac/Linux).

Vundle:

Point Vundle to the build branch of the repository:

Plugin 'https://github.com/davisdude/vim-love-docs/tree/build'

No manager:

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.

Usage

This plugin is comprised of two parts: syntax and the help file.

Syntax

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'.

Help File

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

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

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.

Enums

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.

Screenshots

Plugins:

vim-love-docs's People

Contributors

davisdude avatar idbrii avatar jacobsims avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.