22,981 questions
Advice
1
vote
4
replies
123
views
Pygame or Love2d for game development?
I have been looking at frameworks for game development and I have found that pygame (a python game development libary) and love2d (a lua game development libary) seem the eisiest to learn. I also know ...
2
votes
0
answers
32
views
inlay hints don't work for golang in neovim?
i have hints working for lua, but not for go.
i've already tried a bunch of stuff like several go configs, though it seems like it is a server problem, because Settings: {} is what i get in ...
1
vote
0
answers
41
views
neovim treesitter and mini.ai
I found out the mini.ai html tag selection is very bad but treesitter was so good at it so I decided to change it to treesiter without loosing the good things in mini.ai so I did this config and so ...
-3
votes
0
answers
64
views
How to use auto-completet by Clangd in Lazy.nvim?
To be convenient when coding C/C++ programs, I decided to use Clangd for auto-complete plugin. I went to the official website of Lazy.nvim and read guides to install and use. I tried :Mason and :...
1
vote
1
answer
295
views
How to finish Tree-sitter plugin in Neovim by Lazy.nvim?
I am a newbie Neovim user and I am configuring Neovim by Lazy in init.lua. However, I had a problem when installing Tree-sitter plugin by Lazy.nvim.
In file init.lua, I use below command to install ...
1
vote
0
answers
54
views
Error while configuring jdtls on neovim 0.12 without using any plugin
I am trying to run jdtls lsp on the latest nvim 0.12 with minimal setup without using any plugin for my nvim version:
NVIM v0.12.0-dev-5299967
Build type: Debug
LuaJIT 2.1.1764270282
However, when i ...
3
votes
1
answer
57
views
Object and entity colliding multiple times regardless of disabling cantouch property
I am creating a game about fighting other people in arenas, and when 2 people are in the arena, anyone that tries to enter becomes a spectator, for some reason, the part you touch to enter the arena ...
Best practices
0
votes
7
replies
142
views
In lua, is there a way to "force" an argument to its multiple values
Let tableA = {"a","b","c"}.
print( table.unpack(tableA) ) will print : a b c - the multiples values of table.unpack(tableA) are displayed,
print( table.unpack(tableA) , &...
2
votes
0
answers
64
views
Neovim LuaSnip configuration problem, Lua snippets work correctly but JSON doesn't
I have an NvChad configuration for NeoVim, and I was trying to configure a LuaSnip plugin, but for some reason my Lua snippets are working correctly, but the json ones do not, and I want to figure out ...
4
votes
1
answer
109
views
How to evaluate arithmetic expression in pseudo‑SQL style (Lua 5.1)
In love2D I have a string that represents a mathematical expression, for example:
local expr1 = "[p35] div [p36]"
local expr2 = "((([p35]*100) div [p36]) mod 100)"
local params = {...
Advice
0
votes
3
replies
79
views
String manipulation: extract words under brackets
I'm not yet very familiar with the patterns in Lua's string.gsub function.
If I have a string like this:
Fishing Lure(+100 Fishing Skill)(1 hour)
and I want extract only the string "1 hour"...
-4
votes
2
answers
114
views
Question regarding using : and [] together, Lua
Take the following block of code
function pickrand()
local v = math.random(1,3)
if v==1 then return ‘px' elseif v==2 then return ‘py' elseif v==3 then return 'pb' end
end
prin = {
x = ...
Best practices
0
votes
0
replies
44
views
Lua: install via rockspec a github project, no realease, no version
I'd like to install with rockspec lua-ext but I'm not sure what is the cleanest way to do it via rockspec:
it has no release and luarocks install --local https://github.com/thenumbernine/lua-ext does ...
1
vote
1
answer
75
views
How can I use `chansend()` to update a terminal buffer asynchronously in Neovim?
I have a callback/generator which produces output, possibly after a delay. I'd like to send these outputs to the terminal buffer as they're produced. Here's a mockup:
local term_buf = vim.api....
3
votes
0
answers
68
views
Run multiple test files from master file
I am building a test suite for my Lua application with Busted. I am organizing tests into different files that I would like to run in a given sequence, e.g. low-level unit tests first, up to ...