ui/ux enhancements

master
blob42 9 months ago
parent 660dd0c37b
commit 1e22939ada

@ -20,7 +20,12 @@ local highlights = {
St_file_sep_rev = {
fg = colors.statusline_bg,
bg = colors.lightbg,
}
},
DiagnosticUnderlineError = {
fg = c.change_hex_lightness(colors["red"], 5),
underline = true,
},
}
function set_hl()

@ -172,6 +172,15 @@ M.general = { --{{{
},
["<leader>tT"] = {
function()
require("base46").toggle_transparency()
end,
"toggle transparency",
},
-- luasnip edit snippets
["<leader>sne"] = {

@ -25,7 +25,7 @@ opt.showmode = false
opt.title = true
opt.clipboard = "unnamed"
opt.cul = true -- cursor line
opt.cul = false -- cursor line
-- opt.colorcolumn = "80"
opt.colorcolumn = '+0' -- make colorcolumn follow text width
opt.textwidth = 80
@ -77,7 +77,7 @@ opt.foldlevelstart = 1
opt.conceallevel=1 -- how to show text with :syn-conceal syntax
opt.list = true -- show tabs,trailing spaces and non-breakable spaces
opt.listchars = "tab: ,trail:,extends:#,nbsp:⋅,eol:" -- Highlight problematic whitespace
opt.listchars = "tab: ,trail:,extends:#,nbsp:⋅,eol:" -- Highlight problematic whitespace
opt.diffopt:append("vertical")
opt.completeopt = "menu,menuone,noselect"
opt.wrap = false

@ -18,9 +18,9 @@ local highlights = require "custom.highlights"
M.ui = {
-- theme = "gruvbox_material",
-- theme = "ayu-dark",
theme = "catppuccin",
theme_toggle = { "gruvbox_material", "gruvbox_light" },
transparency = true,
theme = "chadracula",
theme_toggle = { "catppuccin", "chadracula"},
-- transparency = true,
hl_override = highlights.override,
hl_add = highlights.add,
-- hl_override = {
@ -31,7 +31,7 @@ M.ui = {
myicons = {
lsp = {
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4

@ -37,6 +37,9 @@ M.override = {
St_LspInfo = {
fg = "white"
},
St_LspStatus = {
fg = "sun"
},
LineNr = {
fg = "#5f4468"
},
@ -65,10 +68,11 @@ M.add = {
fg = "white",
italic = true,
},
DiagnosticUnderlineError = {
fg = "black",
bg = "pink",
},
-- Definied in custom theme parameters (after/plugin/theme.lua)
-- DiagnosticUnderlineError = {
-- fg = "red",
-- underline = true,
-- },
-- Code Lens related colors
LspCodeLens = {
fg = "vibrant_green",

@ -19,8 +19,11 @@ M.setup = function()
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\n{{command_args}}. {{language_instructions}} Think step by step then only return the code snippet and nothing else."
},
["docu4"] = {
system_message_template = "You are a technical documentation assistant to a software developer. You will help improving project documentation.",
user_message_template = "Improve the following text: ```{{text_selection}}```\n. Use a professional. Write as if you are writing a python project documentation for a Github repo. {{command_args}}",
language_instructions = {
python = "Use docstings to document the code. This project uses Sphinx. Use the google style python docstrings. Add sphinx directives if needed."
},
system_message_template = "You are a technical documentation assistant to a software developer. Help the user write clean detailed and easy to read project documentation.",
user_message_template = "Create or improve the documentation for: ```{{text_selection}}```\n. Use a professional tone. {{language_instructions}} {{command_args}}",
model = "gpt-4"
},
}

@ -108,7 +108,7 @@ local config = {
-- Diagnostics
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4

@ -98,7 +98,11 @@ return {
hints = (hints and hints > 0) and ("%#St_lspHints#" .. myicons.lsp.diagnostic_hint .. " " .. hints .. " ") or ""
info = (info and info > 0) and ("%#St_lspInfo#" .. myicons.lsp.diagnostic_info .. " " .. info .. " ") or ""
return errors .. warnings .. hints .. info
if vim.o.columns > 120 then
return errors .. warnings .. hints .. info
else
return ""
end
end,
LSP_progress = function()
@ -134,7 +138,7 @@ return {
if rawget(vim, "lsp") then
for _, client in ipairs(vim.lsp.get_active_clients()) do
if client.attached_buffers[vim.api.nvim_get_current_buf()] then
lsp_status = (vim.o.columns > 100 and "%#St_LspStatus#" .. "[" .. client.name .. "] ") or " "
lsp_status = (vim.o.columns > 100 and "%#St_LspStatus#" .. "[" .. client.name .. "]") or "%#St_LspStatus#" .. " "
end
end
end
@ -164,6 +168,25 @@ return {
text = '%l,%c%V%\\ %p%%'
return "%#St_pos_text#" .. " " .. text .. " "
end,
git = function()
if not vim.b.gitsigns_head or vim.b.gitsigns_git_status then
return ""
end
local git_status = vim.b.gitsigns_status_dict
local added = (git_status.added and git_status.added ~= 0) and ("" .. git_status.added) or ""
local changed = (git_status.changed and git_status.changed ~= 0) and ("" .. git_status.changed) or ""
local removed = (git_status.removed and git_status.removed ~= 0) and ("" .. git_status.removed) or ""
local branch_name = "" .. git_status.head .. " "
if vim.o.columns > 120 then
return "%#St_gitIcons#" .. branch_name .. added .. changed .. removed
else
return ""
end
end
}

@ -56,6 +56,8 @@ local config = {
S = {
rhs = function()
daputils.disconnect_dap()
M.layer:exit()
vim.cmd("redrawstatus")
end,
desc = '[dap] stop'
},

@ -100,7 +100,6 @@ end
---@param full? boolean maximum zen
M.zenmode = function(full)
opt.colorcolumn= '0'
opt.signcolumn = 'no'
g.indent_blankline_show_current_context = false
local ok, indent = pcall(require, "indent_blankline")
if ok then
@ -108,12 +107,15 @@ M.zenmode = function(full)
end
opt.listchars:remove("eol")
opt.listchars:append("tab: ")
vim.cmd("TSDisable highlight")
if full then
opt.signcolumn = 'no'
opt.number = false
opt.relativenumber = false
-- opt.listchars:append("tab: ")
-- opt.listchars:remove("eol")
opt.fillchars:append("eob: ")
opt.cmdheight = 0
end
g.zenmode = true
end
@ -127,12 +129,14 @@ M.exitzen = function()
if ok then
indent.refresh()
end
opt.listchars:append("eol:")
opt.listchars:append("eol:")
opt.listchars:append("tab: ")
opt.number = true
opt.relativenumber = true
opt.fillchars:append("eob:")
opt.cmdheight = 1
g.zenmode = false
vim.cmd("TSEnable highlight")
end
return M

Loading…
Cancel
Save