dotfiles from arch

This commit is contained in:
2025-09-28 11:39:12 +02:00
parent 75885729cd
commit d1c6923bbb
1358 changed files with 575835 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
# NuiTable
NuiTable can render table-like structured content on the buffer.
**Examples**
```lua
local NuiTable = require("nui.table")
local tbl = NuiTable({
bufnr = bufnr,
columns = {
{
align = "center",
header = "Name",
columns = {
{ accessor_key = "firstName", header = "First" },
{
id = "lastName",
accessor_fn = function(row)
return row.lastName
end,
header = "Last",
},
},
},
{
align = "right",
accessor_key = "age",
cell = function(cell)
return Text(tostring(cell.get_value()), "DiagnosticInfo")
end,
header = "Age",
},
},
data = {
{ firstName = "John", lastName = "Doe", age = 42 },
{ firstName = "Jane", lastName = "Doe", age = 27 },
},
})
tbl:render()
```
## Options
### `bufnr`
**Type:** `number`
Id of the buffer where the table will be rendered.
---
### `ns_id`
**Type:** `number` or `string`
Namespace id (`number`) or name (`string`).
---
### `columns`
**Type:** `NuiTable.ColumnDef[]`
List of `NuiTable.ColumnDef` objects.
---
### `data`
**Type:** `any[]`
List of data items.
## Methods
### `tbl:get_cell`
_Signature:_ `tbl:get_cell(position?: {integer, integer}) -> NuiTable.Cell | nil`
**Parameters**
| Name | Type | Description |
| ---------- | ---------------------- | ------------------------------------- |
| `position` | `{ integer, integer }` | `(row, col)` tuple relative to cursor |
Returns the `NuiTable.Cell` if found.
### `tbl:refresh_cell`
_Signature:_ `tbl:refresh_cell(cell: NuiTable.Cell) -> nil`
Refreshes the `cell` on buffer.
**Parameters**
| Name | Type | Description |
| ------ | --------------- | ----------- |
| `cell` | `NuiTable.Cell` | cell |
### `tbl:render`
_Signature:_ `tbl:render(linenr_start?: integer) -> nil`
Renders the table on buffer.
| Name | Type | Description |
| -------------- | ----------------- | ----------------------------- |
| `linenr_start` | `integer` / `nil` | start line number (1-indexed) |
## Wiki Page
You can find additional documentation/examples/guides/tips-n-tricks in [nui.table wiki page](https://github.com/MunifTanjim/nui.nvim/wiki/nui.table).
<!-- vim: set ft=markdown: -->