10 aug 2026
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
require("colorizer").setup {
|
||||
user_default_options = {
|
||||
mode = "virtualtext",
|
||||
virtualtext = "●",
|
||||
css = true,
|
||||
tailwind = true,
|
||||
sass = { enable = true, parsers = { "css" } },
|
||||
virtualtext_inline = "before",
|
||||
AARRGGBB = true,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
local fn = vim.fn
|
||||
|
||||
local icons = require("assets.icons").icons
|
||||
|
||||
local get_active_lsp = function()
|
||||
local msg = ""
|
||||
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
|
||||
local clients = vim.lsp.get_clients { bufnr = 0 }
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
|
||||
for _, client in ipairs(clients) do
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end
|
||||
|
||||
local function spell()
|
||||
if vim.o.spell then
|
||||
return string.format "[SPELL]"
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
--- show indicator for Chinese IME
|
||||
local function ime_state()
|
||||
if vim.g.is_mac then
|
||||
local layout =
|
||||
fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
||||
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
||||
if res ~= -1 then
|
||||
return "[CN]"
|
||||
end
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
local diff = function()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local virtual_env = function()
|
||||
-- only show virtual env for Python
|
||||
if vim.bo.filetype ~= "python" then
|
||||
return ""
|
||||
end
|
||||
|
||||
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
|
||||
local venv_path = os.getenv "VIRTUAL_ENV"
|
||||
|
||||
if venv_path == nil then
|
||||
if conda_env == nil then
|
||||
return ""
|
||||
else
|
||||
return string.format(" %s (conda)", conda_env)
|
||||
end
|
||||
else
|
||||
local venv_name = vim.fn.fnamemodify(venv_path, ":t")
|
||||
return string.format(" %s (venv)", venv_name)
|
||||
end
|
||||
end
|
||||
|
||||
local lint_progress = function()
|
||||
local linters = require("lint").get_running()
|
||||
if #linters == 0 then
|
||||
return ""
|
||||
end
|
||||
return table.concat(linters, ", ")
|
||||
end
|
||||
|
||||
require("lualine").setup {
|
||||
laststatus = 0,
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "zshell",
|
||||
globalstatus = true,
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
"mode",
|
||||
},
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
"branch",
|
||||
fmt = function(name, _)
|
||||
-- truncate branch name in case the name is too long
|
||||
return string.sub(name, 1, 20)
|
||||
end,
|
||||
color = { gui = "italic,bold" },
|
||||
separator = { right = "" },
|
||||
},
|
||||
{
|
||||
virtual_env,
|
||||
color = { fg = "black", bg = "#F1CA81" },
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
symbols = {
|
||||
readonly = "[ ]",
|
||||
},
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = diff,
|
||||
},
|
||||
{
|
||||
"%S",
|
||||
color = { gui = "bold", fg = "cyan" },
|
||||
},
|
||||
{
|
||||
spell,
|
||||
color = { fg = "black", bg = "#a7c080" },
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
ime_state,
|
||||
color = { fg = "black", bg = "#f46868" },
|
||||
},
|
||||
{
|
||||
lint_progress,
|
||||
icon = " ",
|
||||
},
|
||||
{
|
||||
get_active_lsp,
|
||||
icon = " ",
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "encoding", fmt = string.upper },
|
||||
{
|
||||
"fileformat",
|
||||
symbols = {
|
||||
unix = "",
|
||||
dos = "",
|
||||
mac = "",
|
||||
},
|
||||
},
|
||||
"filetype",
|
||||
},
|
||||
lualine_z = {
|
||||
{
|
||||
"location",
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "quickfix", "fugitive", "nvim-tree" },
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
content = {
|
||||
active = nil,
|
||||
inactive = nil,
|
||||
},
|
||||
use_icons = true,
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
require("modicator").setup({
|
||||
show_warnings = true,
|
||||
highlights = {
|
||||
defaults = {
|
||||
bold = false,
|
||||
italic = false,
|
||||
},
|
||||
use_cursorline_background = true,
|
||||
},
|
||||
integration = {
|
||||
lualine = {
|
||||
enabled = true,
|
||||
mode_section = nil,
|
||||
highlight = 'bg',
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
require("gruvbox-baby").setup()
|
||||
@@ -0,0 +1,50 @@
|
||||
require("gruvbox").setup({
|
||||
variant = "hard",
|
||||
dark_variant = "medium",
|
||||
dim_inactive_windows = false,
|
||||
extend_background_behind_borders = false,
|
||||
|
||||
enable = {
|
||||
terminal = true,
|
||||
legacy_highlights = true,
|
||||
migrations = true,
|
||||
},
|
||||
|
||||
styles = {
|
||||
bold = true,
|
||||
italic = true,
|
||||
transparency = false,
|
||||
},
|
||||
|
||||
groups = {
|
||||
border = "gray",
|
||||
link = "purple_lite",
|
||||
panel = "bg_second",
|
||||
|
||||
error = "red_lite",
|
||||
hint = "aqua_lite",
|
||||
info = "blue_lite",
|
||||
ok = "green_lite",
|
||||
warn = "yellow_lite",
|
||||
note = "yellow_dark",
|
||||
todo = "aqua_dark",
|
||||
|
||||
git_add = "green_dark",
|
||||
git_change = "yellow_dark",
|
||||
git_delete = "red_dark",
|
||||
git_dirty = "orange_dark",
|
||||
git_ignore = "gray",
|
||||
git_merge = "purple_dark",
|
||||
git_rename = "blue_dark",
|
||||
git_stage = "purple_dark",
|
||||
git_text = "yellow_lite",
|
||||
git_untracked = "bg2",
|
||||
|
||||
h1 = "red_dark",
|
||||
h2 = "yellow_dark",
|
||||
h3 = "green_dark",
|
||||
h4 = "aqua_dark",
|
||||
h5 = "blue_dark",
|
||||
h6 = "purple_dark",
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
-- lua
|
||||
require('onedarkpro').setup({
|
||||
highlights = {
|
||||
Comment = { italic = true },
|
||||
Directory = { bold = false },
|
||||
ErrorMsg = { italic = true },
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user