Skip to content

Commit

Permalink
Merge pull request #21 from sum01/v3
Browse files Browse the repository at this point in the history
Merge code for V3 (thanks @sum01!)
  • Loading branch information
NicolaiSoeborg authored Jan 10, 2018
2 parents 2797d28 + 6d3035b commit d3b550c
Show file tree
Hide file tree
Showing 7 changed files with 1,353 additions and 309 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

# Ignore .md files, because 2 spaces at end-of-line has meaning
[*.md]
trim_trailing_whitespace = false
44 changes: 0 additions & 44 deletions .gitignore

This file was deleted.

80 changes: 65 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,76 @@

A simple plugin that allows for easy navigation of a file tree.

To install, simply run `plugin install filemanager` and restart Micro.
![Example picture](./example.jpg?raw=true "Example")

Now it will be possible to open a navigation panel by running
the command `tree` (<kbd>Ctrl</kbd> + <kbd>E</kbd>) or creating
a keybinding like so:
```
{
"CtrlW": "filemanager.ToggleTree"
}
```
**Installation:** run `plugin install filemanager` and restart Micro.

## Example
# Table Of Content

![filemanager](https://i.imgur.com/MBou7Hb.png "Filemanager")
* [Basics](#basics)
* [Commands and Keybindings](#commands-and-keybindings)
* [Rebinding](#rebinding-things)
* [In-depth](#commands-in-depth)

## Issues
## Basics

Please use the issue tracker to fill issues or feature requests!
The top line always has the current directory's path to show you where you are.
The `..` near the top is used to move back a directory, from your current position.

All directories have a `/` added to the end of it, and are syntax-highlighted as a `special` character.
If it hasn't been uncompressed, there will be a `+` to the left of it.
If it has been uncompressed, there will be a `-` to the left of it.

### Known Issues
**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.

* Version 2 not backwards compatible, only works on Micro Editor version 1.3.2 and above.
### Commands and Keybindings

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.

| Command | Keybinding(s) | What it does |
| :------- | :------------------------- | :------------------------------------------------------------------------------------------ |
| `tree` | - | Open or close the tree |
| - | <kbd>Tab</kbd> & MouseLeft | Open a file, or go into the directory. Goes back a dir if on `..` |
| - | <kbd>→</kbd> | Uncompress a directory's content under it |
| - | <kbd>←</kbd> | Compress any uncompressed content under a directory |
| - | <kbd>Shift ⬆</kbd> | Go to the target's parent directory |
| - | <kbd>Alt Shift {</kbd> | Jump to the previous directory in the view |
| - | <kbd>Alt Shift }</kbd> | Jump to the next directory in the view |
| `rm` | - | Prompt to delete the target file/directory your cursor is on |
| `rename` | - | Rename the file/directory your cursor is on, using the passed name |
| `touch` | - | Make a new file under/into the file/directory your cursor is on, using the passed name |
| `mkdir` | - | Make a new directory under/into the file/directory your cursor is on, using the passed name |

**Note:** The <kbd>Ctrl w</kbd> keybinding is to switch which buffer your cursor is on.
This isn't specific to the plugin, it's just part of Micro, but many people seem to not know this.

#### Rebinding Things

Do you want to keybind any of the operations/commands/whatever?
The table below specifies what you need to add to your [bindings.json in your Micro config](https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md#rebinding-keys).

| Command/Keybinding | Used in `bindings.json` |
| :------------------------- | :------------------------------------ |
| `tree` | `filemanager.toggle_tree` |
| <kbd>Tab</kbd> & MouseLeft | `filemanager.try_open_at_cursor` |
| <kbd>Shift ⬆</kbd> | `filemanager.goto_parent_dir` |
| <kbd>Alt Shift {</kbd> | `filemanager.goto_next_dir` |
| <kbd>Alt Shift }</kbd> | `filemanager.goto_prev_dir` |
| `rm` | `filemanager.prompt_delete_at_cursor` |
| `rename` | `filemanager.rename_at_cursor` |
| `touch` | `filemanager.new_file` |
| `mkdir` | `filemanager.new_dir` |

#### Commands In-Depth

Note: While these commands are Unix-like, there shouldn't be any issue on non-Unix systems like Windows, and they should still work the same.

* `tree`
This just opens/closes the tree. Nothing special.

* `rm`
It deletes the file/dir after prompting for confirmation. Nothing much to say.

* `rename`, `touch`, and `mkdir`
These require a name to be passed when calling. ex: `rename newnamehere`, `touch filenamehere`, `mkdir dirnamehere`.
If the passed name already exists in the current dir, it will cancel instead of overwriting (for safety).
Binary file added example.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d3b550c

Please sign in to comment.