feat: suppress vim linting

main
jaredgoldman 2024-04-10 19:18:57 -04:00
parent 28db441192
commit b45fe90dd4
5 changed files with 79 additions and 65 deletions

View File

@ -13,6 +13,5 @@ require("config.harpoon")
require("config.autopairs") require("config.autopairs")
require("config.autotags") require("config.autotags")
require("config.conform") require("config.conform")
-- require("config.dashboard")
require("options") require("options")
require("keymaps") require("keymaps")

View File

@ -0,0 +1,65 @@
local M = {}
M.dashboard_config = function()
local logo = [[
Z
Z
z
z
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
-- { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" },
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent Files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find Text", icon = "", key = "g" },
{ action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return {
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms",
}
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end
return opts
end
return M

View File

@ -61,5 +61,11 @@ for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({ lspconfig[lsp].setup({
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
-- For suppressing vim error messages in config
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
},
},
}) })
end end

View File

@ -1,3 +1,4 @@
local dashboard = require("config.dashboard")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
@ -14,77 +15,20 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
-- Dashboard
{ {
"nvimdev/dashboard-nvim", "nvimdev/dashboard-nvim",
event = "VimEnter", event = "VimEnter",
opts = function() opts = dashboard.dashboard_config,
local logo = [[
Z
Z
z
z
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
-- { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" },
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = "Telescope oldfiles", desc = " Recent Files", icon = "", key = "r" },
{ action = "Telescope live_grep", desc = " Find Text", icon = "", key = "g" },
{ action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return {
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms",
}
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end
return opts
end,
}, },
-- Theming
"tanvirtin/monokai.nvim", "tanvirtin/monokai.nvim",
"yorickpeterse/nvim-grey",
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{ {
"onsails/lspkind.nvim", "onsails/lspkind.nvim",
event = { "VimEnter" }, event = { "VimEnter" },
}, },
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
-- Auto-completion engine -- Auto-completion engine
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
@ -144,5 +88,4 @@ require("lazy").setup({
opts = {}, opts = {},
}, },
"f-person/git-blame.nvim", "f-person/git-blame.nvim",
"yorickpeterse/nvim-grey",
}) })

View File

@ -10,5 +10,6 @@
- extended history x - extended history x
- auto-pairs x - auto-pairs x
- lua vim linting x - lua vim linting x
- dashboard - dashboard x
- suppress vim global warnings x
- debugger - debugger