fix: ensure single quotes are used consistently across configuration files
This commit is contained in:
@@ -6,103 +6,103 @@
|
||||
|
||||
return { --
|
||||
-- Dashboard
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "UIEnter",
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'UIEnter',
|
||||
version = false,
|
||||
opts = function()
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
local logo_path = vim.fs.joinpath(vim.fn.stdpath("config"), "logo/")
|
||||
local logo_path = vim.fs.joinpath(vim.fn.stdpath('config'), 'logo/')
|
||||
local height, width = vim.fn.winheight(0), vim.fn.winwidth(0)
|
||||
local logo_file
|
||||
local logo_dimensions = { width = 0, height = 0 }
|
||||
|
||||
if height >= 80 and width >= 80 then
|
||||
logo_file = "rootiest.txt"
|
||||
logo_file = 'rootiest.txt'
|
||||
elseif height >= 48 and width >= 48 then
|
||||
logo_file = "xerneas.ans"
|
||||
logo_file = 'xerneas.ans'
|
||||
elseif width >= 100 then
|
||||
logo_file = "pikachu.ans"
|
||||
logo_file = 'pikachu.ans'
|
||||
elseif width >= 80 then
|
||||
logo_file = "tall.txt"
|
||||
logo_file = 'tall.txt'
|
||||
elseif width >= 50 then
|
||||
logo_file = "small.txt"
|
||||
logo_file = 'small.txt'
|
||||
else
|
||||
logo_file = "tiny.txt"
|
||||
logo_file = 'tiny.txt'
|
||||
end
|
||||
|
||||
if logo_file == "snorlax.ans" then
|
||||
if logo_file == 'snorlax.ans' then
|
||||
logo_dimensions = { width = 53, height = 25 }
|
||||
elseif logo_file == "porygon-z.ans" then
|
||||
elseif logo_file == 'porygon-z.ans' then
|
||||
logo_dimensions = { width = 28, height = 18 }
|
||||
elseif logo_file == "pikachu.ans" then
|
||||
elseif logo_file == 'pikachu.ans' then
|
||||
logo_dimensions = { width = 22, height = 11 }
|
||||
elseif logo_file == "taco.ans" then
|
||||
elseif logo_file == 'taco.ans' then
|
||||
logo_dimensions = { width = 33, height = 15 }
|
||||
elseif logo_file == "nvim.ans" then
|
||||
elseif logo_file == 'nvim.ans' then
|
||||
logo_dimensions = { width = 35, height = 20 }
|
||||
elseif logo_file == "marshadow.ans" then
|
||||
elseif logo_file == 'marshadow.ans' then
|
||||
logo_dimensions = { width = 28, height = 17 }
|
||||
elseif logo_file == "eiscue.ans" then
|
||||
elseif logo_file == 'eiscue.ans' then
|
||||
logo_dimensions = { width = 22, height = 18 }
|
||||
elseif logo_file == "xerneas.ans" then
|
||||
elseif logo_file == 'xerneas.ans' then
|
||||
logo_dimensions = { width = 39, height = 24 }
|
||||
elseif logo_file == "rootiest.ans" then
|
||||
elseif logo_file == 'rootiest.ans' then
|
||||
logo_dimensions = { width = 65, height = 27 }
|
||||
end
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
theme = 'doom',
|
||||
hide = {
|
||||
statusline = false,
|
||||
tabline = true,
|
||||
},
|
||||
-- By default, use ANSI art header
|
||||
preview = {
|
||||
command = "bat -pp | bat -pp",
|
||||
command = 'bat -pp | bat -pp',
|
||||
file_path = logo_path .. logo_file,
|
||||
file_width = logo_dimensions.width,
|
||||
file_height = logo_dimensions.height,
|
||||
},
|
||||
config = {
|
||||
center = require("data.dash").dashboard_nvim.choices,
|
||||
center = require('data.dash').dashboard_nvim.choices,
|
||||
footer = function()
|
||||
local stats = require("lazy").stats()
|
||||
local stats = require('lazy').stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
return {
|
||||
-- "⚡ Neovim loaded "
|
||||
" Neovim loaded "
|
||||
' Neovim loaded '
|
||||
.. stats.loaded
|
||||
.. "/"
|
||||
.. '/'
|
||||
.. stats.count
|
||||
.. " plugins in "
|
||||
.. ' plugins in '
|
||||
.. ms
|
||||
.. "ms",
|
||||
.. 'ms',
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- if logo_file extension is not .ans or .png then read the content and add it to the header
|
||||
if logo_file:sub(-4) ~= ".ans" and logo_file:sub(-4) ~= ".png" then
|
||||
if logo_file:sub(-4) ~= '.ans' and logo_file:sub(-4) ~= '.png' then
|
||||
local logo_content = vim.fn.readfile(logo_path .. logo_file)
|
||||
local LOGO = "\n\n" .. table.concat(logo_content, "\n") .. "\n\n"
|
||||
opts.config.header = vim.split(LOGO, "\n")
|
||||
local LOGO = '\n\n' .. table.concat(logo_content, '\n') .. '\n\n'
|
||||
opts.config.header = vim.split(LOGO, '\n')
|
||||
opts.preview = nil
|
||||
end
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
button.key_format = " %s"
|
||||
button.desc = button.desc .. string.rep(' ', 43 - #button.desc)
|
||||
button.key_format = ' %s'
|
||||
end
|
||||
|
||||
-- Open dashboard after closing lazy
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
if vim.o.filetype == 'lazy' then
|
||||
vim.api.nvim_create_autocmd('WinClosed', {
|
||||
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||
vim.api.nvim_exec_autocmds('UIEnter', { group = 'dashboard' })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
@@ -110,9 +110,9 @@ return { --
|
||||
|
||||
return opts
|
||||
end,
|
||||
enabled = require("data.func").check_global_var(
|
||||
"dashboard",
|
||||
"nvim-dashboard",
|
||||
"alpha"
|
||||
enabled = require('data.func').check_global_var(
|
||||
'dashboard',
|
||||
'nvim-dashboard',
|
||||
'alpha'
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user