Skip to content

Commit 9ebb198

Browse files
committed
docs: update README
1 parent 7d80233 commit 9ebb198

File tree

1 file changed

+51
-95
lines changed

1 file changed

+51
-95
lines changed

README.md

Lines changed: 51 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A comfortable CSV/TSV editing plugin for Neovim.
1414
- **Text Objects & Motions**: Conveniently select fields or move across fields/rows.
1515
- **Comment Ignoring**: Skips specified comment lines from the table display.
1616
- **Sticky Header**: Keeps the header row visible while scrolling.
17+
- **Auto-Detection**: Automatically detects delimiters and headers based on file content.
1718
- **Flexible Settings**: Customizable delimiter and comment prefix.
1819
- **Two Display Modes**:
1920
- `highlight`: Highlights delimiters.
@@ -263,6 +264,55 @@ lua require('csvview').setup()
263264

264265
## 📋 Feature Guide
265266

267+
<details>
268+
<summary><strong>Display Configuration</strong></summary>
269+
270+
#### Display Modes
271+
272+
**Highlight Mode (Default)**
273+
274+
Highlights delimiter characters in place:
275+
276+
```lua
277+
{
278+
view = {
279+
display_mode = "highlight",
280+
},
281+
}
282+
```
283+
284+
**Border Mode**
285+
286+
Replaces delimiters with vertical borders (``):
287+
288+
```lua
289+
{
290+
view = {
291+
display_mode = "border",
292+
},
293+
}
294+
```
295+
296+
**Toggle display modes:**
297+
298+
```vim
299+
:CsvViewEnable display_mode=highlight
300+
:CsvViewEnable display_mode=border
301+
```
302+
303+
#### Column Layout
304+
305+
```lua
306+
{
307+
view = {
308+
min_column_width = 5, -- Minimum width for each column
309+
spacing = 2, -- Space between columns
310+
},
311+
}
312+
```
313+
314+
</details>
315+
266316
<details>
267317
<summary><strong>Delimiter Configuration & Auto-Detection</strong></summary>
268318

@@ -329,9 +379,6 @@ The plugin automatically detects the most appropriate delimiter by analyzing you
329379
}
330380
```
331381

332-
> [!NOTE]
333-
> Multi-character delimiters are supported (e.g., `||`, `::`, `<>`), but regular expression patterns are not supported (e.g., `\s+`).
334-
335382
#### Command-line Delimiter Options
336383

337384
```vim
@@ -347,54 +394,7 @@ The plugin automatically detects the most appropriate delimiter by analyzing you
347394
:CsvViewEnable delimiter=\t " Tab
348395
```
349396

350-
</details>
351-
352-
<details>
353-
<summary><strong>Display Configuration</strong></summary>
354-
355-
#### Display Modes
356-
357-
**Highlight Mode (Default)**
358-
359-
Highlights delimiter characters in place:
360-
361-
```lua
362-
{
363-
view = {
364-
display_mode = "highlight",
365-
},
366-
}
367-
```
368-
369-
**Border Mode**
370-
371-
Replaces delimiters with vertical borders (``):
372-
373-
```lua
374-
{
375-
view = {
376-
display_mode = "border",
377-
},
378-
}
379-
```
380-
381-
**Toggle display modes:**
382-
383-
```vim
384-
:CsvViewEnable display_mode=highlight
385-
:CsvViewEnable display_mode=border
386-
```
387-
388-
#### Column Layout
389-
390-
```lua
391-
{
392-
view = {
393-
min_column_width = 5, -- Minimum width for each column
394-
spacing = 2, -- Space between columns
395-
},
396-
}
397-
```
397+
**NOTE** : Multi-character delimiters are supported (e.g., `||`, `::`, `<>`), but regular expression patterns are not supported (e.g., `\s+`).
398398

399399
</details>
400400

@@ -573,28 +573,6 @@ In this example:
573573
:CsvViewEnable quote_char=
574574
```
575575

576-
#### Multi-line Field Support
577-
578-
Quoted fields can span multiple lines:
579-
580-
```csv
581-
id,description
582-
1,"This is a long
583-
description that spans
584-
multiple lines"
585-
2,"Another field"
586-
```
587-
588-
Configure the parser for multi-line fields:
589-
590-
```lua
591-
{
592-
parser = {
593-
max_lookahead = 50, -- Maximum lines to search for closing quotes
594-
},
595-
}
596-
```
597-
598576
</details>
599577

600578
<details>
@@ -676,28 +654,6 @@ Only the data rows (`name,age,city`, `John,25,NYC`, `Jane,30,LA`) will be displa
676654
" Multiple comment types (requires Lua configuration)
677655
```
678656

679-
#### Advanced Comment Configuration
680-
681-
```lua
682-
{
683-
parser = {
684-
comments = {
685-
"#", -- Shell/Python style
686-
"//", -- C++ style
687-
"--", -- SQL style
688-
";;", -- Custom comment prefix
689-
},
690-
},
691-
}
692-
```
693-
694-
#### Use Cases
695-
696-
- **Data files with metadata**: Skip header comments explaining the data format
697-
- **Generated CSV files**: Ignore generator information or timestamps
698-
- **Configuration files**: Skip documentation lines in CSV-like config files
699-
- **Log analysis**: Focus on data rows while ignoring log headers
700-
701657
</details>
702658

703659
## 🌈 Highlights

0 commit comments

Comments
 (0)