Skip to content

Commit b196c2d

Browse files
committed
Move part of README to help file and import it into the help system (thanks to AndrewDDavis)
1 parent 6f3f6d1 commit b196c2d

File tree

3 files changed

+55
-49
lines changed

3 files changed

+55
-49
lines changed

filemanager-plugin/README.md

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,3 @@ A simple plugin that allows for easy navigation of a file tree.
55
![Example picture](./example.jpg?raw=true "Example")
66

77
**Installation:** run `plugin install filemanager` and restart Micro.
8-
9-
## Basics
10-
11-
The top line always has the current directory's path to show you where you are.\
12-
The `..` near the top is used to move back a directory, from your current position.
13-
14-
All directories have a `/` added to the end of it, and are syntax-highlighted as a `special` character.\
15-
If the directory is expanded, there will be a `+` to the left of it. If it is collapsed there will be a `-` instead.
16-
17-
**NOTE:** If you change files without using the plugin, it can't know what you did. The only fix is to close and open the tree.
18-
19-
### Options
20-
21-
| Option | Purpose | Default |
22-
| :--------------------------- | :----------------------------------------------------------- | :------ |
23-
| `filemanager.showdotfiles` | Show dotfiles (hidden if false) | `on` |
24-
| `filemanager.showignored` | Show gitignore'd files (hidden if false) | `on` |
25-
| `filemanager.compressparent` | Collapse the parent dir when left is pressed on a child file | `on` |
26-
| `filemanager.foldersfirst` | Sorts folders above any files | `on` |
27-
| `filemanager.openonstart` | Automatically open the file tree when starting Micro | `off` |
28-
29-
### Commands and Keybindings
30-
31-
The keybindings below are the equivalent to Micro's defaults, and not actually set by the plugin. If you've changed any of those keybindings, then that key is used instead.
32-
33-
If you want to [keybind](https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md#rebinding-keys) any of the operations/commands, bind to the labeled API in the table below.
34-
35-
| Command | Keybinding(s) | What it does | API for `bindings.json` |
36-
| :------- | :------------------------- | :------------------------------------------------------------------------------------------ | :------------------------------------ |
37-
| `tree` | - | Open/close the tree | `filemanager.toggle_tree` |
38-
| - | <kbd>Tab</kbd> & MouseLeft | Open a file, or go into the directory. Goes back a dir if on `..` | `filemanager.try_open_at_cursor` |
39-
| - | <kbd>→</kbd> | Expand directory in tree listing | `filemanager.uncompress_at_cursor` |
40-
| - | <kbd>←</kbd> | Collapse directory listing | `filemanager.compress_at_cursor` |
41-
| - | <kbd>Shift ⬆</kbd> | Go to the target's parent directory | `filemanager.goto_parent_dir` |
42-
| - | <kbd>Alt Shift {</kbd> | Jump to the previous directory in the view | `filemanager.goto_next_dir` |
43-
| - | <kbd>Alt Shift }</kbd> | Jump to the next directory in the view | `filemanager.goto_prev_dir` |
44-
| `rm` | - | Prompt to delete the target file/directory your cursor is on | `filemanager.prompt_delete_at_cursor` |
45-
| `rename` | - | Rename the file/directory your cursor is on, using the passed name | `filemanager.rename_at_cursor` |
46-
| `touch` | - | Make a new file under/into the file/directory your cursor is on, using the passed name | `filemanager.new_file` |
47-
| `mkdir` | - | Make a new directory under/into the file/directory your cursor is on, using the passed name | `filemanager.new_dir` |
48-
49-
#### Notes
50-
51-
- `rename`, `touch`, and `mkdir` require a name to be passed when calling.\
52-
Example: `rename newnamehere`, `touch filenamehere`, `mkdir dirnamehere`.\
53-
If the passed name already exists in the current dir, it will cancel instead of overwriting (for safety).
54-
55-
- The <kbd>Ctrl w</kbd> keybinding is to switch which buffer your cursor is on.\
56-
This isn't specific to the plugin, it's just part of Micro, but many people seem to not know this.

filemanager-plugin/filemanager.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,9 +1362,12 @@ function init()
13621362
config.MakeCommand("mkdir", new_dir, config.NoComplete)
13631363
-- Delete a file/dir, and anything contained in it if it's a dir
13641364
config.MakeCommand("rm", prompt_delete_at_cursor, config.NoComplete)
1365+
13651366
-- Adds colors to the ".." and any dir's in the tree view via syntax highlighting
13661367
-- TODO: Change it to work with git, based on untracked/changed/added/whatever
13671368
config.AddRuntimeFile("filemanager", config.RTSyntax, "syntax.yaml")
1369+
-- Add the help file
1370+
config.AddRuntimeFile("filemanager", config.RTHelp, "help/filemanager.md")
13681371

13691372
-- NOTE: This must be below the syntax load command or coloring won't work
13701373
-- Just auto-open if the option is enabled
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Filemanager Plugin
2+
3+
A simple plugin that allows for easy navigation of a file tree.
4+
5+
## Basics
6+
7+
The top line always has the current directory's path to show you where you are.\
8+
The `..` near the top is used to move back a directory, from your current position.
9+
10+
All directories have a `/` added to the end of it, and are syntax-highlighted as a `special` character.\
11+
If the directory is expanded, there will be a `+` to the left of it. If it is collapsed there will be a `-` instead.
12+
13+
**NOTE:** If you change files without using the plugin, it can't know what you did. The only fix is to close and open the tree.
14+
15+
### Options
16+
17+
| Option | Purpose | Default |
18+
| :--------------------------- | :----------------------------------------------------------- | :------ |
19+
| `filemanager.showdotfiles` | Show dotfiles (hidden if false) | `on` |
20+
| `filemanager.showignored` | Show gitignore'd files (hidden if false) | `on` |
21+
| `filemanager.compressparent` | Collapse the parent dir when left is pressed on a child file | `on` |
22+
| `filemanager.foldersfirst` | Sorts folders above any files | `on` |
23+
| `filemanager.openonstart` | Automatically open the file tree when starting Micro | `off` |
24+
25+
### Commands and Keybindings
26+
27+
The keybindings below are the equivalent to Micro's defaults, and not actually set by the plugin. If you've changed any of those keybindings, then that key is used instead.
28+
29+
If you want to [keybind](https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md#rebinding-keys) any of the operations/commands, bind to the labeled API in the table below.
30+
31+
| Command | Keybinding(s) | What it does | API for `bindings.json` |
32+
| :------- | :------------------------- | :------------------------------------------------------------------------------------------ | :------------------------------------ |
33+
| `tree` | - | Open/close the tree | `filemanager.toggle_tree` |
34+
| - | <kbd>Tab</kbd> & MouseLeft | Open a file, or go into the directory. Goes back a dir if on `..` | `filemanager.try_open_at_cursor` |
35+
| - | <kbd>→</kbd> | Expand directory in tree listing | `filemanager.uncompress_at_cursor` |
36+
| - | <kbd>←</kbd> | Collapse directory listing | `filemanager.compress_at_cursor` |
37+
| - | <kbd>Shift ⬆</kbd> | Go to the target's parent directory | `filemanager.goto_parent_dir` |
38+
| - | <kbd>Alt Shift {</kbd> | Jump to the previous directory in the view | `filemanager.goto_next_dir` |
39+
| - | <kbd>Alt Shift }</kbd> | Jump to the next directory in the view | `filemanager.goto_prev_dir` |
40+
| `rm` | - | Prompt to delete the target file/directory your cursor is on | `filemanager.prompt_delete_at_cursor` |
41+
| `rename` | - | Rename the file/directory your cursor is on, using the passed name | `filemanager.rename_at_cursor` |
42+
| `touch` | - | Make a new file under/into the file/directory your cursor is on, using the passed name | `filemanager.new_file` |
43+
| `mkdir` | - | Make a new directory under/into the file/directory your cursor is on, using the passed name | `filemanager.new_dir` |
44+
45+
#### Notes
46+
47+
- `rename`, `touch`, and `mkdir` require a name to be passed when calling.\
48+
Example: `rename newnamehere`, `touch filenamehere`, `mkdir dirnamehere`.\
49+
If the passed name already exists in the current dir, it will cancel instead of overwriting (for safety).
50+
51+
- The <kbd>Ctrl w</kbd> keybinding is to switch which buffer your cursor is on.\
52+
This isn't specific to the plugin, it's just part of Micro, but many people seem to not know this.

0 commit comments

Comments
 (0)