Skip to content

Commit

Permalink
Add support for Ranger update that loads directories in plugin folder (
Browse files Browse the repository at this point in the history
…#37)

Ranger added support for loading directories in the plugin folder to master in 994b541f5c91651f7cf25776abddd66159f4886b. Entry python file has to be named `__init__.py`.
  • Loading branch information
cjbassi authored and alexanderjeurissen committed Apr 26, 2019
1 parent b984909 commit db0242f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
.mypy_cache/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RC_FILE=$(RANGER_DIR)/rc.conf
install:
install -d $(PLUGIN_DIR)
install -b devicons.py $(PLUGIN_DIR)/devicons.py
install -b devicons_linemode.py $(PLUGIN_DIR)/devicons_linemode.py
install -b __init__.py $(PLUGIN_DIR)/devicons_linemode.py
grep -q 'default_linemode devicons' $(RC_FILE) || echo '# a plugin that adds file glyphs / icon support to Ranger:' >> $(RC_FILE)
grep -q 'default_linemode devicons' $(RC_FILE) || echo '# https://github.com/alexanderjeurissen/ranger_devicons' >> $(RC_FILE)
grep -q 'default_linemode devicons' $(RC_FILE) || echo 'default_linemode devicons' >> $(RC_FILE)
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ screenshot), this and other NERDfonts and the install instructions for these fon
the following repository: https://github.com/ryanoasis/nerd-fonts

## Install instructions
### Stable method:
A makefile is included to install and uninstall this plugin. to install simply run:
`make install` and to uninstall the plugin run `make uninstall`.

### Experimental method:
Ranger has added support for loading directories in the plugins folder to `master` which makes it easier to install and keep plugins updated.
To install, just clone the repo into the plugins folder:
```bash
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
```
Then add `default_linemode devicons` to your `rc.conf`.
2 changes: 1 addition & 1 deletion devicons_linemode.py → __init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ranger.api
from ranger.core.linemode import LinemodeBase
from plugins.devicons import *
from .devicons import *

@ranger.api.register_linemode
class DevIconsLinemode(LinemodeBase):
Expand Down

0 comments on commit db0242f

Please sign in to comment.