From a5cb394d0a1799b58c95dda49496d22ae5b52970 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 2 Nov 2022 08:55:32 +0100 Subject: [PATCH] nvim changes --- .config/nvim/lua/config/iconlist.lua | 3 +- .../nvim/lua/plugins/config/bufferline.lua | 62 +++++++++++++++---- .config/nvim/lua/plugins/config/lualine.lua | 8 +-- .config/shell/profile | 2 +- 4 files changed, 58 insertions(+), 17 deletions(-) diff --git a/.config/nvim/lua/config/iconlist.lua b/.config/nvim/lua/config/iconlist.lua index 9960ac9e..03298a23 100644 --- a/.config/nvim/lua/config/iconlist.lua +++ b/.config/nvim/lua/config/iconlist.lua @@ -86,7 +86,8 @@ return { Dashboard = "", DividerLeft = "", DividerRight = "", - DoubleChevronRight = "»", + DoubleChevronRight = "", + DoubleChevronLeft = "", Ellipsis = "…", EmptyFolder = "", EmptyFolderOpen = "", diff --git a/.config/nvim/lua/plugins/config/bufferline.lua b/.config/nvim/lua/plugins/config/bufferline.lua index 9a95ab3b..d12087c3 100644 --- a/.config/nvim/lua/plugins/config/bufferline.lua +++ b/.config/nvim/lua/plugins/config/bufferline.lua @@ -1,23 +1,60 @@ +local colors = require('tokyonight.colors').setup({ transform = true }) + local status_ok, bufferline = pcall(require, "bufferline") if not status_ok then return end +local icons = require 'config.iconlist' + local function is_ft(b, ft) return vim.bo[b].filetype == ft end -local icons = require 'config.iconlist' +local function diagnostics_indicator(_, _, diagnostics, _) + local result = {} + local symbols = { + error = icons.diagnostics.Error, + warning = icons.diagnostics.Warning, + info = icons.diagnostics.Information, + } + for name, count in pairs(diagnostics) do + if symbols[name] and count > 0 then + table.insert(result, symbols[name] .. " " .. count) + end + end + result = table.concat(result, " ") + return #result > 0 and result or "" +end + +local function custom_filter(buf, buf_nums) + local logs = vim.tbl_filter(function(b) + return is_ft(b, "log") + end, buf_nums) + if vim.tbl_isempty(logs) then + return true + end + local tab_num = vim.fn.tabpagenr() + local last_tab = vim.fn.tabpagenr "$" + local is_log = is_ft(buf, "log") + if last_tab == 1 then + return true + end + -- only show log buffers in secondary tabs + return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log) +end local config = { - -- highlights = { - -- background = { - -- italic = true, - -- }, - -- buffer_selected = { - -- bold = true, - -- }, - -- }, + highlights = { + background = { + italic = true, + bold = false, + }, + buffer_selected = { + italic = false, + bold = true, + }, + }, options = { mode = "buffers", -- set to "tabs" to only show tabpages instead numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function @@ -26,7 +63,7 @@ local config = { left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" indicator = { - icon = icons.ui.BoldLineLeft, -- this should be omitted if indicator style is not 'icon' + icon = icons.ui.DoubleChevronRight, -- this should be omitted if indicator style is not 'icon' style = "icon", -- can also be 'underline'|'none', }, buffer_close_icon = icons.ui.Close, @@ -50,6 +87,9 @@ local config = { tab_size = 18, diagnostics = "nvim_lsp", diagnostics_update_in_insert = false, + diagnostics_indicator = diagnostics_indicator, + -- NOTE: this will be called a lot so don't do any heavy processing here + custom_filter = custom_filter, offsets = { { filetype = "undotree", @@ -89,7 +129,7 @@ local config = { persist_buffer_sort = true, -- whether or not custom sorted buffers should persist -- can also be a table containing 2 custom separators -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "thin", + separator_style = { '', '' }, enforce_regular_tabs = false, always_show_bufferline = false, hover = { diff --git a/.config/nvim/lua/plugins/config/lualine.lua b/.config/nvim/lua/plugins/config/lualine.lua index 1680231d..7c8c712f 100644 --- a/.config/nvim/lua/plugins/config/lualine.lua +++ b/.config/nvim/lua/plugins/config/lualine.lua @@ -24,10 +24,10 @@ local config = { options = { component_separators = '', section_separators = '', - theme = { - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, + -- theme = { + -- normal = { c = { fg = colors.fg, bg = colors.bg } }, + -- inactive = { c = { fg = colors.fg, bg = colors.bg } }, + -- }, disabled_filetypes = { statusline = { 'alpha' } }, diff --git a/.config/shell/profile b/.config/shell/profile index 9e9ae4f1..27d0b854 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -63,7 +63,7 @@ export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible export VIRTUAL_ENV_DISABLE_PROMPT=1 -export VAULT_ADDR='https://vault.tralios.de:8200' +export VAULT_ADDR='https://vault.tralios.de' # This is the list for lf icons: