diff --git a/en/404.html b/en/404.html index c83691b..ec080f2 100644 --- a/en/404.html +++ b/en/404.html @@ -83,7 +83,7 @@ diff --git a/en/alternatives.html b/en/alternatives.html index cb4f9cf..0df4f0e 100644 --- a/en/alternatives.html +++ b/en/alternatives.html @@ -82,7 +82,7 @@ diff --git a/en/awesome-integrations.html b/en/awesome-integrations.html index 81bf902..171dfe2 100644 --- a/en/awesome-integrations.html +++ b/en/awesome-integrations.html @@ -82,7 +82,7 @@ diff --git a/en/awesome-plugins.html b/en/awesome-plugins.html index abf7754..fb33b38 100644 --- a/en/awesome-plugins.html +++ b/en/awesome-plugins.html @@ -82,7 +82,7 @@ @@ -183,10 +183,8 @@ using xargs.

Theme

diff --git a/en/column-renderer.html b/en/column-renderer.html new file mode 100644 index 0000000..9539c38 --- /dev/null +++ b/en/column-renderer.html @@ -0,0 +1,379 @@ + + + + + + Column Renderer - xplr book + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+
+

Column Renderer

+

A column renderer is a Lua function that receives a special argument and +returns a string that will be displayed in each specific field of the +files table.

+

xplr by default provides the following column renderers:

+
    +
  • xplr.fn.builtin.fmt_general_table_row_cols_0
  • +
  • xplr.fn.builtin.fmt_general_table_row_cols_1
  • +
  • xplr.fn.builtin.fmt_general_table_row_cols_2
  • +
  • xplr.fn.builtin.fmt_general_table_row_cols_3
  • +
  • xplr.fn.builtin.fmt_general_table_row_cols_4
  • +
+

You can either overwrite these functions, or create new functions in +xplr.fn.custom and point to them.

+

Terminal colors are supported.

+

Table Renderer Argument

+

The special argument contains the following fields

+ +

parent

+

Type: string

+

The parent path of the node.

+

relative_path

+

Type: string

+

The path relative to the parent, i.e. the file/directory name with extension.

+

absolute_path

+

Type: string

+

The absolute path (without resolving symlinks) of the node.

+

extension

+

Type: string

+

The extension of the node.

+ +

Type: boolean

+

true if the node is a symlink.

+

is_broken

+

Type: boolean

+

true if the node is a broken symlink.

+

is_dir

+

Type: boolean

+

true if the node is a directory.

+

is_file

+

Type: boolean

+

true if the node is a file.

+

is_readonly

+

Type: boolean

+

true if the node is real-only.

+

mime_essence

+

Type: string

+

The mime type of the node. For e.g. text/csv, image/jpeg etc.

+

size

+

Type: integer

+

The size of the exact node. The size of a directory won't be calculated +recursively.

+

human_size

+

Type: string

+

Like size but in human readable format.

+

permissions

+

Type: Permission

+

The permissions applied to the node.

+

canonical

+

Type: nullable Resolved Node Metadata

+

If the node is a symlink, it will hold information about the symlink resolved +node. Else, it will hold information the actual node. It the symlink is broken, +it will be null.

+ +

Type: nullable Resolved Node Metadata

+

If the node is a symlink and is not broken, it will hold information about the +symlink resolved node. However, it will never hold information about the actual +node. It will instead be null.

+

index

+

Type: integer

+

Index (starting from 0) of the node.

+

relative_index

+

Type: integer

+

Relative index from the focused node (i.e. 0th node).

+

is_before_focus

+

Type: boolean

+

true if the node is before the focused node.

+

is_after_focus

+

Type: boolean

+

true if the node is after the focused node.

+

tree

+

Type: string

+

The tree component based on the node's index.

+

prefix

+

Type: string

+

The prefix applicable for the node.

+

suffix

+

Type: string

+

The suffix applicable for the node.

+

is_selected

+

Type: boolean

+

true if the node is selected.

+

is_focused

+

Type: boolean

+

true if the node is under focus.

+

total

+

Type: integer

+

The total number of the nodes.

+

meta

+

Type: mapping of string and string

+

The applicable meta object for the node.

+

Permission

+

Permission contains the following fields:

+
    +
  • user_read
  • +
  • user_write
  • +
  • user_execute
  • +
  • group_read
  • +
  • group_write
  • +
  • group_execute
  • +
  • other_read
  • +
  • other_write
  • +
  • other_execute
  • +
  • sticky
  • +
  • setgid
  • +
  • setuid
  • +
+

Each field holds a boolean value.

+

Resolved Node Metadata

+

It contains the following fields.

+ +

Example

+
xplr.fn.custom.fmt_simple_column = function(m)
+  return m.prefix .. m.relative_path .. m.suffix
+end
+
+xplr.config.general.table.header.cols = {
+  { format = "  path" }
+}
+
+xplr.config.general.table.row.cols = {
+  { format = "custom.fmt_simple_column" }
+}
+
+xplr.config.general.table.col_widths = {
+  { Percentage = 100 }
+}
+
+-- With this config, you should only see a single column displaying the
+-- relative paths.
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + diff --git a/en/community.html b/en/community.html index 999336c..1f46d5e 100644 --- a/en/community.html +++ b/en/community.html @@ -82,7 +82,7 @@ diff --git a/en/configuration.html b/en/configuration.html index b558253..b50a901 100644 --- a/en/configuration.html +++ b/en/configuration.html @@ -82,7 +82,7 @@ diff --git a/en/contribute.html b/en/contribute.html index 8a22551..cb1b262 100644 --- a/en/contribute.html +++ b/en/contribute.html @@ -82,7 +82,7 @@ diff --git a/en/default-key-bindings.html b/en/default-key-bindings.html index 75094c3..bbe2ce0 100644 --- a/en/default-key-bindings.html +++ b/en/default-key-bindings.html @@ -82,7 +82,7 @@ @@ -355,7 +355,7 @@ of modes and the key mappings for each mode.