Context
cx
You can access all states within sync context through cx.
active
The active tab.
| Type | tab::Tab |
tabs
All of tabs.
| Type | mgr::Tabs |
tasks
All of tasks.
| Type | tasks::Tasks |
yanked
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 | Self |
| 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
Urls of the selected files.
__len(self)
Returns the number of selected Urls.
| In/Out | Type |
|---|---|
self | Self |
| Return | integer |
__pairs(self)
Iterate over the selected Urls.
| In/Out | Type |
|---|---|
self | Self |
| Return | fun(t: self, k: any): integer, Url |
tab::Preview
State of the preview pane.
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
A 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
Files in a tab::Folder.
__len(self)
Returns the number of files in this folder.
| In/Out | Type |
|---|---|
self | Self |
| Return | integer |
__index(self, idx)
Access each file by index.
| In/Out | Type |
|---|---|
self | Self |
idx | integer |
| Return | fs::File? |
fs::File
A file lives in the current context, which inherits from File but has many more context-specific properties and methods.
| Inherit | File | To access basic file attributes. |
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 | Self |
| 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 | Self |
| 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 | Self |
| Return | string? |
icon(self)
Icon of the file, or nil if no [icon] rules match.
| In/Out | Type |
|---|---|
self | Self |
| Return | Icon? |
style(self)
Style of the file, or nil if no [filetype] rules match.
| In/Out | Type |
|---|---|
self | Self |
| Return | Style? |
is_yanked(self)
Whether the file is yanked.
| In/Out | Type |
|---|---|
self | Self |
| Return | boolean |
is_selected(self)
Whether the file is selected.
| In/Out | Type |
|---|---|
self | Self |
| Return | boolean |
found(self)
File find status:
nilif if the user not infindmode.nilif current file is not related to the keyword entered by the user.integer, integerif current file is one of the files found, where first is its index among the results and second is the total count of files found.
| In/Out | Type |
|---|---|
self | Self |
| Return | integer?, integer? |
mgr::Tabs
All of tabs.
idx
Index of the active tab.
| Type | integer |
__len(self)
Returns the number of tabs.
| In/Out | Type |
|---|---|
self | Self |
| Return | integer |
__index(self, idx)
Access each tab by index.
| In/Out | Type |
|---|---|
self | Self |
idx | integer |
| Return | tab::Tab? |
tab::Tab
A 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
Yanked files.
is_cut
Whether in cut mode.
| Type | boolean |
__len(self)
Returns the number of yanked files.
| In/Out | Type |
|---|---|
self | Self |
| Return | integer |
__pairs(self)
Iterate over the url of yanked files.
| In/Out | Type |
|---|---|
self | Self |
| Return | fun(t: self, k: any): integer, Url |