Compare commits
4 Commits
f747d46176
...
403304b60d
Author | SHA1 | Date |
---|---|---|
David JULIEN | 403304b60d | |
David JULIEN | 31862695f8 | |
David JULIEN | 14c84e7728 | |
David JULIEN | 85b4b08824 |
|
@ -40,5 +40,10 @@ return {
|
||||||
require("mini.indentscope").setup(opts)
|
require("mini.indentscope").setup(opts)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"echasnovski/mini.surround",
|
||||||
|
version = '*',
|
||||||
|
config = function() require("mini.surround").setup() end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,13 @@ local function shorten_path(path, max_len)
|
||||||
end
|
end
|
||||||
|
|
||||||
local segments = vim.split(path, sep)
|
local segments = vim.split(path, sep)
|
||||||
for idx = 1, #segments - 1 do
|
local start = 1
|
||||||
|
if segments[1] == "~" then
|
||||||
|
start = start + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
for idx = start, #segments - 1 do
|
||||||
if len <= max_len then
|
if len <= max_len then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -122,6 +128,13 @@ local function shorten_path(path, max_len)
|
||||||
len = len - (#segment - #shortened)
|
len = len - (#segment - #shortened)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (len > max_len and #segments > 3) then
|
||||||
|
while (len > max_len and #segments > 3) do
|
||||||
|
table.remove(segments, 2)
|
||||||
|
end
|
||||||
|
table.insert(segments,2, "...")
|
||||||
|
end
|
||||||
|
|
||||||
return table.concat(segments, sep)
|
return table.concat(segments, sep)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -174,7 +187,7 @@ local function statusline_focused()
|
||||||
|
|
||||||
local left = table.concat {
|
local left = table.concat {
|
||||||
gen_section(accent_color, { get_mode_display_name(mg) }),
|
gen_section(accent_color, { get_mode_display_name(mg) }),
|
||||||
gen_section("%#Middle#", { shorten_path(file, winwidth / 3) }),
|
gen_section("%#Middle#", { shorten_path(file, winwidth / 2) }),
|
||||||
gen_section("%#Bottom#", { "%m", "%r" }),
|
gen_section("%#Bottom#", { "%m", "%r" }),
|
||||||
gen_section(
|
gen_section(
|
||||||
"%#Alert#",
|
"%#Alert#",
|
||||||
|
@ -223,7 +236,7 @@ local function statusline_not_focused()
|
||||||
local winwidth = vim.fn.winwidth(0)
|
local winwidth = vim.fn.winwidth(0)
|
||||||
return table.concat {
|
return table.concat {
|
||||||
gen_section("%#StatuslineNF#", {
|
gen_section("%#StatuslineNF#", {
|
||||||
shorten_path(file, winwidth / 3),
|
shorten_path(file, winwidth / 2),
|
||||||
"%m"
|
"%m"
|
||||||
}),
|
}),
|
||||||
"%=",
|
"%=",
|
||||||
|
|
Reference in New Issue