Update docs

This commit is contained in:
Arun Prakash Jana 2019-09-06 20:03:48 +05:30
parent bde0f5c354
commit cea542b515
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 9 additions and 9 deletions

View File

@ -42,15 +42,6 @@ Download the `getplugs` plugin and execute it anywhere to get all the plugins in
**NOTE:** `getplugs` also downloads the launcher `nlaunch` and tries to place it at `/usr/local/bin/` using `sudo`. If it fails you have to place `nlauch` manually somewhere in your `$PATH`.
## File access from plugins
Plugins can access:
- all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin)
- the current file under the cursor (the file name is passed as the argument to a plugin)
- the current selection (by reading the file `.selection` in config dir, see the plugin `ndiff`)
Each script has a _Description_ section which provides more details on what the script does, if applicable.
## Usage
There are 2 ways to run plugins:
@ -63,6 +54,15 @@ There are 2 ways to run plugins:
2. Use the _pick plugin_ shortcut to visit the plugin directory and execute a plugin. Repeating the same shortcut cancels the operation and puts you back in the original directory.
## File access from plugins
Plugins can access:
- all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin)
- the current file under the cursor (the file name is passed as the argument to a plugin)
- the current selection (by reading the file `.selection` in config dir, see the plugin `ndiff`)
Each script has a _Description_ section which provides more details on what the script does, if applicable.
## Create your own plugins
Plugins are scripts and all scripting languages should work. However, POSIX-compliant shell scripts runnable in `sh` are preferred. If that's too rudimentary for your use case, use Python, Perl or Ruby.