Update Neovim UI tutorial config

This commit is contained in:
2026-04-01 21:03:04 +02:00
parent f494b1840a
commit c7f0678ed4
4 changed files with 128 additions and 19 deletions

View File

@@ -1,4 +1,3 @@
require("tracer.options") require("tracer.options")
require("tracer.plugins") require("tracer.plugins")
pcall(require, "tracer.plugins.telescope") pcall(require, "tracer.plugins.telescope")
require("tracer.statusline")

View File

@@ -18,24 +18,6 @@ opt.wildmode = "longest:full,full"
opt.title = true opt.title = true
opt.signcolumn = 'yes:1' opt.signcolumn = 'yes:1'
vim.cmd.colorscheme("slate")
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
if normalfloat_hl.bg then
vim.api.nvim_set_hl(0, "FloatBorder", {
fg = normalfloat_hl.bg,
bg = normalfloat_hl.bg,
})
end
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
if cursorline_hl.bg then
vim.api.nvim_set_hl(0, "CursorLineBg", {
fg = cursorline_hl.bg,
bg = cursorline_hl.bg,
})
end
local autoread_group = vim.api.nvim_create_augroup("tracer_autoread", { clear = true }) local autoread_group = vim.api.nvim_create_augroup("tracer_autoread", { clear = true })
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave", "BufEnter" }, { vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave", "BufEnter" }, {

View File

@@ -44,6 +44,39 @@ require("packer").startup(function(use)
use("tpope/vim-sleuth") use("tpope/vim-sleuth")
-- Allow plugins to enable repeating of commands. -- Allow plugins to enable repeating of commands.
use("tpope/vim-repeat") use("tpope/vim-repeat")
-- One Dark theme.
use({
"jessarcher/onedark.nvim",
config = function()
vim.cmd.colorscheme("onedark")
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
if normalfloat_hl.bg then
vim.api.nvim_set_hl(0, "FloatBorder", {
fg = normalfloat_hl.bg,
bg = normalfloat_hl.bg,
})
end
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
if cursorline_hl.bg then
vim.api.nvim_set_hl(0, "CursorLineBg", {
fg = cursorline_hl.bg,
bg = cursorline_hl.bg,
})
end
vim.api.nvim_set_hl(0, "NvimTreeIndentMarker", { fg = "#30323E" })
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine", link = false })
vim.api.nvim_set_hl(0, "StatusLineNonText", {
fg = "#5C6370",
bg = statusline_hl.bg,
})
vim.api.nvim_set_hl(0, "IndentBlanklineChar", { fg = "#2F313C" })
end,
})
-- Add more languages. -- Add more languages.
use("sheerun/vim-polyglot") use("sheerun/vim-polyglot")
-- Navigate seamlessly between Vim windows and Tmux panes. -- Navigate seamlessly between Vim windows and Tmux panes.
@@ -169,6 +202,25 @@ require("packer").startup(function(use)
end, end,
}) })
-- A status line.
use({
"nvim-lualine/lualine.nvim",
requires = "nvim-tree/nvim-web-devicons",
config = function()
require("tracer.plugins.lualine")
end,
})
-- Display buffers as tabs.
use({
"akinsho/bufferline.nvim",
requires = "nvim-tree/nvim-web-devicons",
after = "onedark.nvim",
config = function()
require("bufferline").setup()
end,
})
-- File tree sidebar for project-style navigation. -- File tree sidebar for project-style navigation.
use({ use({
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",

View File

@@ -0,0 +1,76 @@
local separator = {
"|",
color = "StatusLineNonText",
}
local non_text_hl = vim.api.nvim_get_hl(0, { name = "NonText" })
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" })
vim.api.nvim_set_hl(0, "StatusLineNonText", {
fg = non_text_hl.fg,
bg = statusline_hl.bg,
})
local function lsp_clients()
local clients = vim.lsp.get_clients({ bufnr = 0 })
if #clients == 0 then
return ""
end
local names = {}
for _, client in ipairs(clients) do
names[#names + 1] = client.name
end
return "LSP: " .. table.concat(names, ", ")
end
require("lualine").setup({
options = {
section_separators = '',
component_separators = "",
globalstatus = true,
theme = {
normal = {
a = "StatusLine",
b = "StatusLine",
c = "StatusLine",
},
},
},
sections = {
lualine_a = {
"mode",
separator,
},
lualine_b = {
"branch",
"diff",
separator,
lsp_clients,
{ "diagnostics", sources = { "nvim_diagnostic" } },
separator,
},
lualine_c = {
"filename",
},
lualine_x = {
"filetype",
"encoding",
"fileformat",
},
lualine_y = {
separator,
function()
return (vim.bo.expandtab and "s" or "t") .. "" .. vim.bo.shiftwidth
end,
separator,
},
lualine_z = {
"location",
"progress",
},
},
})