Skip to content

Commit 4e889f6

Browse files
docs: update readme and add minimal configuration example
1 parent 5142057 commit 4e889f6

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

README.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Neovim integration for [television](https://github.com/alexpasmantier/television).
88

9-
The initial idea behind television was to create something like the popular [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) plugin, but as a standalone terminal application - keeping telescope's modularity without the Neovim dependency, and benefiting from Rust's performance.
9+
The initial idea behind television was to create something like the popular telescope.nvim plugin, but as a standalone terminal application - keeping telescope's modularity without the Neovim dependency, and benefiting from Rust's performance.
1010

1111
This plugin brings Television back into Neovim through a thin Lua wrapper around the binary. It started as a way to dogfood my own project, but might be of interest to other tv enthusiasts as well. Full circle.
1212

@@ -18,18 +18,25 @@ If you're already familiar with [television](https://github.com/alexpasmantier/t
1818
quickfix, copy to clipboard, insert at cursor, checkout with git, etc.) using lua.
1919

2020
### Examples
21-
22-
| text | git-log |
23-
| :--: | :--: |
24-
| <img width="1494" height="974" alt="text" src="https://github.com/user-attachments/assets/4d3d3cf7-6837-48b0-858d-6113bc0b0c3c" /> | <img width="1496" height="977" alt="git-log" src="https://github.com/user-attachments/assets/5f450a3a-47d3-4104-9bdd-41de1a325a27" /> |
25-
| **tldr** | **gh-prs** |
26-
| <img width="1491" height="973" alt="tldr" src="https://github.com/user-attachments/assets/c438d252-d742-44a5-b4c6-b7d931ea11a1" /> | <img width="1495" height="976" alt="gh-prs" src="https://github.com/user-attachments/assets/25d2235b-3827-4cd1-8a6f-a23e2a4690b1" /> |
21+
22+
| text | git-log |
23+
| :--------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: |
24+
| <img width="1494" height="974" alt="text" src="https://github.com/user-attachments/assets/4d3d3cf7-6837-48b0-858d-6113bc0b0c3c" /> | <img width="1496" height="977" alt="git-log" src="https://github.com/user-attachments/assets/5f450a3a-47d3-4104-9bdd-41de1a325a27" /> |
25+
| **tldr** | **gh-prs** |
26+
| <img width="1491" height="973" alt="tldr" src="https://github.com/user-attachments/assets/c438d252-d742-44a5-b4c6-b7d931ea11a1" /> | <img width="1495" height="976" alt="gh-prs" src="https://github.com/user-attachments/assets/25d2235b-3827-4cd1-8a6f-a23e2a4690b1" /> |
27+
28+
<div align="center">
29+
30+
Curious about channels available in television? Check out [this
31+
page](https://alexpasmantier.github.io/television/docs/Users/community-channels-unix).
32+
33+
</div>
2734

2835
## Installation
2936

3037
```lua
3138
-- lazy.nvim
32-
{
39+
{
3340
"alexpasmantier/tv.nvim",
3441
config = function()
3542
require("tv").setup{
@@ -53,6 +60,47 @@ use {
5360

5461
## Configuration
5562

63+
### Basic Setup
64+
65+
Here's a minimal setup example to get you started, which includes configuration for the `files` and `text` channels that
66+
are the most commonly used ones:
67+
68+
```lua
69+
local h = require('tv').handlers
70+
71+
require('tv').setup({
72+
-- per-channel configurations
73+
channels = {
74+
-- `files`: fuzzy find files in your project
75+
files = {
76+
keybinding = '<C-p>', -- Launch the files channel
77+
-- what happens when you press a key
78+
handlers = {
79+
['<CR>'] = h.open_as_files, -- default: open selected files
80+
['<C-q>'] = h.send_to_quickfix, -- send to quickfix list
81+
['<C-s>'] = h.open_in_split, -- open in horizontal split
82+
['<C-v>'] = h.open_in_vsplit, -- open in vertical split
83+
['<C-y>'] = h.copy_to_clipboard, -- copy paths to clipboard
84+
},
85+
},
86+
-- `text`: ripgrep search through file contents
87+
text = {
88+
keybinding = '<leader><leader>',
89+
handlers = {
90+
['<CR>'] = h.open_at_line, -- Jump to line:col in file
91+
['<C-q>'] = h.send_to_quickfix, -- Send matches to quickfix
92+
['<C-s>'] = h.open_in_split, -- Open in horizontal split
93+
['<C-v>'] = h.open_in_vsplit, -- Open in vertical split
94+
['<C-y>'] = h.copy_to_clipboard, -- Copy matches to clipboard
95+
},
96+
},
97+
},
98+
})
99+
100+
```
101+
102+
### Full Configuration
103+
56104
Here's a comprehensive configuration example demonstrating the plugin's capabilities:
57105

58106
```lua

0 commit comments

Comments
 (0)