]> Sergey Matveev's repositories - nnn.git/commitdiff
Add example: run cmd as plugin to change directory
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 17 Nov 2023 19:29:09 +0000 (00:59 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 17 Nov 2023 19:30:03 +0000 (01:00 +0530)
plugins/README.md

index e20d1bb21b5f44cce71187691c982baea1dc85ee..caff819eabfc3597db12e82c473fe5c4eceaf9b5 100644 (file)
@@ -370,6 +370,10 @@ if [ -n "$pattern" ]; then
 fi
 ```
 
+#### Change directory
+
+    NNN_PLUG='c:!read -r to && [ -n "$to" ] && printf "0c%s" "${to}" > "$NNN_PIPE"*'
+
 ## Contributing plugins
 
 1. Add informative sections like _Description_, _Notes_, _Dependencies_, _Shell_, _Author_ etc. in the plugin.