fix: ensure single quotes are used consistently across configuration files

This commit is contained in:
2024-11-12 14:19:44 -05:00
parent 0d6750bbcd
commit 3f096313fc
51 changed files with 3097 additions and 3057 deletions
+41 -41
View File
@@ -10,66 +10,66 @@ local M = {}
function M.bootstrap()
do
local rocks_config = {
rocks_path = vim.env.HOME .. "/.local/share/nvim/rocks",
rocks_path = vim.env.HOME .. '/.local/share/nvim/rocks',
}
vim.g.rocks_nvim = rocks_config
local luarocks_path = {
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
vim.fs.joinpath(rocks_config.rocks_path, 'share', 'lua', '5.1', '?.lua'),
vim.fs.joinpath(
rocks_config.rocks_path,
"share",
"lua",
"5.1",
"?",
"init.lua"
'share',
'lua',
'5.1',
'?',
'init.lua'
),
}
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
package.path = package.path .. ';' .. table.concat(luarocks_path, ';')
local luarocks_cpath = {
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.so'),
vim.fs.joinpath(rocks_config.rocks_path, 'lib64', 'lua', '5.1', '?.so'),
-- Remove the dylib and dll paths if you do not need macos or windows support
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dylib"),
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.dylib'),
vim.fs.joinpath(
rocks_config.rocks_path,
"lib64",
"lua",
"5.1",
"?.dylib"
'lib64',
'lua',
'5.1',
'?.dylib'
),
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"),
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.dll'),
vim.fs.joinpath(rocks_config.rocks_path, 'lib64', 'lua', '5.1', '?.dll'),
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
package.cpath = package.cpath .. ';' .. table.concat(luarocks_cpath, ';')
vim.opt.runtimepath:append(
vim.fs.joinpath(
rocks_config.rocks_path,
"lib",
"luarocks",
"rocks-5.1",
"rocks.nvim",
"*"
'lib',
'luarocks',
'rocks-5.1',
'rocks.nvim',
'*'
)
)
end
-- If rocks.nvim is not installed then install it!
if not pcall(require, "rocks") then
if not pcall(require, 'rocks') then
local rocks_location =
---@diagnostic disable-next-line: param-type-mismatch
vim.fs.joinpath(vim.fn.stdpath("cache"), "rocks.nvim")
vim.fs.joinpath(vim.fn.stdpath('cache'), 'rocks.nvim')
if not vim.uv.fs_stat(rocks_location) then
-- Pull down rocks.nvim
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/nvim-neorocks/rocks.nvim",
'git',
'clone',
'--filter=blob:none',
'https://github.com/nvim-neorocks/rocks.nvim',
rocks_location,
})
end
@@ -77,24 +77,24 @@ function M.bootstrap()
-- If the clone was successful then source the bootstrapping script
assert(
vim.v.shell_error == 0,
"rocks.nvim installation failed. Try exiting and re-entering Neovim!"
'rocks.nvim installation failed. Try exiting and re-entering Neovim!'
)
vim.cmd.source(vim.fs.joinpath(rocks_location, "bootstrap.lua"))
vim.cmd.source(vim.fs.joinpath(rocks_location, 'bootstrap.lua'))
vim.fn.delete(rocks_location, "rf")
vim.fn.delete(rocks_location, 'rf')
end
end
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ Ensure Luarocks ━━━━━━━━━━━━━━━━━━━━━━━
function M.ensure_luarocks()
-- Check if 'luarocks' command is available
if os.execute("luarocks --version") ~= 0 then
if os.execute('luarocks --version') ~= 0 then
-- 'luarocks' is not installed, set up 'luarocks.nvim' plugin
local status_ok, lazy = pcall(require, "lazy")
local status_ok, lazy = pcall(require, 'lazy')
if not status_ok then
vim.notify(
"Lazy.nvim not found. Please install it to manage plugins.",
'Lazy.nvim not found. Please install it to manage plugins.',
vim.log.levels.ERROR
)
return
@@ -102,14 +102,14 @@ function M.ensure_luarocks()
lazy.setup({
{
"vhyrro/luarocks.nvim",
'vhyrro/luarocks.nvim',
priority = 1000, -- Ensure this plugin loads first
opts = {
rocks = { "magick" }, -- Example of a rock that you want to install
rocks = { 'magick' }, -- Example of a rock that you want to install
},
config = function()
-- Restart Neovim to apply changes after 'luarocks.nvim' sets up
vim.cmd("source $MYVIMRC | qa")
vim.cmd('source $MYVIMRC | qa')
end,
},
})
@@ -117,17 +117,17 @@ function M.ensure_luarocks()
end
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Rocks plugin spec ━━━━━━━━━━━━━━━━━━━━━━
M.plugin_spec = {
"vhyrro/luarocks.nvim",
'vhyrro/luarocks.nvim',
priority = 1000, -- Very high priority is required
opts = {
rocks = { "magick" }, -- specifies a list of rocks to install
rocks = { 'magick' }, -- specifies a list of rocks to install
},
}
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Load plugins ━━━━━━━━━━━━━━━━━━━━━━━━━
-- Load rocks package manager
M.load_rocks = function()
require("rocks")
require('rocks')
end
-- Perform setup