-- it will be laggy and will take time for the initial load
onlyrenderimageatcursor = true,
-- markdown extensions (ie. quarto) can go here
filetypes = { "markdown", "vimwiki", "html" },
},
neorg = {
enabled = true,
clearininsertmode = false,
downloadremoteimages = true,
onlyrenderimageatcursor = false,
filetypes = { "norg" },
},
-- This is disabled by default
-- Detect and render images referenced in HTML files
-- Make sure you have an html treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
html = {
enabled = true,
onlyrenderimageatcursor = true,
-- Enabling "markdown" below allows you to view html images in .md files
-- https://github.com/3rd/image.nvim/issues/234
-- filetypes = { "html", "xhtml", "htm", "markdown" },
filetypes = { "html", "xhtml", "htm" },
},
-- This is disabled by default
-- Detect and render images referenced in CSS files
-- Make sure you have a css treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
css = {
enabled = true,
},
},
maxwidth = nil,
maxheight = nil,
maxwidthwindowpercentage = nil,
-- This is what I changed to make my images look smaller, like a
-- thumbnail, the default value is 50
-- maxheightwindowpercentage = 20,
maxheightwindowpercentage = 40,
-- toggles images when windows are overlapped
windowoverlapclearenabled = false,
windowoverlapclearftignore = { "cmpmenu", "cmpdocs", "" },
-- auto show/hide images when the editor gains/looses focus
editoronlyrenderwhenfocused = true,
-- auto show/hide images in the correct tmux window
-- In the tmux.conf add `set -g visual-activity off`
tmuxshowonlyinactivewindow = true,
-- render image files as images when opened
hijackfilepatterns = { ".png", ".jpg", ".jpeg", ".gif", ".webp", ".avif" },
})
end,
},
}
https://redd.it/1hgon09
@r_lua
onlyrenderimageatcursor = true,
-- markdown extensions (ie. quarto) can go here
filetypes = { "markdown", "vimwiki", "html" },
},
neorg = {
enabled = true,
clearininsertmode = false,
downloadremoteimages = true,
onlyrenderimageatcursor = false,
filetypes = { "norg" },
},
-- This is disabled by default
-- Detect and render images referenced in HTML files
-- Make sure you have an html treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
html = {
enabled = true,
onlyrenderimageatcursor = true,
-- Enabling "markdown" below allows you to view html images in .md files
-- https://github.com/3rd/image.nvim/issues/234
-- filetypes = { "html", "xhtml", "htm", "markdown" },
filetypes = { "html", "xhtml", "htm" },
},
-- This is disabled by default
-- Detect and render images referenced in CSS files
-- Make sure you have a css treesitter parser installed
-- ~/github/dotfiles-latest/neovim/neobean/lua/plugins/treesitter.lua
css = {
enabled = true,
},
},
maxwidth = nil,
maxheight = nil,
maxwidthwindowpercentage = nil,
-- This is what I changed to make my images look smaller, like a
-- thumbnail, the default value is 50
-- maxheightwindowpercentage = 20,
maxheightwindowpercentage = 40,
-- toggles images when windows are overlapped
windowoverlapclearenabled = false,
windowoverlapclearftignore = { "cmpmenu", "cmpdocs", "" },
-- auto show/hide images when the editor gains/looses focus
editoronlyrenderwhenfocused = true,
-- auto show/hide images in the correct tmux window
-- In the tmux.conf add `set -g visual-activity off`
tmuxshowonlyinactivewindow = true,
-- render image files as images when opened
hijackfilepatterns = { ".png", ".jpg", ".jpeg", ".gif", ".webp", ".avif" },
})
end,
},
}
https://redd.it/1hgon09
@r_lua
GitHub
Render HTML images in markdown files · Issue #234 · 3rd/image.nvim
If I open an HTML or CSS file I can render the images in them because of these options html = { enabled = true, }, css = { enabled = true, }, So in my html file I do see the following image rendere...
What’s the difference between “else” and “elseif”?
I am a beginner who just recently started learning off YouTube.
Most of the things I can make out what they mean after watching some videos
But I still don't understand the meaning of the "elseif" statement
I know some degree of visual programming (scratch...), so I for sure know what the "if" and "else" statement means.
But for "elseif", I don't quite understand what the statement does
Like I can say things like
>variable = 2
>if variable == 1 then
> print("blah")
>else
> print("blee")
(correct me if I made a mistake in my example)
Something like this
I figured if I use "elseif", the results will be the same
So what's the purpose of the "elseif" statement?
https://redd.it/1hgurz3
@r_lua
I am a beginner who just recently started learning off YouTube.
Most of the things I can make out what they mean after watching some videos
But I still don't understand the meaning of the "elseif" statement
I know some degree of visual programming (scratch...), so I for sure know what the "if" and "else" statement means.
But for "elseif", I don't quite understand what the statement does
Like I can say things like
>variable = 2
>if variable == 1 then
> print("blah")
>else
> print("blee")
(correct me if I made a mistake in my example)
Something like this
I figured if I use "elseif", the results will be the same
So what's the purpose of the "elseif" statement?
https://redd.it/1hgurz3
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Where to start?
I want to start Lua for fun so I can program on Roblox, I really want to start learning but don’t know where to start. Most coding websites just throw you straight in, but I want the ABSOLUTE beginner help. What I want is like a website or tutorial on Youtube but I doesn’t matter about platform.
Please!!
https://redd.it/1hgzm21
@r_lua
I want to start Lua for fun so I can program on Roblox, I really want to start learning but don’t know where to start. Most coding websites just throw you straight in, but I want the ABSOLUTE beginner help. What I want is like a website or tutorial on Youtube but I doesn’t matter about platform.
Please!!
https://redd.it/1hgzm21
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Can one determine total gc memory allocated?
If I understand correctly,
https://redd.it/1hh09uz
@r_lua
If I understand correctly,
collectgarbage 'count' gives the amount of allocated memory at the time of invocation. Is there a way in standard Lua/LuaJIT to determine the total memory including that previously collected at the time of invocation? That is, is there a way without modifying Lua itself to determine/benchmark how allocation heavy a piece of code is over a particular run? I'm thinking of something like get-bytes-consed from the SBCL Lisp implementation. Something similar to *gc-run-time* might be nice too.https://redd.it/1hh09uz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
https://redd.it/1hh2yvd
@r_lua
My lua noscripts do not work when I launch r6 through steam but when I load up a different account through Ubisoft they work can somone help me get them working for stream?
https://redd.it/1hh2yvd
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do i make a configuration file that a lua reads from?
Hi, i want to make my lua noscript read from a .cfg or a .txt or whatever format is the easiest to toggle things inside it's menu
The code for what controls the checkboxes, sliders, dropboxes looks like this:
What i want is to have somewhere my lua reads from to see what to toggle on and off as a configuration file for the lua noscript, how can i do this, hopefully i gave enough information for people to help me, if not please let me know
https://redd.it/1hi0ur0
@r_lua
Hi, i want to make my lua noscript read from a .cfg or a .txt or whatever format is the easiest to toggle things inside it's menu
The code for what controls the checkboxes, sliders, dropboxes looks like this:
local Controls = { checkbox1 = false, checkbox2 = false, checkbox3 = false, checkbox4= true, Dropdown1 = 1, Dropdown2 = 1, Slider1 = 90, Slider1Input = "", Slider1Editing = false, } What i want is to have somewhere my lua reads from to see what to toggle on and off as a configuration file for the lua noscript, how can i do this, hopefully i gave enough information for people to help me, if not please let me know
https://redd.it/1hi0ur0
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
hello
https://preview.redd.it/wbn7acdk308e1.png?width=844&format=png&auto=webp&s=d4e48660728fd31ad8b66574865957f04e389313
Hello, I have a problem with the Fivem server because on the paid hosting the noscript package does not work, but on the free one it already works and I keep getting the following error
https://redd.it/1hij6m2
@r_lua
https://preview.redd.it/wbn7acdk308e1.png?width=844&format=png&auto=webp&s=d4e48660728fd31ad8b66574865957f04e389313
Hello, I have a problem with the Fivem server because on the paid hosting the noscript package does not work, but on the free one it already works and I keep getting the following error
https://redd.it/1hij6m2
@r_lua
Just a Lil help
Could any Lua/Luau master give me some tips on how to improve my programming? I've already learned a lot from some tutorials on YouTube (a lot). My goal is just to learn enough to be able to create a game on Roblox, as a start, of course.
Thx
https://redd.it/1hivu43
@r_lua
Could any Lua/Luau master give me some tips on how to improve my programming? I've already learned a lot from some tutorials on YouTube (a lot). My goal is just to learn enough to be able to create a game on Roblox, as a start, of course.
Thx
https://redd.it/1hivu43
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
LUA state in 2025?
Hello everyone,
2024 is coming to an end and I'm quite curious about this, what is the current state of LUA in 2025? On the website of LUA, I feel like there's not much of an update. When I search LUA 2024 on Google, the result seems to stop at 2023. There are not many discussions, jobs for LUA also seem to be no result too. So I wonder, what is LUA going to be like in 2025?
The question seems to be vague, I hope you can understand as English is not my first language.
https://redd.it/1hj48nl
@r_lua
Hello everyone,
2024 is coming to an end and I'm quite curious about this, what is the current state of LUA in 2025? On the website of LUA, I feel like there's not much of an update. When I search LUA 2024 on Google, the result seems to stop at 2023. There are not many discussions, jobs for LUA also seem to be no result too. So I wonder, what is LUA going to be like in 2025?
The question seems to be vague, I hope you can understand as English is not my first language.
https://redd.it/1hj48nl
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I want to build a small forum using Lua.
Hello!
I expressed my purpose in the noscript.
What library would you recommend to use?
Something like Python-Flask.
If it has basic support for creating endpoints, requests and templating I am happy.
I heard Lapis is the most mature.
https://redd.it/1hj9f9f
@r_lua
Hello!
I expressed my purpose in the noscript.
What library would you recommend to use?
Something like Python-Flask.
If it has basic support for creating endpoints, requests and templating I am happy.
I heard Lapis is the most mature.
https://redd.it/1hj9f9f
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What is the best way to give a class “private” members?
Giving a class its members in lua implicitly makes them public.
https://redd.it/1hjou4b
@r_lua
Giving a class its members in lua implicitly makes them public.
https://redd.it/1hjou4b
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Javanoscript "this" function but in lua?
I'm here in roblox getting stuck at this.
Javanoscript has this cool thing here where it is like
function button() {
print(this)
}
And the "this" will show whatever button executed this function, it can be fifty button with that function and it is a cool thing, but what about lua?
Button.TouchSwipe:Connect(function(SwipeDirection, Number, Processed)
print("??")
end)
How the hell do i do it, and roblox lua is a little different than lua right?
https://redd.it/1hk0gvh
@r_lua
I'm here in roblox getting stuck at this.
Javanoscript has this cool thing here where it is like
function button() {
print(this)
}
And the "this" will show whatever button executed this function, it can be fifty button with that function and it is a cool thing, but what about lua?
Button.TouchSwipe:Connect(function(SwipeDirection, Number, Processed)
print("??")
end)
How the hell do i do it, and roblox lua is a little different than lua right?
https://redd.it/1hk0gvh
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help with inconsistent iterator behavior
I am familiar with the concept of iterators in other languages, but I can't figure out how to get normal iterator behavior out of lua tables. The top example works normally with string iterators, but the bottom does not with table iterators.
-- works
stringEntries = string.gmatch("text1,text2,text3", "(^,+)")
print(stringEntries)
-- function: 0x5627c89b62c0
print(stringEntries())
-- text1
-- does not work
tableEntries = pairs({
name = {"John", "Jane", "Bob"},
age = {30, 25, 40},
city = {"New York", "Los Angeles", "Chicago"}
})
print(tableEntries)
-- function: 0x5627946f14f0
print(tableEntries())
-- stdin:7: bad argument #1 to 'tableEntries' (table expected, got no value)
-- stack traceback:
-- C: in function 'tableEntries'
-- stdin:7: in main chunk
-- C: in ?
I would expect it to return the next key value pair but it's saying the
Is there some other normal table iterator function that yields a normal iterator instead of whatever
Edit: Code got repeated twice, removed duplicate, added outputs
https://redd.it/1hk4nay
@r_lua
I am familiar with the concept of iterators in other languages, but I can't figure out how to get normal iterator behavior out of lua tables. The top example works normally with string iterators, but the bottom does not with table iterators.
-- works
stringEntries = string.gmatch("text1,text2,text3", "(^,+)")
print(stringEntries)
-- function: 0x5627c89b62c0
print(stringEntries())
-- text1
-- does not work
tableEntries = pairs({
name = {"John", "Jane", "Bob"},
age = {30, 25, 40},
city = {"New York", "Los Angeles", "Chicago"}
})
print(tableEntries)
-- function: 0x5627946f14f0
print(tableEntries())
-- stdin:7: bad argument #1 to 'tableEntries' (table expected, got no value)
-- stack traceback:
-- C: in function 'tableEntries'
-- stdin:7: in main chunk
-- C: in ?
I would expect it to return the next key value pair but it's saying the
tableEntries iterator expected a table as an argument? What argument would I give to an iterator function created from a table already?Is there some other normal table iterator function that yields a normal iterator instead of whatever
pairs does/does not do?Edit: Code got repeated twice, removed duplicate, added outputs
https://redd.it/1hk4nay
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua garbage collection
In Programming in Lua chapter 11.6 - String Buffers the author demonstrates a pitfall for reading files that can be slow due to how garbage collection works in Lua. I'm trying to test this myself so I created a 350KB text file and tried to read it using this code:
local buff = ""
for line in io.lines('data.txt') do
buff = buff .. line .. "\n"
end
The author claimed that reading a file of this size using this code would take almost a minute. But in my case it executed in less than a second. Are the docs outdated? Is there some under the hood optimization? or am I doing something differently?
https://redd.it/1hk6ekt
@r_lua
In Programming in Lua chapter 11.6 - String Buffers the author demonstrates a pitfall for reading files that can be slow due to how garbage collection works in Lua. I'm trying to test this myself so I created a 350KB text file and tried to read it using this code:
local buff = ""
for line in io.lines('data.txt') do
buff = buff .. line .. "\n"
end
The author claimed that reading a file of this size using this code would take almost a minute. But in my case it executed in less than a second. Are the docs outdated? Is there some under the hood optimization? or am I doing something differently?
https://redd.it/1hk6ekt
@r_lua
Couloir 14: VR installation to embark the visitor in an archive of (imaginary) lost+found documents.
https://github.com/astrofra/art-couloir-14
https://redd.it/1hk7qnj
@r_lua
https://github.com/astrofra/art-couloir-14
https://redd.it/1hk7qnj
@r_lua
GitHub
GitHub - astrofra/art-couloir-14: VR installation to embark the visitor in an archive of (imaginary) lost+found documents.
VR installation to embark the visitor in an archive of (imaginary) lost+found documents. - astrofra/art-couloir-14
REDM Coding Issue
I have a friend coding a REDM server and he needs the correct hash for the Lancaster Repeater. I have no idea where to look for this in the RDR2 list and he's pulling his hair trying to figure it out. Can anyone help?
https://redd.it/1hkbwf9
@r_lua
I have a friend coding a REDM server and he needs the correct hash for the Lancaster Repeater. I have no idea where to look for this in the RDR2 list and he's pulling his hair trying to figure it out. Can anyone help?
https://redd.it/1hkbwf9
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is there a way to convert a .lua file into a .xml file?
I am trying to make a mod of a game that used .xml files, I want to know if there is a way to convert it so I don't have to learn a whole now programing language. If you need any information on what I am using, I will gladly provide
https://redd.it/1hkc7i5
@r_lua
I am trying to make a mod of a game that used .xml files, I want to know if there is a way to convert it so I don't have to learn a whole now programing language. If you need any information on what I am using, I will gladly provide
https://redd.it/1hkc7i5
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do i make a lua loading system
Hey, it might seem like a weird question but i’m using luajit, i saw someone make a lua loader inside of their lua in order to interact with the menu in the way of making checkboxes, sliders dropdowns etc
How would someone go about doing this? I have a menu ready to go with checkboxes, sliders, dropdowns etc but
Is this an api specific thing or is it a luajit thing?
https://redd.it/1hkghhv
@r_lua
Hey, it might seem like a weird question but i’m using luajit, i saw someone make a lua loader inside of their lua in order to interact with the menu in the way of making checkboxes, sliders dropdowns etc
How would someone go about doing this? I have a menu ready to go with checkboxes, sliders, dropdowns etc but
Is this an api specific thing or is it a luajit thing?
https://redd.it/1hkghhv
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Help for a timer.create (Gmod Server)
Hello everyone, a few years ago someone gave me a code for my Gmod DarkRP server for automatically launches the ulx playsound ambientdistantbattle.mp3 command every 30 minutes
It was like this :
timer.Create("PlaySound", 1800, 0, function()
ulx playsound("ambientdistantbattle.mp3")
end)
But I think something is still missing...
https://redd.it/1hm164c
@r_lua
Hello everyone, a few years ago someone gave me a code for my Gmod DarkRP server for automatically launches the ulx playsound ambientdistantbattle.mp3 command every 30 minutes
It was like this :
timer.Create("PlaySound", 1800, 0, function()
ulx playsound("ambientdistantbattle.mp3")
end)
But I think something is still missing...
https://redd.it/1hm164c
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
A flexible serialization library (ldump)
The library
Was writing saves for the LOVE game I was writing, was unable to find any library that would be able to fully all of the game state, including AIs, which contain functions with upvalues, tables as keys, circular references etc. I didn't want to manually do partial saves and write tons of boilerplate, so I wrote the thing myself. Right now I am finished with the game (though the game fully isn't), and thought that the library is one of the best of my works, so it may be a good idea to show it to somebody.
It is a to-code serialization, the result is a valid lua expression that can be just
It is on the slower side and produces quite a large output, though, modern compression does wonders, and the saves of quite a large multi-layered level with complex entities weigh about 1 MB and take less than a second. I am looking for feedback, if you have any ideas on how to improve the performance, the API, the documentation or anything else, I would be glad to work with them.
P.S. Some time after writing and debugging the ldump, I found the bitser, which is in many ways better, which was quite a hit for me morally. Though, ldump can customize serialization a bit better, and this way allows to (de)serialize userdata and threads in places where well-configured bitser would produce placeholders (at least it seems that way), so I hope it has some place under the sun and may be useful to somebody.
P.P.S There is a fundamental issue with serializing dynamic data, that after deserializing the
I would be really glad if my library would be useful to someone else.
https://redd.it/1hm30fq
@r_lua
The library
Was writing saves for the LOVE game I was writing, was unable to find any library that would be able to fully all of the game state, including AIs, which contain functions with upvalues, tables as keys, circular references etc. I didn't want to manually do partial saves and write tons of boilerplate, so I wrote the thing myself. Right now I am finished with the game (though the game fully isn't), and thought that the library is one of the best of my works, so it may be a good idea to show it to somebody.
It is a to-code serialization, the result is a valid lua expression that can be just
loaded. Behind the scenes, it does some cool stuff like deconstructing closures into the function and its upvalues and reassembling them back. It is also highly customizable, you can quite comfortably define a serialization function for a metatable or for a concrete values (this becomes useful for threads and userdata, which can't be strictly serialized and don't have metatables, but sometimes need to be somehow recreated when the data loads).It is on the slower side and produces quite a large output, though, modern compression does wonders, and the saves of quite a large multi-layered level with complex entities weigh about 1 MB and take less than a second. I am looking for feedback, if you have any ideas on how to improve the performance, the API, the documentation or anything else, I would be glad to work with them.
P.S. Some time after writing and debugging the ldump, I found the bitser, which is in many ways better, which was quite a hit for me morally. Though, ldump can customize serialization a bit better, and this way allows to (de)serialize userdata and threads in places where well-configured bitser would produce placeholders (at least it seems that way), so I hope it has some place under the sun and may be useful to somebody.
P.P.S There is a fundamental issue with serializing dynamic data, that after deserializing the
== breaks, because the metatables are not equal by reference. This is the case for any serialization library, but I have a solution in development.I would be really glad if my library would be useful to someone else.
https://redd.it/1hm30fq
@r_lua
GitHub
GitHub - girvel/ldump: Serialization library for any lua data
Serialization library for any lua data. Contribute to girvel/ldump development by creating an account on GitHub.
Another Lil help
Someone who knows a lot about Luau/Lua, can you point me a someone learn about developing games on Roblox, (idk :/)
Thx
https://redd.it/1hm6i5n
@r_lua
Someone who knows a lot about Luau/Lua, can you point me a someone learn about developing games on Roblox, (idk :/)
Thx
https://redd.it/1hm6i5n
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community