ui/ux enhancements

master
blob42 11 months ago
parent 660dd0c37b
commit 1e22939ada

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

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

@ -25,7 +25,7 @@ opt.showmode = false
opt.title = true opt.title = true
opt.clipboard = "unnamed" opt.clipboard = "unnamed"
opt.cul = true -- cursor line opt.cul = false -- cursor line
-- opt.colorcolumn = "80" -- opt.colorcolumn = "80"
opt.colorcolumn = '+0' -- make colorcolumn follow text width opt.colorcolumn = '+0' -- make colorcolumn follow text width
opt.textwidth = 80 opt.textwidth = 80
@ -77,7 +77,7 @@ opt.foldlevelstart = 1
opt.conceallevel=1 -- how to show text with :syn-conceal syntax opt.conceallevel=1 -- how to show text with :syn-conceal syntax
opt.list = true -- show tabs,trailing spaces and non-breakable spaces 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.diffopt:append("vertical")
opt.completeopt = "menu,menuone,noselect" opt.completeopt = "menu,menuone,noselect"
opt.wrap = false opt.wrap = false

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

@ -37,6 +37,9 @@ M.override = {
St_LspInfo = { St_LspInfo = {
fg = "white" fg = "white"
}, },
St_LspStatus = {
fg = "sun"
},
LineNr = { LineNr = {
fg = "#5f4468" fg = "#5f4468"
}, },
@ -65,10 +68,11 @@ M.add = {
fg = "white", fg = "white",
italic = true, italic = true,
}, },
DiagnosticUnderlineError = { -- Definied in custom theme parameters (after/plugin/theme.lua)
fg = "black", -- DiagnosticUnderlineError = {
bg = "pink", -- fg = "red",
}, -- underline = true,
-- },
-- Code Lens related colors -- Code Lens related colors
LspCodeLens = { LspCodeLens = {
fg = "vibrant_green", 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." 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"] = { ["docu4"] = {
system_message_template = "You are a technical documentation assistant to a software developer. You will help improving project documentation.", language_instructions = {
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}}", 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" model = "gpt-4"
}, },
} }

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

@ -98,7 +98,11 @@ return {
hints = (hints and hints > 0) and ("%#St_lspHints#" .. myicons.lsp.diagnostic_hint .. " " .. hints .. " ") or "" 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 "" info = (info and info > 0) and ("%#St_lspInfo#" .. myicons.lsp.diagnostic_info .. " " .. info .. " ") or ""
if vim.o.columns > 120 then
return errors .. warnings .. hints .. info return errors .. warnings .. hints .. info
else
return ""
end
end, end,
LSP_progress = function() LSP_progress = function()
@ -134,7 +138,7 @@ return {
if rawget(vim, "lsp") then if rawget(vim, "lsp") then
for _, client in ipairs(vim.lsp.get_active_clients()) do for _, client in ipairs(vim.lsp.get_active_clients()) do
if client.attached_buffers[vim.api.nvim_get_current_buf()] then 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 end
end end
@ -164,6 +168,25 @@ return {
text = '%l,%c%V%\\ %p%%' text = '%l,%c%V%\\ %p%%'
return "%#St_pos_text#" .. " " .. text .. " " 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 end
} }

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

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

Loading…
Cancel
Save