-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): unified #718
feat(ui): unified #718
Conversation
Acceptable, need to be merged before 3.0.0 released. |
Cmp document highlights and cmp menu format updated. |
Seems 3.0 didn't include this pr😢 Any new plans? |
forgot to call for @Jint-lzxy ... But after all it is a draft and need more time to discuss, modify and get merged finally. |
i knw, i just don't like that lol |
Sorry for the delay, I'm also working on this 🤦♂️ Several thoughts:
local function is_new_file()
local filename = vim.fn.expand("%")
return filename ~= "" and vim.bo.buftype == "" and vim.fn.filereadable(filename) == 0
end
local edit_status = {
function()
if vim.bo.modified then
return icons.lualine.Modified
elseif not vim.bo.modifiable or vim.bo.readonly then
return icons.lualine.ReadOnly
elseif is_new_file() then
return icons.lualine.NewFile
else
return icons.lualine.Normal
end
end,
color = function()
return {
fg = vim.bo.modified and colors.green
or ((not vim.bo.modifiable or vim.bo.readonly) and colors.red or colors.lavender),
bg = colors.surface0,
}
end,
padding = { left = 1.2, right = 1.3 },
} |
@CharlesChiuGit Great idea, but now |
So should we keep |
@ayamir I've removed that: #718 (comment). But as a smaller matter, shall we enable Side effect: It will repeat with bufferline. |
I prefer to |
Ys, if the commit is super long then is well be overcrowded.
Root for taking
Personally I think it's fine to disable |
* I'm only free at Chinese weekends, the following 5 days I can't do anything... |
It's okay lol. We all are, well, in a certain level. |
I like the gray-out effect on the git diffs and the smaller gaps between diagnostics. Other parts I like @Jint-lzxy 's version more. Not being offensive, just from a pure personal aesthetic perspective. |
Also loving the reimplementation of |
I'd like @Jint-lzxy left part and @huge-pancake right part combined personally. |
Merge from origin
I'm back! Should we merge it soon or we wait for the new lualine config completely done? My current lualine config return function()
local icons = {
diagnostics = require("modules.utils.icons").get("diagnostics", true),
misc = require("modules.utils.icons").get("misc", true),
git = require("modules.utils.icons").get("git", true),
ui = require("modules.utils.icons").get("ui", true),
}
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
local function lsp_status()
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()] and client.name ~= "null-ls" then
return (vim.o.columns > 100 and "%#St_LspStatus#" .. " LSP [" .. client.name .. "]") or " LSP"
end
end
end
end
local function get_cwd()
local cwd = vim.fn.getcwd()
local is_windows = require("core.global").is_windows
if not is_windows then
local home = require("core.global").home
if cwd:find(home, 1, true) == 1 then
cwd = "~" .. cwd:sub(#home + 1)
end
end
return icons.ui.RootFolderOpened .. cwd
end
local mini_sections = {
lualine_a = { "filetype" },
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
}
local outline = {
sections = mini_sections,
filetypes = { "lspsagaoutline" },
}
local diffview = {
sections = mini_sections,
filetypes = { "DiffviewFiles" },
}
local function python_venv()
local function env_cleanup(venv)
if string.find(venv, "/") then
local final_venv = venv
for w in venv:gmatch("([^/]+)") do
final_venv = w
end
venv = final_venv
end
return venv
end
if vim.bo.filetype == "python" then
local venv = os.getenv("CONDA_DEFAULT_ENV")
if venv then
return string.format("%s", env_cleanup(venv))
end
venv = os.getenv("VIRTUAL_ENV")
if venv then
return string.format("%s", env_cleanup(venv))
end
end
return ""
end
local colors = require("modules.utils").get_palette()
local custom_catppuccin = require("lualine.themes.catppuccin")
custom_catppuccin.normal.c.fg = colors.overlay0
require("lualine").setup({
options = {
icons_enabled = true,
theme = custom_catppuccin,
disabled_filetypes = {},
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
{
"mode",
fmt = function(name)
return icons.misc.Vim .. name
end,
},
},
lualine_b = {
{ "filetype", colored = false, icon_only = true, padding = { left = 1 } },
{ "filename" },
},
lualine_c = {
{ "branch", icon = string.sub(icons.git.Branch, 1, 4), padding = { left = 1 } },
{
"diff",
colored = false,
symbols = {
added = icons.git.Add,
modified = icons.git.Mod,
removed = icons.git.Remove,
},
source = diff_source,
},
-- This can make things after this in section c centered
-- function()
-- return "%="
-- end,
},
lualine_x = {
{
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn", "info", "hint" },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warning,
info = icons.diagnostics.Information,
hint = icons.diagnostics.Hint,
},
},
lsp_status,
},
lualine_y = {
get_cwd,
python_venv,
},
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {
"quickfix",
"nvim-tree",
"nvim-dap-ui",
"toggleterm",
"fugitive",
outline,
diffview,
},
})
end |
Also IMO the similar things should be in one place, for example, filename, filetype (icon) and file format should be in same place but not place the filename on the left and others on the right. @Jint-lzxy |
i prefer merge when things r settled |
seems like a gd idea |
Agreed. (#718 (comment))
We need to wait until the upstream PR catppuccin/nvim#481 gets merged. It will introduce many changes. |
Can't wait to merge it |
IMHO we can first merge the commits that won't change their states due to upstream changes (such as |
Sure |
The other customization will be divided in some other prs, unsure new styles will be discussed at #698. |
cmp
andwilder
.bufferline
working withnvim-tree
andoutline (lspsaga)
.indent-blankline
.nvim-tree
,indent-blankline
andoutline (lspsaga)
.Telescope
.ts-context
, and its mode changed totopline
.alpha
changed to the default.Showcase
Telescope
Bufferline and treesitter-context
cmp and wilder