the big restyling
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{config, ...}: {
|
{config, ...}: {
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableReload = false;
|
||||||
globalConfig = ''
|
globalConfig = ''
|
||||||
admin off
|
admin off
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
programs.nixvim.plugins.mini = {
|
programs.nixvim = {
|
||||||
|
plugins.mini = {
|
||||||
enable = true;
|
enable = true;
|
||||||
modules = {
|
modules = {
|
||||||
ai = {
|
ai = {
|
||||||
@@ -158,16 +159,193 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
move = {};
|
move = {};
|
||||||
notify = {};
|
notify = {
|
||||||
|
content.format.__raw = ''
|
||||||
|
function(notif)
|
||||||
|
local formatted = MiniNotify.default_format(notif)
|
||||||
|
return '\n ' .. formatted:gsub('\n', ' \n ') .. ' \n'
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
window.config = {
|
||||||
|
border = "none";
|
||||||
|
title = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
pairs = {};
|
pairs = {};
|
||||||
pick = {};
|
pick = {};
|
||||||
splitjoin = {};
|
splitjoin = {};
|
||||||
starter = {};
|
starter = {};
|
||||||
statusline = {};
|
statusline = {
|
||||||
|
content.active.__raw = ''
|
||||||
|
function()
|
||||||
|
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
||||||
|
local diff = MiniStatusline.section_diff({ trunc_width = 75 })
|
||||||
|
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
||||||
|
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
|
||||||
|
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
||||||
|
local search = MiniStatusline.section_searchcount({ trunc_width = 75 })
|
||||||
|
|
||||||
|
return _G.CschStatusline.active({
|
||||||
|
mode = mode,
|
||||||
|
mode_hl = mode_hl,
|
||||||
|
diff = diff,
|
||||||
|
diagnostics = diagnostics,
|
||||||
|
lsp = lsp,
|
||||||
|
filename = filename,
|
||||||
|
search = search,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
surround = {};
|
surround = {};
|
||||||
trailspace = {};
|
trailspace = {};
|
||||||
visits = {};
|
visits = {};
|
||||||
};
|
};
|
||||||
mockDevIcons = true;
|
mockDevIcons = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfigLua = ''
|
||||||
|
local mini_notify_group = vim.api.nvim_create_augroup('MiniNotifyDesign', { clear = true })
|
||||||
|
_G.CschStatusline = _G.CschStatusline or {}
|
||||||
|
|
||||||
|
local function to_hex(value)
|
||||||
|
return value and string.format('#%06x', value) or nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_hl(name)
|
||||||
|
return vim.api.nvim_get_hl(0, { name = name, link = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_fg(name, fallback)
|
||||||
|
return to_hex(get_hl(name).fg) or fallback
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_bg(name, fallback)
|
||||||
|
return to_hex(get_hl(name).bg) or fallback
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_statusline_highlights()
|
||||||
|
local block_bg = get_bg('CursorLine', get_bg('Visual', '#373b41'))
|
||||||
|
local block_fg = get_fg('StatusLine', get_fg('Normal', '#c5c8c6'))
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, 'CschStatuslineBlock', { fg = block_fg, bg = block_bg })
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_group(hl, strings)
|
||||||
|
local parts = vim.tbl_filter(function(x)
|
||||||
|
return type(x) == 'string' and x ~= ""
|
||||||
|
end, strings or {})
|
||||||
|
|
||||||
|
if #parts == 0 then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('%%#%s# %s ', hl, table.concat(parts, ' '))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_block(text, hl)
|
||||||
|
if text == nil or text == "" then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('%%#%s# %s ', hl, text)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_filesize()
|
||||||
|
local size = math.max(vim.fn.line2byte(vim.fn.line('$') + 1) - 1, 0)
|
||||||
|
|
||||||
|
if size < 1024 then
|
||||||
|
return string.format('%dB', size)
|
||||||
|
elseif size < 1048576 then
|
||||||
|
return string.format('%.2fKiB', size / 1024)
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('%.2fMiB', size / 1048576)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_filetype()
|
||||||
|
local filetype = vim.bo.filetype
|
||||||
|
|
||||||
|
if filetype == "" then
|
||||||
|
return vim.bo.buftype ~= "" and vim.bo.buftype or 'text'
|
||||||
|
end
|
||||||
|
|
||||||
|
local icon = ""
|
||||||
|
if _G.MiniIcons ~= nil then
|
||||||
|
icon = _G.MiniIcons.get('filetype', filetype) or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
return (icon ~= "" and (icon .. ' ') or "") .. filetype
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_fileinfo()
|
||||||
|
local label = statusline_filetype()
|
||||||
|
|
||||||
|
if MiniStatusline.is_truncated(120) or vim.bo.buftype ~= "" then
|
||||||
|
return label
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('%s · %s', label, statusline_filesize())
|
||||||
|
end
|
||||||
|
|
||||||
|
local function statusline_location()
|
||||||
|
local line = vim.fn.line('.')
|
||||||
|
local total_lines = vim.fn.line('$')
|
||||||
|
local column = vim.fn.virtcol('.')
|
||||||
|
|
||||||
|
if MiniStatusline.is_truncated(90) then
|
||||||
|
return string.format('Ln %d Col %d', line, column)
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format('Ln %d/%d · Col %d', line, total_lines, column)
|
||||||
|
end
|
||||||
|
|
||||||
|
function _G.CschStatusline.active(parts)
|
||||||
|
local left = vim.tbl_filter(function(x)
|
||||||
|
return x ~= ""
|
||||||
|
end, {
|
||||||
|
statusline_block(parts.mode, parts.mode_hl),
|
||||||
|
statusline_group('MiniStatuslineDevinfo', { parts.diff, parts.diagnostics, parts.lsp }),
|
||||||
|
'%<',
|
||||||
|
statusline_group('MiniStatuslineFilename', { parts.filename }),
|
||||||
|
})
|
||||||
|
local right = vim.tbl_filter(function(x)
|
||||||
|
return x ~= ""
|
||||||
|
end, {
|
||||||
|
statusline_block(statusline_fileinfo(), 'CschStatuslineBlock'),
|
||||||
|
statusline_block(parts.search, 'CschStatuslineBlock'),
|
||||||
|
statusline_block(statusline_location(), parts.mode_hl),
|
||||||
|
})
|
||||||
|
|
||||||
|
return table.concat(left, "") .. '%=%#StatusLine#' .. table.concat(right, "")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_mini_notify_highlights()
|
||||||
|
local border = vim.api.nvim_get_hl(0, { name = 'FloatBorder' })
|
||||||
|
local normal = vim.api.nvim_get_hl(0, { name = 'NormalFloat' })
|
||||||
|
local popup_bg = get_bg('Pmenu', get_bg('CursorLine', get_bg('NormalFloat', '#303446')))
|
||||||
|
local title = vim.api.nvim_get_hl(0, { name = 'FloatTitle' })
|
||||||
|
|
||||||
|
border.bg = 'NONE'
|
||||||
|
normal.bg = popup_bg
|
||||||
|
normal.bold = true
|
||||||
|
title.bg = 'NONE'
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, 'MiniNotifyBorder', border)
|
||||||
|
vim.api.nvim_set_hl(0, 'MiniNotifyNormal', normal)
|
||||||
|
vim.api.nvim_set_hl(0, 'MiniNotifyTitle', title)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||||
|
group = mini_notify_group,
|
||||||
|
callback = function()
|
||||||
|
set_mini_notify_highlights()
|
||||||
|
set_statusline_highlights()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
set_mini_notify_highlights()
|
||||||
|
set_statusline_highlights()
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
address = "christoph@schmatzler.com";
|
address = "christoph@schmatzler.com";
|
||||||
userName = "christoph.schmatzler@icloud.com";
|
userName = "christoph.schmatzler@icloud.com";
|
||||||
realName = "Christoph Schmatzler";
|
realName = "Christoph Schmatzler";
|
||||||
passwordCommand = ["cat" "/run/secrets/tahani-email-password"];
|
passwordCommand = ["${pkgs.coreutils}/bin/cat" "/run/secrets/tahani-email-password"];
|
||||||
folders = {
|
folders = {
|
||||||
inbox = "INBOX";
|
inbox = "INBOX";
|
||||||
drafts = "Drafts";
|
drafts = "Drafts";
|
||||||
|
|||||||
Reference in New Issue
Block a user