Skip to content

Commit

Permalink
docs: move demo to README
Browse files Browse the repository at this point in the history
  • Loading branch information
anmitsu committed Apr 26, 2021
1 parent 80490cd commit cfb8cd0
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 121 deletions.
118 changes: 0 additions & 118 deletions .github/demo.md

This file was deleted.

123 changes: 120 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Goful is a CUI file manager written in Go.

## Install

### Pre-build releases
### Pre-build binaries

See [releases](https://github.com/anmitsu/goful/releases).

Expand All @@ -33,8 +33,6 @@ See [releases](https://github.com/anmitsu/goful/releases).

## Usage

### [Tutorial Demos](.github/demo.md)

key | function
---------------------|-----------
`C-n` `down` `j` | Move cursor down
Expand Down Expand Up @@ -88,6 +86,125 @@ key | function

For more see [main.go](main.go)

## Demos

### Copy and Move

Copy (default `c`) and move (default `m`) mark (default `space` and invert
`C-space`) files.

![demo_copy](.github/demo_copy.gif)

First input a copy source file name (or path). The default source is a file
name on the cursor. If files are marked, this step is skipped.

Second input a copy destination path and start copy processing. The default
destination is a neighboring directory path.

During processing draws copying file count, size and name, progress percent,
gauge, bps and estimated time of arrival.

If the source file type is a directory, recursively copy. Also copy
modification time and permissions.

Rise a override confirm dialog `[y/n/Y/N]` if the name same as source file
exists in the destination. This dialog means:

* `y` is overwrite only this file
* `n` is not overwrite only this file
* `Y` is overwrite all later file
* `N` is not overwrite all later file

Copy process works asynchronously. And processed in the order if you run
multiple copies.

Note that copy process can not interrupt. If you want to interrupt, please quit
the application (default `q` `Q`).

### Bulk Rename

Bulk renaming (default `R`) for mark (default `space` and invert `C-space`)
files.

Rename by the regexp pattern. Input like the vim substituting style
(regexp/replaced). Display and confirm matched files and replaced names before
rename.

![demo_bulk](.github/demo_bulk.gif)

### Finder (Filtering search)

The finder (default `f` `/`) filters files in the directory.

Input characters recognizes as the regexp. Case insensitive when inputs
lowercase only, on the other hand case sensitive when contains uppercase.

Delete characters by `C-h` and `backspace` (default). Can select input
histories by `M-p` and `M-n` (default).

Other than character inputs (exclude a space) and the finder keymap pass to the
main input.

Hit reset key (default `C-g` `C-[` means `Esc`) to clear filtering.

![demo_finder](.github/demo_finder.gif)

### Glob

Glob is matched by wild card pattern in the current directory (default `g` and
recursive `G`).

Hit reset key (default `C-g` `C-[` means `Esc`) to clear glob patterns.

![demo_glob](.github/demo_glob.gif)

### Layout

Directory windows position are allocated by layouts of tile, tile-top,
tile-bottom, one-row, one-column and fullscreen.

View menu (default `v`), run layout menu and select layout:

![demo_layout](.github/demo_layout.gif)

### Execute Terminal and Shell

Shell mode (default `:` and suspended `;`) runs a terminal and execute shell
such as bash and tmux. The cmdline completion (file names and commands in
$PATH) is available (default `C-i` that means `tab`).

For example, spawns commands by bash in a gnome-terminal new tab:

![demo_shell](.github/demo_shell.gif)

The terminal immediately doesn't close when command finished because check
outputs.

If goful is running in tmux, it creates a new window and executes the command.

### Expand Macro

macro | expanded string
-------------|------------------
`%f` `%F` | File name/path on cursor
`%x` `%X` | File name/path with extension excluded on cursor
`%m` `%M` | Marked file names/paths joined by spaces
`%d` `%D` | Directory name/path on cursor
`%d2` `%D2` | Neighbor directory name/path
`%~f` ... | Expand by non quote
`%&` | Flag to run command in background

The macro is useful if do not want to specify a file name when run the shell.

Macros starts with `%` are expanded surrounded by quote, and those starts with
`%~` are expanded by non quote. The `%~` mainly uses to for cmd.exe.

Use `%&` when background execute the shell such as GUI apps launching.

![demo_macro](.github/demo_macro.gif)

<!-- demo size 120x35 -->

## Customize

Goful don't have a config file, instead you can customize by edit `main.go`.
Expand Down

0 comments on commit cfb8cd0

Please sign in to comment.