Sarctiann
Sarctiann
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
2025-01-03
-- ~/.congif/nvim/lua/plugins/mojo-conf.lua

return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
on_new_config = function(config)
if vim.fn.executable("mojo-lsp-server") == 0 then
vim.notify(
"(Run `magic shell` before entering neovim)",
vim.log.levels.WARN,
{ title = "MOJO LSP NOT STARTED", icon = "🚨", timeout = 10000 }
)
-- avoid trying to run mojo-lsp-server
config.cmd = { "echo", "" }
return
end
end,
},
},
},
}
-- ~/.congif/nvim/lua/plugins/mojo-conf.lua

return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
on_new_config = function(config)
if vim.fn.executable("mojo-lsp-server") == 0 then
vim.notify(
"(Run `magic shell` before entering neovim)",
vim.log.levels.WARN,
{ title = "MOJO LSP NOT STARTED", icon = "🚨", timeout = 10000 }
)
-- avoid trying to run mojo-lsp-server
config.cmd = { "echo", "" }
return
end
end,
},
},
},
}
After some iterations, I realized it was impossible to run magic shell once nvim started (neither on macOS nor Linux). So this config requires you to run magic shell before starting nvim If so, it will run the LSP
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
No description
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
No description
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
this script works well on macOS but on Linux, you need to run manually magic shell and then nvim 🫤
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
hmm I didn't get this working
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {}
}
}
}
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {}
}
}
}
also worked with lazyvim before I removed the .modular folder to use magic only. @Kennit could you share your installation details?
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
2025-01-03 ~/.congif/nvim/lua/plugins/mojo-conf.lua
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
on_new_config = function(config)
if vim.fn.executable("mojo-lsp-server") == 0 then
-- try to run `magic shell`
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("LSP: " .. result, vim.log.levels.ERROR)
vim.notify("(Run `magic shell` before entering neovim)", vim.log.levels.INFO)
-- avoid trying to run mojo-lsp-server
config.cmd = { "echo", "" }
return
end
end
end,
},
},
},
}
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
on_new_config = function(config)
if vim.fn.executable("mojo-lsp-server") == 0 then
-- try to run `magic shell`
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("LSP: " .. result, vim.log.levels.ERROR)
vim.notify("(Run `magic shell` before entering neovim)", vim.log.levels.INFO)
-- avoid trying to run mojo-lsp-server
config.cmd = { "echo", "" }
return
end
end
end,
},
},
},
}
I have not yet managed to get magic shell to run automatically on linux. But with this configuration at least a solution is offered through a notification.
15 replies
MModular
Created by Sarctiann on 1/2/2025 in #community-showcase
Current NEOVIM config
2024-12-30 ~/.congif/nvim/lua/plugins/mojo-conf.lua
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
-- this is required if you use magic-cli instead of modular-cli
on_new_config = function()
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("error running `magic shell`: " .. result, vim.log.levels.error)
end
end,
},
},
},
}
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
-- this is required if you use magic-cli instead of modular-cli
on_new_config = function()
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("error running `magic shell`: " .. result, vim.log.levels.error)
end
end,
},
},
},
}
I'm using LazyVim with neovim 0.10 (it works on MacOS, but not on Linux)
15 replies
MModular
Created by Sarctiann on 12/30/2024 in #questions
Current NEOVIM config
You are totally right!, Thanks @Ket
4 replies
MModular
Created by Sarctiann on 12/30/2024 in #questions
Current NEOVIM config
2024-12-30 ~/.congif/nvim/lua/plugins/mojo-conf.lua
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
-- this is required if you use magic-cli instead of modular-cli
on_new_config = function()
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("error running `magic shell`: " .. result, vim.log.levels.error)
end
end,
},
},
},
}
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
mojo = {
-- this is required if you use magic-cli instead of modular-cli
on_new_config = function()
local result = vim.fn.system("magic shell")
if vim.v.shell_error ~= 0 then
vim.notify("error running `magic shell`: " .. result, vim.log.levels.error)
end
end,
},
},
},
}
4 replies
MModular
Created by DobyDabaDu on 9/11/2024 in #community-showcase
Terminal Snake Game: from scratch (no 3rd party libraries)
I would love for mojo to have its own input function, and to receive a flag to be non-blocking.
6 replies
MModular
Created by AndreiM on 2/22/2024 in #questions
Why the name Mojo?
lol
7 replies
MModular
Created by Hammad Ali on 2/23/2024 in #questions
Will Mojo Support constants after "let" is gone?
2 replies
MModular
Created by AndreiM on 2/22/2024 in #questions
Why the name Mojo?
😄
7 replies
MModular
Created by AndreiM on 2/22/2024 in #questions
Why the name Mojo?
haha I can guess Modular => Python (magic methods, powerful easy to use) but with the power of the low level => ¿Magic? too generic => Modular == Mojo which means magic
7 replies
MModular
Created by gryznar on 2/7/2024 in #questions
pattern matching as switch - case
I like sweet syntax... all of Python is about that. With the aim of improving human readability. And if Mojo can implement Python match for free, I think it would be perfect.
18 replies