Compare commits
1 Commits
v0.1.0
...
7640eddb97
Author | SHA1 | Date | |
---|---|---|---|
|
7640eddb97 |
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [0.1.0] - 2025-08-03
|
## [0.1.0] - 2025-08-03
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- add open command
|
|
||||||
- noil now handles open, and open in non-terminals via. /dev/tty
|
- noil now handles open, and open in non-terminals via. /dev/tty
|
||||||
- add file opener with chooser
|
- add file opener with chooser
|
||||||
- update demo
|
- update demo
|
||||||
|
73
README.md
73
README.md
@@ -1,11 +1,8 @@
|
|||||||
# noil
|
# noil
|
||||||
|
|
||||||
**noil** is a structured, text-buffer-based file operation tool – think of it
|
**noil** is a structured, text-buffer-based file operation tool – think of it like [`oil.nvim`](https://github.com/stevearc/oil.nvim), but for any editor, terminal, or automated process.
|
||||||
like [`oil.nvim`](https://github.com/stevearc/oil.nvim), but for any editor,
|
|
||||||
terminal, or automated process.
|
|
||||||
|
|
||||||
Edit filesystem operations like it's plain text, and then apply them in a
|
Edit filesystem operations like it's plain text, and then apply them in a controlled, explicit way.
|
||||||
controlled, explicit way.
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -13,19 +10,17 @@ controlled, explicit way.
|
|||||||
|
|
||||||
## Interactive Mode (TBA)
|
## Interactive Mode (TBA)
|
||||||
|
|
||||||
I am planning an interactive TUI mode, where you don't have to care about tags,
|
I am planning an interactive TUI mode, where you don't have to care about tags, like in `oil`. For now the normal editor is quite useful though, and allows all types of editors to easily move, edit files and so on.
|
||||||
like in `oil`. For now the normal editor is quite useful though, and allows all
|
|
||||||
types of editors to easily move, edit files and so on.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- Edit your file tree like a normal buffer
|
* Edit your file tree like a normal buffer
|
||||||
- Preview, format, and apply changes
|
* Preview, format, and apply changes
|
||||||
- Integrates with `$EDITOR`
|
* Integrates with `$EDITOR`
|
||||||
- CLI first, editor agnostic
|
* CLI first, editor agnostic
|
||||||
- No surprises: nothing is applied until you say so
|
* No surprises: nothing is applied until you say so
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -47,7 +42,7 @@ cat something.noil | noil fmt > something.noil
|
|||||||
cat something.noil | noil apply
|
cat something.noil | noil apply
|
||||||
```
|
```
|
||||||
|
|
||||||
noil will ask you if you want to apply your changes before doing any operations.
|
noil will always ask you if you want to apply your changes before doing any operations.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -61,14 +56,13 @@ Each line follows this format:
|
|||||||
|
|
||||||
### Supported operations:
|
### Supported operations:
|
||||||
|
|
||||||
| Operation | Meaning | Tag Required? |
|
| Operation | Meaning | Tag Required? |
|
||||||
| --------: | ------------------------------------------------------ | ------------- |
|
| --------: | --------------------------------- | ------------- |
|
||||||
| `ADD` | Add new file | ❌ No |
|
| `ADD` | Add new file | ❌ No |
|
||||||
| `COPY` | Copy file with given tag | ✅ Yes |
|
| `COPY` | Copy file with given tag | ✅ Yes |
|
||||||
| `DELETE` | Delete file with given tag | ✅ Yes |
|
| `DELETE` | Delete file with given tag | ✅ Yes |
|
||||||
| `MOVE` | Move file with given tag | ✅ Yes |
|
| `MOVE` | Move file with given tag | ✅ Yes |
|
||||||
| `OPEN` | Open a file with a given tag (requires --chooser-file) | ❌ No |
|
| *(blank)* | Reference existing file (default) | ✅ Yes |
|
||||||
| _(blank)_ | Reference existing file (default) | ✅ Yes |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -79,11 +73,9 @@ Each line follows this format:
|
|||||||
COPY abc : /tmp/nginx-copy
|
COPY abc : /tmp/nginx-copy
|
||||||
DELETE 123 : /etc/nginx
|
DELETE 123 : /etc/nginx
|
||||||
ADD : /new/file.txt
|
ADD : /new/file.txt
|
||||||
OPEN : /new/file.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use short, unique tags (like `abc`, `ng1`, etc.) to refer to files.
|
You can use short, unique tags (like `abc`, `ng1`, etc.) to refer to files. `noil` will generate these tags when you run `noil .`.
|
||||||
`noil` will generate these tags when you run `noil .`.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -95,11 +87,9 @@ Want to clean up alignment and spacing?
|
|||||||
cat my-buffer.noil | noil fmt
|
cat my-buffer.noil | noil fmt
|
||||||
```
|
```
|
||||||
|
|
||||||
Or automatically format inside your editor with the following config for
|
Or automatically format inside your editor with the following config for [Helix](https://helix-editor.com):
|
||||||
[Helix](https://helix-editor.com):
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# .config/helix/languages.toml
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "noil"
|
name = "noil"
|
||||||
scope = "source.noil"
|
scope = "source.noil"
|
||||||
@@ -112,30 +102,8 @@ formatter = { command = "noil", args = ["fmt"] }
|
|||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "noil"
|
name = "noil"
|
||||||
source = { git = "https://git.kjuulh.io/kjuulh/tree-sitter-noil.git", rev = "2f295629439881d0b9e89108a1296881d0daf7b9" }
|
source = { git = "https://git.kjuulh.io/kjuulh/tree-sitter-noil.git", rev = "2f295629439881d0b9e89108a1296881d0daf7b9" }
|
||||||
|
|
||||||
# .config/helix/config.toml
|
|
||||||
# Optional extra command Space + o will open noil allowing edits and the OPEN command
|
|
||||||
[keys.normal.space]
|
|
||||||
o = [
|
|
||||||
":sh rm -f /tmp/unique-file-kjuulh",
|
|
||||||
# DISCLAIMER: Until noil has a proper interactive mode, we cannot ask for confirmation, as such we always commit changes, you don't get to have a preview unlike the normal cli option
|
|
||||||
":insert-output noil edit '%{buffer_name}' --chooser-file=/tmp/unique-file-kjuulh --commit --quiet < /dev/tty",
|
|
||||||
":insert-output echo \"x1b[?1049h\" > /dev/tty",
|
|
||||||
":open %sh{cat /tmp/unique-file-kjuulh}",
|
|
||||||
":redraw",
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Edit options
|
|
||||||
|
|
||||||
When using `noil edit .` a few additional options are available
|
|
||||||
|
|
||||||
- `--chooser-file`: A chooser file is a newline delimited file where each line
|
|
||||||
corresponds to a relative file to be opened or manipulated by the user. Only
|
|
||||||
items with `OPEN` command will be added to the file
|
|
||||||
- `--commit`: commit files without asking for confirmation
|
|
||||||
- `--quiet`: don't print results
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔒 Safety First
|
## 🔒 Safety First
|
||||||
@@ -155,9 +123,7 @@ You will be prompted before anything is modified.
|
|||||||
|
|
||||||
## 🧠 Philosophy
|
## 🧠 Philosophy
|
||||||
|
|
||||||
noil gives you full control over file operations in a composable and
|
noil gives you full control over file operations in a composable and editor-friendly way. Think Git index, but for actual file moves and deletions — human-editable, patchable, and grep-able.
|
||||||
editor-friendly way. Think Git index, but for actual file moves and deletions —
|
|
||||||
human-editable, patchable, and grep-able.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -169,6 +135,7 @@ human-editable, patchable, and grep-able.
|
|||||||
cargo install noil
|
cargo install noil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
**Build from source**:
|
**Build from source**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Reference in New Issue
Block a user