1
0
Fork 0

update lua config

This commit is contained in:
Peter Domínguez 2025-06-01 12:04:00 -04:00
parent 768e4e1b9e
commit e474f94fb6
14 changed files with 417 additions and 66 deletions

View file

@ -90,3 +90,281 @@ require('lualine').setup {
inactive_winbar = {}, inactive_winbar = {},
extensions = {} extensions = {}
} }
-- mini.icons
require('mini.icons').setup()
-- plenary
local async = require "plenary.async"
-- yazi
require("yazi.commands").create_yazi_commands()
---@module "plenary"
local configModule = require("yazi.config")
local M = {}
M.version = "11.5.1" -- x-release-please-version
-- The last known state of yazi when it was closed
---@type YaziPreviousState
M.previous_state = {}
M.active_contexts = vim.ringbuf(2)
---@alias yazi.Arguments {reveal_path: string}
---@param config? YaziConfig | {}
---@param input_path? string
---@param args? yazi.Arguments
function M.yazi(config, input_path, args)
local utils = require("yazi.utils")
local YaziProcess = require("yazi.process.yazi_process")
local yazi_event_handling = require("yazi.event_handling.yazi_event_handling")
if utils.is_yazi_available() ~= true then
print(
"Please install yazi and make sure it is on your `vim.env.PATH`. Check the documentation for more information"
)
return
end
config =
vim.tbl_deep_extend("force", configModule.default(), M.config, config or {})
local Log = require("yazi.log")
Log.level = config.log_level
if utils.is_ya_available() ~= true then
print(
"Please install ya (the yazi command line utility) and make sure it is on your `vim.env.PATH`. Check the documentation for more information"
)
return
end
local paths = utils.selected_file_paths(input_path)
local path = paths[1]
local prev_win = vim.api.nvim_get_current_win()
config.chosen_file_path = config.chosen_file_path or vim.fn.tempname()
local win = require("yazi.window").YaziFloatingWindow.new(config)
win:open_and_display()
local yazi_buffer = win.content_buffer
local yazi_process, yazi_context = YaziProcess:start(config, paths, {
on_ya_first_event = function(api)
config.hooks.on_yazi_ready(yazi_buffer, config, api)
do
if not (args and args.reveal_path) then
Log:debug("No reveal_path provided, skipping initial reveal")
return
end
local retries = 15
require("yazi.process.retry").retry({
delay = 50,
retries = retries,
action = function(retries_remaining)
local reveal_job = api:reveal(args.reveal_path)
local completed = reveal_job:wait(500)
assert(
completed.code == 0,
string.format(
"Failed to reveal path '%s' with exit code: %s, details: %s",
args.reveal_path,
completed.code,
vim.inspect({
stdout = completed.stdout,
stderr = completed.stderr,
})
)
)
Log:debug(
string.format(
"Revealed path '%s' successfully after retries_remaining: %s",
args.reveal_path,
retries_remaining
)
)
return nil
end,
on_failure = function(_, retries_remaining)
Log:debug(
string.format(
"Failed to reveal path '%s', retrying after 50ms. retries_remaining: %s",
args.reveal_path,
retries_remaining
)
)
end,
on_final_failure = function(result)
Log:debug(
string.format(
"Failed to reveal path '%s' after %s retries. Details: %s",
args.reveal_path,
retries,
vim.inspect(result)
)
)
end,
})
end
end,
on_exit = function(
exit_code,
selected_files,
events,
hovered_url,
last_directory,
context
)
if exit_code ~= 0 then
print(
"yazi.nvim: had trouble opening yazi. Run ':checkhealth yazi' for more information."
)
Log:debug(
string.format("yazi.nvim: had trouble opening yazi: %s", exit_code)
)
return
end
Log:debug(
string.format(
"yazi process exited successfully with code: %s, selected_files %s, and events %s",
exit_code,
vim.inspect(selected_files),
vim.inspect(events)
)
)
-- this is the legacy implementation used when
-- `future_features.process_events_live = false`. When that is used,
-- events should be processed in ya_process.lua and should not be
-- processed a second time here.
assert(#events == 0 or not config.future_features.process_events_live)
yazi_event_handling.process_events_emitted_from_yazi(
events,
config,
context
)
if last_directory == nil then
if path:is_file() then
last_directory = path:parent()
else
last_directory = path
end
Log:debug(
string.format(
"No last_directory provided, presuming the last directory is %s based on the path %s",
last_directory,
path.filename
)
)
end
Log:debug(
string.format("Resolved the last_directory to %s", last_directory)
)
utils.on_yazi_exited(prev_win, win, config, selected_files, {
last_directory = last_directory,
})
if hovered_url then
-- currently we can't reliably get the hovered_url from ya due to
-- https://github.com/sxyazi/yazi/issues/1314 so let's try to at least
-- not corrupt the last working hovered state
M.previous_state.last_hovered = hovered_url
Log:debug(
string.format(
"Setting the last hovered state to %s",
vim.inspect(M.previous_state.last_hovered)
)
)
else
Log:debug(
"No hovered_url provided, presuming the last hovered file is the initial file"
)
M.previous_state.last_hovered = path.filename
end
end,
})
M.active_contexts:push(yazi_context)
config.hooks.yazi_opened(path.filename, win.content_buffer, config)
if config.set_keymappings_function ~= nil then
config.set_keymappings_function(yazi_buffer, config, yazi_context)
end
if config.keymaps ~= false then
require("yazi.config").set_keymappings(yazi_buffer, config, yazi_context)
end
win.on_resized = function(event)
vim.fn.jobresize(
yazi_process.yazi_job_id,
event.win_width,
event.win_height
)
end
vim.schedule(function()
vim.cmd("startinsert")
end)
end
-- Open yazi, continuing from the previously hovered file. If no previous file
-- was hovered, open yazi with the default path.
---@param config? YaziConfig | {}
function M.toggle(config)
local path = M.previous_state and M.previous_state.last_hovered or nil
local Log = require("yazi.log")
if path == nil then
Log:debug("No previous file hovered, opening yazi with default path")
else
Log:debug(
string.format("Opening yazi with previous file hovered: %s", path)
)
end
if path then
M.yazi(config, path, { reveal_path = path })
else
M.yazi(config, path)
end
end
M.config = configModule.default()
---@param opts YaziConfig | {}
function M.setup(opts)
M.config =
vim.tbl_deep_extend("force", configModule.default(), M.config, opts or {})
local Log = require("yazi.log")
Log.level = M.config.log_level
pcall(function()
require("yazi.lsp.embedded-lsp-file-operations.lsp-file-operations").setup()
end)
local yazi_augroup = vim.api.nvim_create_augroup("yazi", { clear = true })
if M.config.open_for_directories == true then
Log:debug("Hijacking netrw to open yazi for directories")
require("yazi.hijack_netrw").hijack_netrw(yazi_augroup)
end
if
M.config.integrations.picker_add_copy_relative_path_action
== "snacks.picker"
then
require("yazi.integrations.snacks_relative_path").setup_copy_relative_path_picker_action()
end
end
return M

View file

@ -2,7 +2,7 @@
# : Manager {{{ # : Manager {{{
[manager] [mgr]
cwd = { fg = "#8be9fd" } cwd = { fg = "#8be9fd" }
# Hovered # Hovered
@ -36,6 +36,15 @@ border_style = { fg = "#7282b5" }
# : }}} # : }}}
# : Tabs {{{
[tabs]
active = { fg = "#282a36", bg = "#bd93f9", bold = true }
inactive = { fg = "#bd93f9", bg = "#44475a" }
# : }}}
# : Mode {{{ # : Mode {{{
[mode] [mode]

View file

@ -1,108 +1,108 @@
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "c" ] on = [ "g", "c" ]
run = "cd /home/peter/.config" run = "cd /home/peter/.config"
desc = "Configs" desc = "Configs"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "!" on = "!"
run = 'shell "$SHELL" --block' run = 'shell "$SHELL" --block'
desc = "Open shell here" desc = "Open shell here"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "T" on = "T"
run = "plugin toggle-pane min-preview" run = "plugin toggle-pane min-preview"
desc = "Show or hide the preview pane" desc = "Show or hide the preview pane"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "d" ] on = [ "g", "d" ]
run = "cd /home/peter/Downloads" run = "cd /home/peter/Downloads"
desc = "Downloads" desc = "Downloads"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "b" ] on = [ "g", "b" ]
run = "cd /mnt/Backups" run = "cd /mnt/Backups"
desc = "Backups" desc = "Backups"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "v" ] on = [ "g", "v" ]
run = "cd /media/Games" run = "cd /media/Games"
desc = "Games" desc = "Games"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "s" ] on = [ "g", "s" ]
run = "cd /mnt/SSD" run = "cd /mnt/SSD"
desc = "SSD" desc = "SSD"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "n" ] on = [ "g", "n" ]
run = "cd /home/peter/Nextcloud" run = "cd /home/peter/Nextcloud"
desc = "Nextcloud" desc = "Nextcloud"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "r" ] on = [ "g", "r" ]
run = "cd /run/media" run = "cd /run/media"
desc = "Media" desc = "Media"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "a" ] on = [ "g", "a" ]
run = "cd /home/peter/Downloads/AUR" run = "cd /home/peter/Downloads/AUR"
desc = "AUR" desc = "AUR"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "!" ] on = [ "g", "!" ]
run = "cd ~/.bin/sh" run = "cd ~/.bin/sh"
desc = "Scripts" desc = "Scripts"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "t" ] on = [ "g", "t" ]
run = "cd ~/.local/share/Trash/files" run = "cd ~/.local/share/Trash/files"
desc = "Trash" desc = "Trash"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "y" ] on = [ "g", "y" ]
run = "cd ~/Sync" run = "cd ~/Sync"
desc = "Sync" desc = "Sync"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "c", "m" ] on = [ "c", "m" ]
run = "plugin chmod" run = "plugin chmod"
desc = "Chmod on selected files" desc = "Chmod on selected files"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = ["C"] on = ["C"]
run = "plugin ouch" run = "plugin ouch"
desc = "Compress with ouch" desc = "Compress with ouch"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "2" on = "2"
run = "plugin smart-switch 1" run = "plugin smart-switch 1"
desc = "Switch or create tab 2" desc = "Switch or create tab 2"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "3" on = "3"
run = "plugin smart-switch 2" run = "plugin smart-switch 2"
desc = "Switch or create tab 3" desc = "Switch or create tab 3"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "4" on = "4"
run = "plugin smart-switch 3" run = "plugin smart-switch 3"
desc = "Switch or create tab 4" desc = "Switch or create tab 4"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "5" on = "5"
run = "plugin smart-switch 4" run = "plugin smart-switch 4"
desc = "Switch or create tab 5" desc = "Switch or create tab 5"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "t" on = "t"
run = "plugin smart-tab" run = "plugin smart-tab"
desc = "Create a tab and enter the hovered directory" desc = "Create a tab and enter the hovered directory"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "g", "R" ] on = [ "g", "R" ]
run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"' run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"'
desc = "Repo root" desc = "Repo root"
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "q" on = "q"
run = "plugin confirm-quit" run = "plugin confirm-quit"

View file

@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/7aa3abc2-d057-498c-8473-a6282
## Installation ## Installation
```sh ```sh
ya pack -a yazi-rs/plugins:chmod ya pkg add yazi-rs/plugins:chmod
``` ```
## Usage ## Usage
@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:chmod
Add this to your `~/.config/yazi/keymap.toml`: Add this to your `~/.config/yazi/keymap.toml`:
```toml ```toml
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = [ "c", "m" ] on = [ "c", "m" ]
run = "plugin chmod" run = "plugin chmod"
desc = "Chmod on selected files" desc = "Chmod on selected files"

View file

@ -1,4 +1,4 @@
--- @since 25.2.26 --- @since 25.5.28
local selected_or_hovered = ya.sync(function() local selected_or_hovered = ya.sync(function()
local tab, paths = cx.active, {} local tab, paths = cx.active, {}
@ -13,7 +13,7 @@ end)
return { return {
entry = function() entry = function()
ya.mgr_emit("escape", { visual = true }) ya.emit("escape", { visual = true })
local urls = selected_or_hovered() local urls = selected_or_hovered()
if #urls == 0 then if #urls == 0 then
@ -28,7 +28,7 @@ return {
return return
end end
local status, err = Command("chmod"):arg(value):args(urls):spawn():wait() local status, err = Command("chmod"):arg(value):arg(urls):spawn():wait()
if not status or not status.success then if not status or not status.success then
ya.notify { ya.notify {
title = "Chmod", title = "Chmod",

View file

@ -7,7 +7,7 @@ Add a full border to Yazi to make it look fancier.
## Installation ## Installation
```sh ```sh
ya pack -a yazi-rs/plugins:full-border ya pkg add yazi-rs/plugins:full-border
``` ```
## Usage ## Usage

View file

@ -7,10 +7,10 @@ local function setup(_, opts)
Tab.build = function(self, ...) Tab.build = function(self, ...)
local bar = function(c, x, y) local bar = function(c, x, y)
if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "" then if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "" then
return ui.Bar(ui.Bar.TOP) return ui.Bar(ui.Edge.TOP)
end end
return ui.Bar(ui.Bar.TOP) return ui.Bar(ui.Edge.TOP)
:area( :area(
ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) } ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) }
) )
@ -26,9 +26,9 @@ local function setup(_, opts)
local style = th.mgr.border_style local style = th.mgr.border_style
self._base = ya.list_merge(self._base or {}, { self._base = ya.list_merge(self._base or {}, {
ui.Border(ui.Border.ALL):area(self._area):type(type):style(style), ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style),
ui.Bar(ui.Bar.RIGHT):area(self._chunks[1]):style(style), ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style),
ui.Bar(ui.Bar.LEFT):area(self._chunks[3]):style(style), ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style),
bar("", c[1].right - 1, c[1].y), bar("", c[1].right - 1, c[1].y),
bar("", c[1].right - 1, c[1].bottom - 1), bar("", c[1].right - 1, c[1].bottom - 1),

View file

@ -1,8 +1,5 @@
# git.yazi # git.yazi
> [!NOTE]
> Yazi v25.2.26 or later is required for this plugin to work.
Show the status of Git file changes as linemode in the file list. Show the status of Git file changes as linemode in the file list.
https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576 https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576
@ -10,7 +7,7 @@ https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576
## Installation ## Installation
```sh ```sh
ya pack -a yazi-rs/plugins:git ya pkg add yazi-rs/plugins:git
``` ```
## Setup ## Setup

View file

@ -1,4 +1,4 @@
--- @since 25.4.4 --- @since 25.5.28
local WINDOWS = ya.target_family() == "windows" local WINDOWS = ya.target_family() == "windows"
@ -190,8 +190,8 @@ local function fetch(_, job)
-- stylua: ignore -- stylua: ignore
local output, err = Command("git") local output, err = Command("git")
:cwd(tostring(cwd)) :cwd(tostring(cwd))
:args({ "--no-optional-locks", "-c", "core.quotePath=", "status", "--porcelain", "-unormal", "--no-renames", "--ignored=matching" }) :arg({ "--no-optional-locks", "-c", "core.quotePath=", "status", "--porcelain", "-unormal", "--no-renames", "--ignored=matching" })
:args(paths) :arg(paths)
:stdout(Command.PIPED) :stdout(Command.PIPED)
:output() :output()
if not output then if not output then

View file

@ -1,6 +1,6 @@
# toggle-pane.yazi # toggle-pane.yazi
Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#manager.ratio)! Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#mgr.ratio)!
Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$: Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$:
@ -15,7 +15,7 @@ Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{cu
## Installation ## Installation
```sh ```sh
ya pack -a yazi-rs/plugins:toggle-pane ya pkg add yazi-rs/plugins:toggle-pane
``` ```
## Usage ## Usage
@ -24,7 +24,7 @@ Hide/Show preview:
```toml ```toml
# keymap.toml # keymap.toml
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "T" on = "T"
run = "plugin toggle-pane min-preview" run = "plugin toggle-pane min-preview"
desc = "Show or hide the preview pane" desc = "Show or hide the preview pane"
@ -34,7 +34,7 @@ Maximize/Restore preview:
```toml ```toml
# keymap.toml # keymap.toml
[[manager.prepend_keymap]] [[mgr.prepend_keymap]]
on = "T" on = "T"
run = "plugin toggle-pane max-preview" run = "plugin toggle-pane max-preview"
desc = "Maximize or restore the preview pane" desc = "Maximize or restore the preview pane"

View file

@ -1,4 +1,4 @@
--- @since 25.2.26 --- @since 25.5.28
--- @sync entry --- @sync entry
local function entry(st, job) local function entry(st, job)
@ -39,13 +39,7 @@ local function entry(st, job)
Tab.layout, st.old = st.old, nil Tab.layout, st.old = st.old, nil
st.parent, st.current, st.preview = nil, nil, nil st.parent, st.current, st.preview = nil, nil, nil
end end
ya.emit("app:resize", {})
-- TODO: remove this in the future
if ya.emit then
ya.emit("app:resize", {})
else
ya.app_emit("resize", {})
end
end end
return { entry = entry } return { entry = entry }

View file

@ -227,16 +227,18 @@ return {
local callback = function() local callback = function()
local cwd = cx.active.current.cwd local cwd = cx.active.current.cwd
if this.cwd ~= cwd then ya.emit("plugin", {
this.cwd = cwd this._id,
ya.manager_emit("plugin", { ya.quote(tostring(cwd), true),
this._id, })
ya.quote(tostring(cwd), true),
})
end
end end
ps.sub("cd", callback) ps.sub("cd", callback)
ps.sub("rename", callback)
ps.sub("bulk", callback)
ps.sub("move", callback)
ps.sub("trash", callback)
ps.sub("delete", callback)
ps.sub("tab", callback) ps.sub("tab", callback)
if Yatline ~= nil then if Yatline ~= nil then
@ -244,6 +246,10 @@ return {
local status = this.output local status = this.output
local githead = {} local githead = {}
if not status then
return githead
end
local branch = config.show_branch and get_branch(status) or "" local branch = config.show_branch and get_branch(status) or ""
if branch ~= nil and branch ~= "" then if branch ~= nil and branch ~= "" then
table.insert(githead, { branch[2], theme.prefix_color }) table.insert(githead, { branch[2], theme.prefix_color })
@ -301,7 +307,7 @@ return {
entry = function(_, job) entry = function(_, job)
local args = job.args or job local args = job.args or job
local command = Command("git") local command = Command("git")
:args({ "status", "--ignore-submodules=dirty", "--branch", "--show-stash", "--ahead-behind" }) :arg({ "status", "--ignore-submodules=dirty", "--branch", "--show-stash", "--ahead-behind" })
:cwd(args[1]) :cwd(args[1])
:env("LANGUAGE", "en_US.UTF-8") :env("LANGUAGE", "en_US.UTF-8")
:stdout(Command.PIPED) :stdout(Command.PIPED)

View file

@ -424,12 +424,20 @@ function Yatline.string.get:hovered_mime()
end end
--- Gets the hovered file's user and group ownership of the current active tab. --- Gets the hovered file's user and group ownership of the current active tab.
--- Unix-like systems only.
--- @return string ownership Current active tab's hovered file's user and group ownership. --- @return string ownership Current active tab's hovered file's user and group ownership.
function Yatline.string.get:hovered_ownership() function Yatline.string.get:hovered_ownership()
local hovered = cx.active.current.hovered local hovered = cx.active.current.hovered
if hovered then if hovered then
return ya.user_name(hovered.cha.uid) .. ":" .. ya.group_name(hovered.cha.gid) if not hovered.cha.uid or not hovered.cha.gid then
return ""
end
local username = ya.user_name(hovered.cha.uid) or tostring(hovered.cha.uid)
local groupname = ya.group_name(hovered.cha.gid) or tostring(hovered.cha.gid)
return username .. ":" .. groupname
else else
return "" return ""
end end
@ -713,6 +721,7 @@ function Yatline.coloreds.create(coloreds, component_type)
end end
--- Gets the hovered file's permissions of the current active tab. --- Gets the hovered file's permissions of the current active tab.
--- Unix-like systems only.
--- @return Coloreds coloreds Current active tab's hovered file's permissions --- @return Coloreds coloreds Current active tab's hovered file's permissions
function Yatline.coloreds.get:permissions() function Yatline.coloreds.get:permissions()
local hovered = cx.active.current.hovered local hovered = cx.active.current.hovered
@ -990,8 +999,10 @@ local function config_side(side)
if component_group then if component_group then
if component.custom then if component.custom then
section_components[#section_components + 1] = if component.name ~= nil and component.name ~= "" and #component.name ~= 0 then
{ component_group.create(component.name, in_section), component_group.has_separator } section_components[#section_components + 1] =
{ component_group.create(component.name, in_section), component_group.has_separator }
end
else else
local getter = component_group.get[component.name] local getter = component_group.get[component.name]
@ -1075,9 +1086,65 @@ local function config_paragraph(area, line)
end end
return { return {
setup = function(_, config) setup = function(_, config, pre_theme)
config = config or {} config = config or {}
if config == 0 then
config = {
show_background = false,
header_line = {
left = {
section_a = {
{ type = "line", custom = false, name = "tabs", params = { "left" } },
},
section_b = {},
section_c = {},
},
right = {
section_a = {
{ type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } },
},
section_b = {
{ type = "string", custom = false, name = "date", params = { "%X" } },
},
section_c = {},
},
},
status_line = {
left = {
section_a = {
{ type = "string", custom = false, name = "tab_mode" },
},
section_b = {
{ type = "string", custom = false, name = "hovered_size" },
},
section_c = {
{ type = "string", custom = false, name = "hovered_path" },
{ type = "coloreds", custom = false, name = "count" },
},
},
right = {
section_a = {
{ type = "string", custom = false, name = "cursor_position" },
},
section_b = {
{ type = "string", custom = false, name = "cursor_percentage" },
},
section_c = {
{ type = "string", custom = false, name = "hovered_file_extension", params = { true } },
{ type = "coloreds", custom = false, name = "permissions" },
},
},
},
}
end
if pre_theme then
config.theme = pre_theme
end
tab_width = config.tab_width or 20 tab_width = config.tab_width or 20
local component_positions = config.component_positions or { "header", "tab", "status" } local component_positions = config.component_positions or { "header", "tab", "status" }

View file

@ -1,4 +1,4 @@
[manager] [mgr]
show_hidden = true show_hidden = true
linemode = "size_and_mtime" linemode = "size_and_mtime"