Skip to content
项目

关于

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

游戏与模拟器

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

♡  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

探索相关项目

加载中…