diff --git a/contrib/ranger-control/Readme.md b/contrib/ranger-control/Readme.md new file mode 100644 index 000000000000..051d8fcdf123 --- /dev/null +++ b/contrib/ranger-control/Readme.md @@ -0,0 +1,7 @@ +# Ranger Control + +This module hooks into the command server in MacRanger to add the command ` p d` +which adds a special `e` tab in ranger that is in the current projectile directory. + +Currently this functionality only works with MacRanger but I plan on making it a plugin +that anyone can install into their ranger. diff --git a/contrib/ranger-control/config.el b/contrib/ranger-control/config.el new file mode 100644 index 000000000000..07291d281cd3 --- /dev/null +++ b/contrib/ranger-control/config.el @@ -0,0 +1,2 @@ +(evil-leader/set-key + "pc" 'ranger-control/projectile-cd) diff --git a/contrib/ranger-control/funcs.el b/contrib/ranger-control/funcs.el new file mode 100644 index 000000000000..0e618cfcbdc2 --- /dev/null +++ b/contrib/ranger-control/funcs.el @@ -0,0 +1,12 @@ +(defun ranger-control/cd-tab (path) + (start-process "ranger-control-curl" nil "curl" "-X" "POST" "--data" path + "--connect-timeout" "0.1" "http://localhost:5964/cdtab-e")) + +(defun ranger-control/kill-result-buffer (status) + "Kill the buffer returned by `url-retrieve'." + (kill-buffer (current-buffer))) + +(defun ranger-control/projectile-cd () + (interactive) + (use-package projectile :init + (ranger-control/cd-tab (projectile-project-root))))