Skip to content

Commit

Permalink
Merge pull request #59 from trishume/ranger-control
Browse files Browse the repository at this point in the history
MacRanger Control Contrib Module
  • Loading branch information
syl20bnr committed Oct 31, 2014
2 parents 0018c3e + f837bd5 commit b6d0756
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/ranger-control/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ranger Control

This module hooks into the command server in MacRanger to add the command `<SPC> 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.
2 changes: 2 additions & 0 deletions contrib/ranger-control/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(evil-leader/set-key
"pc" 'ranger-control/projectile-cd)
12 changes: 12 additions & 0 deletions contrib/ranger-control/funcs.el
Original file line number Diff line number Diff line change
@@ -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))))

0 comments on commit b6d0756

Please sign in to comment.