Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLee18 authored Oct 31, 2024
1 parent bc4d4fc commit 117c4e3
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,41 @@ Generated output is like this:

![42 header sample](sample.png)

This program is actually built to be used as a [Zed](https://zed.dev) Task. Let me tell you how.
~~This program is actually built to be used as a [Zed](https://zed.dev) Task. Let me tell you how.~~

1. download cli from release page.
2. edit a Zed Task file (such as `~/.config/zed/tasks.json`) like this:
~~1. download cli from release page.~~
~~2. edit a Zed Task file (such as `~/.config/zed/tasks.json`) like this:~~
```json
[
{
"label": "Inject 42 Header",
"command": "your/path/to/inject_42h",
"args": ["--name", "<name>", "--email", "<email>", "--path", "$ZED_FILE"]
"label": "...",
"command": "...",
"args": ["...", ...]
}
]
```
3. Press Alt + Shift + T to spawn task. your task should be right there.
~~3. Press Alt + Shift + T to spawn task. your task should be right there.~~

**However, I'm happy to tell you that this executable now works with [norminette LSP](https://github.com/DavidLee18/norminette_lsp) for Zed!**
This means if you do some config, then when you save file, [Norminette extension](https://github.com/DavidLee18/zed_norminette) will **automatically update your 42 header!**
now you have to do:
1. download executable from release page.
2. install "Norminette" extension in Zed.
3. in your Zed's `settings.json`, create or add like following, to the `"lsp"`:
```json
"lsp": {
...
"c-norminette": {
"initialization_options": {
"path": "/path/to/inject_42h",
"name": "<42 Intra ID>",
"email": "<42 Intra Email>",
"offset": 9 // timezone offset to UTC. positive for +, negative for -
}
},
...
}
```
4. **enjoy!**

the extension will download and execute the LSP for Norminette, and when you save the file, the 42 header will be created or updated automatically!

0 comments on commit 117c4e3

Please sign in to comment.