Skip to content
Projets

À propos

♡ A simple Neovim plugin to build games with LÖVE

Jeux et émulation

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

♡  LÖVE 2D  ♡

GitHub release LuaRocks release Reddit post LÖVE Cookbook guide


[!IMPORTANT] Version 3.0.0 introduces breaking changes. If you prefer the old API, pin your installation to version 2.*. See CHANGELOG.md for the full list.

💡 Idea

I wanted to experiment with LÖVE. After reading this Reddit post, I realized that it's not so easy to get started with LÖVE and Neovim. Perhaps the trickiest part is getting LSP to work with LÖVE. It's just one line in the LSP configuration, but it's usually a very niche thing and I can't find many examples about it. Moreover, the ${3rd} libraries will be deprecated in favor of Addons.

Being able to start and stop the game directly from Neovim (with keybindings) is also quite handy. So I decided to pack these functionalities (LSP LÖVE config and game start/stop) into a dead simple plugin (so simple that it can barely be considered a plugin).

However, I believe that providing this simple codebase to explore can be a good introduction to the inner workings of Neovim plugins. People using LÖVE know Lua, so the language barrier boils down to the Neovim specific API.

⚡️ Requirements

📦 Installation

Using vim.pack:

vim.pack.add({
  {
    src = 'https://github.com/S1M0N38/love2d.nvim',
    version = vim.version.range('3'),
  },
})
require('love2d').setup({})
vim.keymap.set('n', '<leader>vr', '<cmd>Love run<cr>',    { desc = 'Run LÖVE' })
vim.keymap.set('n', '<leader>vw', '<cmd>Love watch<cr>',  { desc = 'Watch LÖVE' })
vim.keymap.set('n', '<leader>vi', '<cmd>Love info<cr>',   { desc = 'Info LÖVE' })
vim.keymap.set('n', '<leader>vs', '<cmd>Love stop<cr>',   { desc = 'Stop LÖVE' })
vim.keymap.set('n', '<leader>vo', '<cmd>Love output<cr>', { desc = 'Output panel' })

Using lazy.nvim:

{
  'S1M0N38/love2d.nvim',
  version = '3.*',
  event = 'VeryLazy',
  opts = {},
  keys = {
    { '<leader>v',  '',                     desc = 'LÖVE' },
    { '<leader>vr', '<cmd>Love run<cr>',    desc = 'Run LÖVE' },
    { '<leader>vw', '<cmd>Love watch<cr>',  desc = 'Watch LÖVE' },
    { '<leader>vi', '<cmd>Love info<cr>',   desc = 'Info LÖVE' },
    { '<leader>vs', '<cmd>Love stop<cr>',   desc = 'Stop LÖVE' },
    { '<leader>vo', '<cmd>Love output<cr>', desc = 'Output panel' },
  },
}

🚀 Usage

Read the documentation with :help love2d

Vim/Neovim plugins are usually shipped with :help documentation. Learning how to navigate it is a really valuable skill. If you are not familiar with it, start with :help and read the first 20 lines.

🙏 Acknowledgments

Explorer des projets similaires

Chargement…