Added a readme and license.
This commit is contained in:
parent
a49613f7e9
commit
9c0f4d7b37
19
LICENSE.md
Normal file
19
LICENSE.md
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
Copyright (c) 2015-2020 Leon Mika
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
68
README.md
Normal file
68
README.md
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
# ted - Terminal Table Editor
|
||||||
|
|
||||||
|
TED is an editor for editing tabular data, like CSVs. It's like a spreadsheet without the calculation logic. It's inspired by Vim and was developed to easily update CSV files without leaving the terminal.
|
||||||
|
|
||||||
|
This project is still in it's early phases, and on a bit of a slow burn in terms of development. I tend to only work on it when I use it, which is not very often. However, it's still in a form of maintenance so feel free to use it and post feedback.
|
||||||
|
|
||||||
|
## Downloading
|
||||||
|
|
||||||
|
For those with Go:
|
||||||
|
|
||||||
|
```
|
||||||
|
go get github.com/lmika/ted
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
ted <csvfile>
|
||||||
|
```
|
||||||
|
|
||||||
|
Can either be a new CSV file, or an existing CSV file.
|
||||||
|
|
||||||
|
TED is similar to Vim in that it is modal. After opening a file, the editor starts off in view mode, which permits navigating around.
|
||||||
|
|
||||||
|
## Keyboard Keys
|
||||||
|
|
||||||
|
Moving around:
|
||||||
|
|
||||||
|
| Key | Modifier | `i` | `j` | `k` | `l` |
|
||||||
|
|:-----------|:-----------|:-----|:-----|:-----|:-----|
|
||||||
|
| Movement by single cell | (none) | Up | Left | Down | Right |
|
||||||
|
| Movement by a page | Shift | Up 25 rows | Left 15 cells | Down 25 rows | Right 15 cells |
|
||||||
|
| Movement to boundary | Ctrl | Top row | Leftmost cell | Bottom row | Rightmost cell |
|
||||||
|
|
||||||
|
You can also use the arrows to move by a single cell.
|
||||||
|
|
||||||
|
Editing:
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
|:-----------|:--------------------|
|
||||||
|
| `e` | Edit cell value |
|
||||||
|
| `r` | Replace cell value |
|
||||||
|
| `a` | Insert row below cursor and edit value |
|
||||||
|
| `D` | Delete current row |
|
||||||
|
|
||||||
|
Others:
|
||||||
|
|
||||||
|
| Key | Action |
|
||||||
|
|:-----------|:--------------------|
|
||||||
|
| `{` | Reduce cell width |
|
||||||
|
| `}` | Increase cell width |
|
||||||
|
| `/` | Search for cell matching regular expression |
|
||||||
|
| `n` | Find next cell matching search |
|
||||||
|
| `:` | Enter command |
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
Commands can be entered by pressing `:` and typing in the command or alias.
|
||||||
|
|
||||||
|
| Command | Alias | Description |
|
||||||
|
|:----------------|:-----------|:------------------------|
|
||||||
|
| `save` | `w` | Save the current file. |
|
||||||
|
| `quit` | `q` | Quit the application without saving changes. |
|
||||||
|
| `save-and-quit` | `wq` | Save the current file and quit the application. |
|
||||||
|
| `open-down` | | Insert a new row below the currently selected row. |
|
||||||
|
| `open-right` | | Insert a new column to the right of the currently selected column. |
|
||||||
|
| `delete-row` | | Delete the currently selected row. |
|
||||||
|
| `delete-column` | | Delete the currently selected column. |
|
||||||
|
|
@ -186,7 +186,7 @@ func (cm *CommandMapping) RegisterViewCommands() {
|
||||||
|
|
||||||
ctx.Session().UIManager.Redraw()
|
ctx.Session().UIManager.Redraw()
|
||||||
|
|
||||||
return ctx.Session().Commands.Eval(ctx, "set-cell")
|
return ctx.Session().Commands.Eval(ctx, "edit-cell")
|
||||||
})
|
})
|
||||||
|
|
||||||
cm.Define("inc-col-width", "Increase the width of the current column", "", func(ctx *CommandContext) error {
|
cm.Define("inc-col-width", "Increase the width of the current column", "", func(ctx *CommandContext) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue