Add alpha

Update catppuccin integrations
Fix lsp hover from noice filter
Fix broken treesitter config
This commit is contained in:
Evie Litherland-Smith 2023-05-11 18:03:39 +01:00
parent f43ff1c472
commit 621ed60516
6 changed files with 98 additions and 16 deletions

View file

@ -0,0 +1,57 @@
return {
"goolord/alpha-nvim",
event = "VimEnter",
opts = function()
local dashboard = require "alpha.themes.dashboard"
local logo = [[
Z
Z
z
z
]]
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("n", "" .. " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", "" .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("g", "󰊢 " .. " Git status", ":Neogit kind=floating <CR>"),
dashboard.button("c", "" .. " Config", ":e $MYVIMRC <CR>"),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy<CR>"),
dashboard.button("q", "" .. " Quit", ":qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
-- 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 = "AlphaReady",
callback = function() require("lazy").show() end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
}

View file

@ -3,11 +3,7 @@ local config = {
term_colors = true, term_colors = true,
transparent_background = true, transparent_background = true,
integrations = { integrations = {
barbar = true, alpha = true,
barbecue = {
dim_dirname = true,
},
dashboard = true,
gitsigns = true, gitsigns = true,
hop = true, hop = true,
indent_blankline = { indent_blankline = {
@ -15,15 +11,17 @@ local config = {
colored_indent_levels = true, colored_indent_levels = true,
}, },
cmp = true, cmp = true,
mason = true, markdown = true,
mini = true,
native_lsp = { native_lsp = {
enabled = true, enabled = true,
}, },
neogit = true, neogit = true,
neotree = true,
noice = true,
notify = true, notify = true,
nvimtree = true,
navic = { navic = {
enabled = false, enabled = true,
custom_bg = "NONE", custom_bg = "NONE",
}, },
treesitter = true, treesitter = true,

View file

@ -30,8 +30,8 @@ return {
win_options = { winblend = 0 }, win_options = { winblend = 0 },
}, },
}, },
status = { lsp = { event = "lsp" } }, status = { lsp = { event = "lsp", kind = "progress" } },
routes = { { view = "mini", filter = { event = "lsp" }, opts = { skip = true } } }, routes = { { view = "mini", filter = { event = "lsp", kind = "progress" }, opts = { skip = true } } },
-- you can enable a preset for easier configuration -- you can enable a preset for easier configuration
presets = { presets = {
bottom_search = false, -- use a classic bottom cmdline for search bottom_search = false, -- use a classic bottom cmdline for search

View file

@ -6,6 +6,22 @@ return {
config = true, config = true,
opts = { opts = {
icons = require "ui.navic_icons", icons = require "ui.navic_icons",
window = { border = "rounded" }, window = {
border = "none",
size = "80%",
sections = {
left = { border = "rounded" },
mid = { border = "rounded" },
right = { border = "rounded", preview = "always" },
},
},
node_markers = {
enabled = true,
icons = {
leaf = " ",
leaf_selected = "",
branch = "",
},
},
}, },
} }

View file

@ -21,13 +21,13 @@ return {
init = function() init = function()
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>") vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>") vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>")
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>") vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>") vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>") vim.keymap.set("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>") vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>") vim.keymap.set("n", "<leader>ft", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>") vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
vim.keymap.set("n", "<leader>fp", "<cmd>Telescope projects<cr>")
end, end,
config = function() config = function()
local trouble = require "trouble.providers.telescope" local trouble = require "trouble.providers.telescope"

View file

@ -10,9 +10,20 @@ return {
"TSUpdate", "TSUpdate",
"TSEnable", "TSEnable",
}, },
config = true, config = function(_, opts)
if type(opts.ensure_installed) == "table" then
-- @type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then return false end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
end,
opts = { opts = {
ensure_installed = { "vim", "regex", "lua", "bash", "markdown", "markdown_inline"}, ensure_installed = { "vim", "regex", "lua", "bash", "markdown", "markdown_inline" },
auto_install = false, auto_install = false,
highlight = { highlight = {
enable = true, enable = true,