Merge pull request #353 from genebean/bufferline-and-noice

Bufferline and noice and a few other tweaks
This commit is contained in:
Gene Liverman 2024-01-11 22:19:52 -05:00 committed by GitHub
commit 073fec195c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 199 additions and 11 deletions

View file

@ -19,3 +19,13 @@ vim.keymap.set("n", "<leader>h", ":nohlsearch<CR>")
vim.wo.relativenumber = true
vim.o.termguicolors = true
-- Tips from https://github.com/folke/edgy.nvim
-- views can only be fully collapsed with the global statusline
vim.opt.laststatus = 3
-- Default splitting will cause your main splits to jump when opening an edgebar.
-- To prevent this, set `splitkeep` to either `screen` or `topline`.
vim.opt.splitkeep = "screen"

View file

@ -1,7 +0,0 @@
return{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
event = "BufReadPre",
config = true
}

View file

@ -27,5 +27,7 @@ return {
}
alpha.setup(dashboard.opts)
vim.cmd('autocmd User AlphaReady Neotree show')
end,
}

View file

@ -0,0 +1,49 @@
return {
"akinsho/bufferline.nvim",
after = "catppuccin",
dependencies = { "nvim-tree/nvim-web-devicons" },
version = "*",
config = function()
-- Get the color pallet of the theme flavor I am using
local color_palette = require("catppuccin.palettes").get_palette("frappe")
-- Set variables to use the color they'd use if the background was not transparent
local bg_highlight = color_palette.crust
local separator_fg = color_palette.crust
require("bufferline").setup({
highlights = require("catppuccin.groups.integrations.bufferline").get({
-- Copy settings from Catppuccin bufferline integration and override just the
-- part that is needed to make it look like it would if the background was not
-- set to transparent in catppuccin.lua
-- https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/groups/integrations/bufferline.lua
custom = {
all = {
-- this makes the background behind the tabs contrast with the tabs themselves
fill = { bg = bg_highlight },
-- separators
-- I am only overriding the foreground as that is what makes the tabs look correct
separator = { fg = separator_fg },
separator_visible = { fg = separator_fg },
separator_selected = { fg = separator_fg },
offset_separator = { fg = separator_fg },
},
},
}),
options = {
mode = "buffers",
separator_style = "slant",
offsets = {
{
filetype = "neo-tree",
text = "File Explorer",
highlight = "Directory",
separator = true,
},
},
diagnostics = "nvim_lsp",
},
})
end,
}

View file

@ -18,6 +18,7 @@ return {
custom_highlights = function(colors)
return {
Comment = { fg = colors.subtext0 },
LineNr = { fg = colors.subtext0 },
}
end,
})

View file

@ -0,0 +1,65 @@
return {
"folke/edgy.nvim",
event = "VeryLazy",
opts = {
exit_when_last = true,
bottom = {
-- toggleterm / lazyterm at the bottom with a height of 40% of the screen
{
ft = "toggleterm",
size = { height = 0.2 },
-- exclude floating windows
filter = function(buf, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
"Trouble",
{ ft = "qf", title = "QuickFix" },
{
ft = "help",
size = { height = 20 },
-- only show help buffers
filter = function(buf)
return vim.bo[buf].buftype == "help"
end,
},
{ ft = "spectre_panel", size = { height = 0.4 } },
},
left = {
-- Neo-tree filesystem always takes half the screen height
{
title = "Neo-Tree",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "filesystem"
end,
size = { height = 0.5 },
},
{
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
},
{
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
},
{
ft = "Outline",
pinned = true,
open = "SymbolsOutlineOpen",
},
-- any other neo-tree windows
"neo-tree",
},
},
}

View file

@ -8,6 +8,7 @@ return {
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"lemminx", -- xml
"lua_ls", -- lua
"nil_ls", -- nix
"puppet", -- puppet
@ -32,6 +33,11 @@ return {
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.lemminx.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
on_attach = on_attach,

View file

@ -19,10 +19,6 @@ return {
hijack_netrw_behavior = "open_default",
},
follow_current_file = { enabled = true },
source_selector = {
winbar = true,
statusline = false,
},
})
end,
}

View file

@ -0,0 +1,61 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
-- add any options here
},
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
-- "rcarriga/nvim-notify",
},
config = function()
require("noice").setup({
cmdline = { enabled = true },
messages = { enabled = false },
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
views = {
cmdline_popup = {
position = {
row = "50%",
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = "61%",
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
})
end,
}

View file

@ -0,0 +1,5 @@
return {
"akinsho/toggleterm.nvim",
version = "*",
config = true,
}