go back to base16-nvim for bufferline styling

This commit is contained in:
lucy 2026-04-03 17:04:39 +02:00
commit 74048e8405
2 changed files with 161 additions and 125 deletions

258
init.lua
View file

@ -1,34 +1,3 @@
-- add plugins
vim.pack.add({
"https://github.com/folke/snacks.nvim",
"https://github.com/nvim-lualine/lualine.nvim",
"https://github.com/RRethy/base16-nvim",
"https://github.com/akinsho/bufferline.nvim",
"https://github.com/nvimdev/lspsaga.nvim",
"https://github.com/neovim/nvim-lspconfig",
"https://github.com/nvim-treesitter/nvim-treesitter",
})
require('lualine').setup()
require('bufferline').setup()
require('snacks').setup({
notifier = { enabled = true },
statuscolumn = { enabled = true },
picker = {}
})
require('lspsaga').setup({
symbol_in_winbar = { enable = true },
lightbulb = {
enable = true,
sign = false,
},
hover = {
max_width = 0.6,
open_link = "gx",
open_browser = "!google-chrome",
}
})
-- general options -- general options
local opt = vim.opt local opt = vim.opt
vim.g.mapleader = " " vim.g.mapleader = " "
@ -43,49 +12,107 @@ opt.signcolumn = "yes"
vim.lsp.inlay_hint.enable = true vim.lsp.inlay_hint.enable = true
opt.tabstop = 8 opt.tabstop = 8
vim.opt.expandtab = true vim.opt.expandtab = true
vim.g.tinted_background_transparent = 1 vim.g.tinted_background_transparent = 0
opt.shiftwidth = 8 opt.shiftwidth = 8
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = { virtual_text = {
spacing = 4, spacing = 4,
source = true, source = true,
}, },
}) })
-- setup lualine -- add plugins
require('lualine').setup({ vim.pack.add({
options = { "https://github.com/folke/snacks.nvim",
component_separators = { left = "", right = "" }, "https://github.com/nvim-lualine/lualine.nvim",
section_separators = { left = "", right = "" }, "https://github.com/RRethy/base16-nvim",
}, "https://github.com/akinsho/bufferline.nvim",
sections = { "https://github.com/nvimdev/lspsaga.nvim",
lualine_a = { "mode" }, "https://github.com/neovim/nvim-lspconfig",
lualine_b = { "diagnostics" }, "https://github.com/nvim-treesitter/nvim-treesitter",
lualine_c = { "filename", "branch", "navic" }, "https://github.com/vyfor/cord.nvim",
lualine_x = { "lsp_status", "filetype" }, "https://github.com/mason-org/mason-lspconfig.nvim.git",
lualine_y = { "progress" }, "https://github.com/mason-org/mason.nvim.git",
lualine_z = { "location" }, "https://github.com/nvim-tree/nvim-web-devicons",
},
}) })
vim.lsp.config("qmlls", {
cmd = { "qmlls6" },
})
require("mason").setup()
require("mason-lspconfig").setup()
require("bufferline").setup({
options = {
themable = true,
numbers = "ordinal",
indicator = {
style = "underline",
},
},
})
require("lualine").setup()
require("snacks").setup({
notifier = { enabled = true },
statuscolumn = { enabled = true },
picker = {},
})
require("lspsaga").setup({
symbol_in_winbar = { enable = true },
lightbulb = {
enable = true,
sign = false,
},
hover = {
max_width = 0.6,
open_link = "gx",
open_browser = "!google-chrome",
},
})
require("cord").setup({
display = {
theme = "atom",
},
editor = { tooltip = "ur gay x3" },
})
require("lualine").setup({
options = {
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "diagnostics" },
lualine_c = { "filename", "branch", "navic" },
lualine_x = { "lsp_status", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
-- keymaps -- keymaps
local map = vim.keymap.set local map = vim.keymap.set
map("n", "<leader>ff", function() map("n", "<leader>ff", function()
Snacks.picker.files() Snacks.picker.files()
end) end)
map("n", "<leader>lg", function() map("n", "<leader>lg", function()
Snacks.picker.grep() Snacks.picker.grep()
end) end)
map("n", "<C-h>", "<C-w>h")
map("n", "<C-j>", "<C-w>j")
map("n", "<C-k>", "<C-w>k")
map("n", "<C-l>", "<C-w>l")
map("n", "<C-S-Left>", ":vertical resize -5<CR>", { silent = true })
map("n", "<C-S-Right>", ":vertical resize +5<CR>", { silent = true })
map("n", "<C-S-Up>", ":resize +5<CR>", { silent = true })
map("n", "<C-S-Down>", ":resize -5<CR>", { silent = true })
-- lsp keybinds -- lsp keybinds
map("n", "K", "<cmd> Lspsaga hover_doc<cr>") map("n", "K", "<cmd> Lspsaga hover_doc<cr>")
map("n", "go", "<cmd> Lspsaga goto_definition<cr>") map("n", "go", "<cmd> Lspsaga goto_definition<cr>")
map("n", "gr", "<cmd> Lspsaga finder<cr>") map("n", "gr", "<cmd> Lspsaga finder<cr>")
map("n", "<leader>qf", "<cmd> Lspsaga code_action<cr>") map("n", "<leader>qf", "<cmd> Lspsaga code_action<cr>")
map("n", "<C-f>", function() map("n", "<C-f>", function()
vim.lsp.buf.format() vim.lsp.buf.format()
end) end)
-- bufferline keybinds -- bufferline keybinds
map("n", "<A-1>", "<cmd> BufferLineGoToBuffer 1 <cr>") map("n", "<A-1>", "<cmd> BufferLineGoToBuffer 1 <cr>")
@ -106,100 +133,89 @@ map("n", "<A-t>", "<cmd>Lspsaga term_toggle<cr>")
map("t", "<esc>", "<c-\\><c-n>") map("t", "<esc>", "<c-\\><c-n>")
map("i", "<C-space>", vim.lsp.completion.get, { desc = "trigger autocompletion" }) map("i", "<C-space>", vim.lsp.completion.get, { desc = "trigger autocompletion" })
-- lsp setup -- lsp setup
vim.lsp.config('*', { vim.lsp.config("*", {
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
vim.lsp.completion.enable(true, client.id, bufnr, { vim.lsp.completion.enable(true, client.id, bufnr, {
autotrigger = true, autotrigger = true,
convert = function(item) convert = function(item)
return { abbr = item.label:gsub("%b()", "") } return { abbr = item.label:gsub("%b()", "") }
end, end,
}) })
vim.keymap.set("i", "<C-space>", vim.lsp.completion.get, { desc = "trigger autocompletion" }) vim.keymap.set("i", "<C-space>", vim.lsp.completion.get, { desc = "trigger autocompletion" })
end end,
}) })
vim.lsp.config('qmlls', {
cmd = { "qmlls6" },
})
vim.lsp.enable('lua_ls')
vim.lsp.enable('qmlls')
vim.lsp.enable('clangd')
vim.o.complete = ".,o" -- use buffer and omnifunc
vim.o.complete = ".,o" -- use buffer and omnifunc
vim.o.completeopt = "fuzzy,menuone,noselect" -- add 'popup' for docs (sometimes) vim.o.completeopt = "fuzzy,menuone,noselect" -- add 'popup' for docs (sometimes)
vim.o.autocomplete = true vim.o.autocomplete = true
vim.o.pumheight = 7 vim.o.pumheight = 7
-- setup autocomplete -- setup autocomplete
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev) callback = function(ev)
vim.lsp.completion.enable(true, ev.data.client_id, ev.buf, { vim.lsp.completion.enable(true, ev.data.client_id, ev.buf, {
-- Optional formating of items -- Optional formating of items
convert = function(item) convert = function(item)
-- Remove leading misc chars for abbr name, -- Remove leading misc chars for abbr name,
-- and cap field to 25 chars -- and cap field to 25 chars
--local abbr = item.label --local abbr = item.label
--abbr = abbr:match("[%w_.]+.*") or abbr --abbr = abbr:match("[%w_.]+.*") or abbr
--abbr = #abbr > 25 and abbr:sub(1, 24) .. "…" or abbr --abbr = #abbr > 25 and abbr:sub(1, 24) .. "…" or abbr
-- --
-- Remove return value -- Remove return value
--local menu = "" --local menu = ""
-- Only show abbr name, remove leading misc chars (bullets etc.), -- Only show abbr name, remove leading misc chars (bullets etc.),
-- and cap field to 15 chars -- and cap field to 15 chars
local abbr = item.label local abbr = item.label
abbr = abbr:gsub("%b()", ""):gsub("%b{}", "") abbr = abbr:gsub("%b()", ""):gsub("%b{}", "")
abbr = abbr:match("[%w_.]+.*") or abbr abbr = abbr:match("[%w_.]+.*") or abbr
abbr = #abbr > 15 and abbr:sub(1, 14) .. "…" or abbr abbr = #abbr > 15 and abbr:sub(1, 14) .. "…" or abbr
-- Cap return value field to 15 chars -- Cap return value field to 15 chars
local menu = item.detail or "" local menu = item.detail or ""
menu = #menu > 15 and menu:sub(1, 14) .. "…" or menu menu = #menu > 15 and menu:sub(1, 14) .. "…" or menu
return { abbr = abbr, menu = menu } return { abbr = abbr, menu = menu }
end, end,
}) })
end, end,
}) })
-- tinty function -- tinty function
local default_theme = "base16-oceanicnext" local default_theme = "base16-oceanicnext"
local function get_tinty_theme() local function get_tinty_theme()
local theme_name = vim.fn.system("cat ~/.local/share/tinted-theming/tinty/current_scheme") local theme_name = vim.fn.system("cat /home/lucy/.local/share/tinted-theming/tinty/current_scheme")
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
return default_theme return default_theme
else else
return vim.trim(theme_name) return vim.trim(theme_name)
end end
end end
local function handle_focus_gained() local function handle_focus_gained()
local new_theme_name = get_tinty_theme() local new_theme_name = get_tinty_theme()
local current_theme_name = vim.g.colors_name local current_theme_name = vim.g.colors_name
if current_theme_name ~= new_theme_name then if current_theme_name ~= new_theme_name then
vim.cmd("colorscheme " .. new_theme_name) vim.cmd("colorscheme " .. new_theme_name)
require("lualine").setup() require("lualine").setup()
end end
require("lualine").setup() require("lualine").setup()
end end
local function main() local function main()
vim.o.termguicolors = true vim.o.termguicolors = true
vim.g.tinted_colorspace = 256 vim.g.tinted_colorspace = 256
local current_theme_name = get_tinty_theme() local current_theme_name = get_tinty_theme()
vim.cmd("colorscheme " .. current_theme_name) vim.cmd("colorscheme " .. current_theme_name)
vim.api.nvim_create_autocmd("FocusGained", { vim.api.nvim_create_autocmd("FocusGained", {
callback = handle_focus_gained, callback = handle_focus_gained,
}) })
end end
main() main()

View file

@ -8,6 +8,10 @@
"rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3", "rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3",
"src": "https://github.com/akinsho/bufferline.nvim" "src": "https://github.com/akinsho/bufferline.nvim"
}, },
"cord.nvim": {
"rev": "283e4a5bdafd0d6187f28e5b739cccab6b4c9c64",
"src": "https://github.com/vyfor/cord.nvim"
},
"lspsaga.nvim": { "lspsaga.nvim": {
"rev": "562d9724e3869ffd1801c572dd149cc9f8d0cc36", "rev": "562d9724e3869ffd1801c572dd149cc9f8d0cc36",
"src": "https://github.com/nvimdev/lspsaga.nvim" "src": "https://github.com/nvimdev/lspsaga.nvim"
@ -16,6 +20,14 @@
"rev": "47f91c416daef12db467145e16bed5bbfe00add8", "rev": "47f91c416daef12db467145e16bed5bbfe00add8",
"src": "https://github.com/nvim-lualine/lualine.nvim" "src": "https://github.com/nvim-lualine/lualine.nvim"
}, },
"mason-lspconfig.nvim": {
"rev": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b",
"src": "https://github.com/mason-org/mason-lspconfig.nvim.git"
},
"mason.nvim": {
"rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65",
"src": "https://github.com/mason-org/mason.nvim.git"
},
"nvim-lspconfig": { "nvim-lspconfig": {
"rev": "8e2084bf5e40c79c1f42210a6ef96a0a4793a763", "rev": "8e2084bf5e40c79c1f42210a6ef96a0a4793a763",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
@ -24,9 +36,17 @@
"rev": "c82bf96f0a773d85304feeb695e1e23b2207ac35", "rev": "c82bf96f0a773d85304feeb695e1e23b2207ac35",
"src": "https://github.com/nvim-treesitter/nvim-treesitter" "src": "https://github.com/nvim-treesitter/nvim-treesitter"
}, },
"nvim-web-devicons": {
"rev": "40e9d5a6cc3db11b309e39593fc7ac03bb844e38",
"src": "https://github.com/nvim-tree/nvim-web-devicons"
},
"snacks.nvim": { "snacks.nvim": {
"rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e", "rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e",
"src": "https://github.com/folke/snacks.nvim" "src": "https://github.com/folke/snacks.nvim"
},
"tinted-vim": {
"rev": "19b03f63f58ffc63aa8e26159a370d6514735581",
"src": "https://github.com/tinted-theming/tinted-vim"
} }
} }
} }