File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,21 @@ vim.api.nvim_exec([[
143
143
]] , false )
144
144
```
145
145
146
- You should also be able to configure it with input from stdin and output to stdout using the ` --stdin ` flag,
147
- but I'm too much of a nvim noob to figure out how to configure it.
146
+ ### Nvim with --stdin
147
+
148
+ You can also use stdin/stdout mode for nvim. This is an example of ` init.lua ` .
149
+
150
+ ``` lua
151
+ -- Create an augroup for tcsort
152
+ local tcsort_group = vim .api .nvim_create_augroup (" tcsort" , { clear = true })
153
+
154
+ -- Create an autocmd for BufWritePre event
155
+ vim .api .nvim_create_autocmd (" BufWritePre" , {
156
+ group = tcsort_group ,
157
+ pattern = " *.templ" ,
158
+ command = " silent! %!tcsort --stdin" ,
159
+ })
160
+ ```
148
161
149
162
## Contributing
150
163
You can’t perform that action at this time.
0 commit comments