Skip to content

Commit

Permalink
docs: add docs for rename --cursor and --empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jan 20, 2024
1 parent 2ccb570 commit 93f92d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/configuration/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ If you haven't created and used your own configuration file yet, please see [Con
- rename: Rename a file or directory.

- `--force`: Overwrite the destination file directly if it exists, without showing the confirmation dialog.
- `--cursor`: Specify the cursor position of the renaming input box.
- `"end"`: The end of the filename.
- `"start"`: The start of the filename.
- `"before_ext"`: Before the extension of the filename.
- `--empty`: Empty a part of the filename.
- `"stem"`: Empty the stem. e.g. `"foo.jpg"` -> `".jpg"`.
- `"ext"`: Empty the extension. e.g. `"foo.jpg"` -> `"foo."`.
- `"dot_ext"`: Empty the dot and extension. e.g. `"foo.jpg"` -> `"foo"`.
- `"all"`: Empty the whole filename. e.g. `"foo.jpg"` -> `""`.

You can also use `--cursor` with `--empty`, for example, `rename --empty=stem --cursor=start` will empty the file's stem, and move the cursor to the start.

Which causes the input box content for the filename `foo.jpg` to be `|.jpg`, where "|" represents the cursor position.

- copy: Copy the path of files or directories that are selected or hovered on.

Expand Down
4 changes: 4 additions & 0 deletions docs/plugins/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ You can also use `ui.Paragraph.parse(string)` to parse an [ANSI escape sequence]
Methods (all methods return `self`):

- `ui.Paragraph:style(style)` - Set the style of the paragraph, which accepts a [Style](#uistyle)
- `ui.Paragraph.wrap(wrap)` - Set the wrap of the paragraph, which accepts the following constants:
- `ui.Paragraph.WRAP_NO` - No wrap
- `ui.Paragraph.WRAP` - Wrap at the end of the line
- `ui.Paragraph.WRAP_TRIM` - Wrap at the end of the line, and trim the leading whitespace
- `ui.Paragraph:align(alignment)` - Set the alignment of the paragraph. It accepts the following constants:
- `ui.Paragraph.LEFT`
- `ui.Paragraph.CENTER`
Expand Down

0 comments on commit 93f92d2

Please sign in to comment.