diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-10-24 12:39:31 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-10-24 12:44:01 +0530 |
commit | 5bebd4ac67c760a846e0b6ff4e49dc338aeed50e (patch) | |
tree | 477cb04f914f82b1cc68c1bf7c8efc462195432d /plugins | |
parent | cb916661c8a7defbdbd579ac14c30d0c679f8fea (diff) | |
download | nnn-5bebd4ac67c760a846e0b6ff4e49dc338aeed50e.tar.gz |
Extend plugin mechanism to arbitrary commands
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/README.md | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/README.md b/plugins/README.md index 5c16676..7986fdb 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -66,6 +66,10 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`. You ca With this, plugin `fzy-open` can be run with the keybind <kbd>:o</kbd>, `mocplay` can be run with <kbd>:p</kbd> and so on... The key vs. plugin pairs are shown in the help and config screen. Up to 10 plugins can have such keybinds. +To assign keys to arbitrary commands (non-shell interpreted) and invoke like plugins, add `_` (underscore) before the command. For example: + + export NNN_PLUG='x:_chmod +x;o:fzy-open' + **Method 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. ## Create your own plugins @@ -105,7 +109,7 @@ There are many plugins provided by `nnn` which can be used as examples. Here are #!/usr/bin/env sh git log -p -- "$1" ``` - + - Change to directory in clipboard using helper script ```sh #!/usr/bin/env sh @@ -121,13 +125,13 @@ There are many plugins provided by `nnn` which can be used as examples. Here are nnn_cd "$(dirname $(readlink -fn $1))" 0 ``` - + - Change to arbitrary directory without helper script ```sh #!/usr/bin/env sh echo -n "cd to: " read dir - + echo -n "0$dir" > $NNN_PIPE ``` |