App data
cx
You can access all app data through the cx
within the sync context:
active
The active tab.
Type | tab::Tab |
tabs
All of tabs.
Type | mgr::Tabs |
tasks
All of tasks.
Type | tasks::Tasks |
yanked
The yanked files.
Type | mgr::Yanked |
tab::Mode
Visual mode status.
is_select
Whether in select mode.
Type | boolean |
is_unset
Whether in unset mode.
Type | boolean |
is_visual
Whether in select mode, or unset mode.
Type | boolean |
__tostring(self)
Converts the mode to string.
In/Out | Type |
---|---|
self | tab::Mode |
Return | string |
tab::Pref
Tab-specific user preferences.
sort_by
File sorting method. See sort_by
for details.
Type | "none" | "mtime" | "btime" | "extension" | "alphabetical" | "natural" | "size" | "random" |
sort_sensitive
Sort case-sensitively. See sort_sensitive
for details.
Type | boolean |
sort_reverse
Display files in reverse order. See sort_reverse
for details.
Type | boolean |
sort_dir_first
Display directories first. See sort_dir_first
for details.
Type | boolean |
sort_translit
Transliterate filenames for sorting. See sort_translit
for details.
Type | boolean |
linemode
Line mode. See linemode
for details.
Type | string | "none" | "size" | "btime" | "mtime" | "permissions" | "owner" |
show_hidden
Show hidden files. See show_hidden
for details.
Type | boolean |
tab::Selected
__len(self)
Returns the number of selected Urls.
In/Out | Type |
---|---|
self | tab::Selected |
Return | integer |
__pairs(self)
Iterate over the selected Urls.
In/Out | Type |
---|---|
self | tab::Selected |
Return | fun(t: self, k: any): integer, Url |
tab::Preview
skip
Number of units to skip. The units largely depend on your previewer, such as lines for code and percentages for videos.
Type | integer |
folder
The folder being previewed, or nil
if this preview is not for a folder.
Type | tab::Folder? |
tab::Folder
cwd
Current working directory.
Type | Url |
offset
Offset of the folder.
Type | integer |
cursor
Cursor position.
Type | integer |
window
Files within the visible area.
Type | fs::Files |
files
All of the files in the folder.
Type | fs::Files |
hovered
Hovered file, or nil
if no file is hovered.
Type | fs::File? |
fs::Files
__len(self)
Returns the number of files in this folder.
In/Out | Type |
---|---|
self | fs::Files |
Return | integer |
__index(self, idx)
Access each file by index.
In/Out | Type |
---|---|
self | fs::Files |
idx | integer |
Return | fs::File? |
fs::File
Based on File, with the following additional properties and methods.
is_hovered
Whether the file is hovered.
Type | boolean |
size(self)
Size of the file in bytes, or nil
if it's a directory yet not been evaluated.
In/Out | Type |
---|---|
self | fs::File |
Return | integer? |
mime(self)
Mimetype of the file, or nil
if it's a directory or hasn't been lazily calculated.
In/Out | Type |
---|---|
self | fs::File |
Return | string? |
prefix(self)
Prefix of the file relative to CWD
, which used in the flat view during search.
For instance, if CWD
is /foo
, and the file is /foo/bar/baz
, then the prefix is bar/
.
In/Out | Type |
---|---|
self | fs::File |
Return | string? |
icon(self)
Icon of the file, or nil
if no [icon]
rules match.
In/Out | Type |
---|---|
self | fs::File |
Return | Icon? |
style(self)
Style of the file, or nil
if no [filetype]
rules match.
In/Out | Type |
---|---|
self | fs::File |
Return | Style? |
is_yanked(self)
Whether the file is yanked.
In/Out | Type |
---|---|
self | fs::File |
Return | boolean |
is_selected(self)
Whether the file is selected.
In/Out | Type |
---|---|
self | fs::File |
Return | boolean |
found(self)
File find status:
nil
if if the user not infind
mode.nil
if current file is not related to the keyword entered by the user.(idx, all)
if current file is one of the files found, whereidx
is its index among the results andall
is the total count of files found.
In/Out | Type |
---|---|
self | fs::File |
Return | (integer, integer)? |
mgr::Tabs
idx
Index of the active tab.
Type | integer |
__len(self)
Returns the number of tabs.
In/Out | Type |
---|---|
self | mgr::Tabs |
Return | integer |
__index(self, idx)
Access each tab by index.
In/Out | Type |
---|---|
self | mgr::Tabs |
idx | integer |
Return | tab::Tab? |
tab::Tab
name
Name of the tab.
Type | string |
mode
Mode of the tab.
Type | tab::Mode |
pref
Preference of the tab.
Type | tab::Pref |
current
Current working folder.
Type | tab::Folder |
parent
Parent folder of the CWD
, or nil
if no parent folder exists.
Type | tab::Folder? |
selected
Selected files within the tab.
Type | tab::Selected |
preview
Preview of the tab.
Type | tab::Preview |
tasks::Tasks
progress
Progress of all tasks:
{
-- Number of tasks
total = 0,
succ = 0,
fail = 0,
-- Workload of tasks
found = 0,
processed = 0,
}
Type | { total: integer, succ: integer, fail: integer, found: integer, processed: integer } |
mgr::Yanked
is_cut
Whether in cut mode.
Type | boolean |
__len(self)
Returns the number of yanked files.
In/Out | Type |
---|---|
self | mgr::Yanked |
Return | integer |
__pairs(self)
Iterate over the url of yanked files.
In/Out | Type |
---|---|
self | mgr::Yanked |
Return | fun(t: self, k: any): integer, Url |