about summary refs log tree commit diff
path: root/emacs/wc-helm-functions.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-06-18T17·23-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-06-18T17·23-0400
commit1ccaee9fa9e26898c62d9f9ac0eb208855a86330 (patch)
treef297d27079b5da8396c35a2877e2100e185e0de4 /emacs/wc-helm-functions.el
parent6d13881ec2b28b899a9aea45b2ffd520235cf2ed (diff)
Adds finer-grain control over Linum Mode
Diffstat (limited to 'emacs/wc-helm-functions.el')
-rw-r--r--emacs/wc-helm-functions.el78
1 files changed, 78 insertions, 0 deletions
diff --git a/emacs/wc-helm-functions.el b/emacs/wc-helm-functions.el
new file mode 100644
index 000000000000..52319f18da5e
--- /dev/null
+++ b/emacs/wc-helm-functions.el
@@ -0,0 +1,78 @@
+(defvar wc/helm-git-tracked-staged
+  (helm-build-in-buffer-source "Tracked, Staged"
+    :candidates (shell-command-to-string "git --no-pager diff --name-only --staged")
+    :action 'wc/handle-branch))
+
+
+(defvar wc/helm-print-default-directory
+  (helm-build-in-buffer-source "Tracked, Staged"
+    :candidates (lambda () '((default-directory)))
+    :action 'wc/handle-branch))
+
+
+(defvar wc/helm-git-tracked-unstaged
+  (helm-build-in-buffer-source "Tracked, Unstaged"
+    :candidates (shell-command-to-string "git --no-pager diff --name-only")
+    :action 'wc/handle-branch))
+
+
+(defvar wc/helm-git-untracked-unstaged
+  (helm-build-in-buffer-source "Untracked, Unstaged"
+    :candidates (shell-command-to-string "git ls-files --others --exclude-standard")
+    :action 'wc/handle-branch))
+
+
+(defun wc/helm-git-altered-files ()
+  "View a categorized list of altered files within a project."
+  (interactive)
+  (helm :sources '(wc/helm-print-default-directory
+                   ;; wc/helm-git-tracked-staged
+                   ;; wc/helm-git-tracked-unstaged
+                   ;; wc/helm-git-untracked-unstaged
+                   )
+        :buffer "*helm git altered files*"))
+
+
+(defun wc/helm-git-branches ()
+  "Reverse-I search using Helm."
+  (interactive)
+  (helm :sources (helm-build-in-buffer-source "test1"
+                 :data (wc/git-branches)
+                 :action 'wc/handle-branch)
+      :buffer "*helm git branches*"))
+
+
+(defun wc/open-terminals ()
+  "Lists active terminal buffers."
+  (interactive)
+  (helm :sources (helm-build-in-buffer-source "test1"
+                 :data (wc/list-project-terminals)
+                 :action 'switch-to-buffer)
+      :buffer "*helm projectile terminals*"))
+
+
+(defun wc/helm-autojump ()
+  "Helm interface to autojump."
+  (interactive)
+  (helm :sources (helm-build-in-buffer-source "test1"
+                 :data (wc/autojump-directories)
+                 :action (lambda (path) (wc/exec-cmd (format "cd %s" path))))
+      :buffer "*helm git branches*"))
+
+
+(defun wc/helm-shell-history ()
+  "Reverse-I search using Helm."
+  (interactive)
+  (helm :sources (helm-build-in-buffer-source "test1"
+                 :data (wc/shell-history)
+                 :action 'wc/exec-cmd)
+      :buffer "*helm shell history*"))
+
+
+(defun wc/helm-ctrl-t-find-files ()
+  "Fuzzily searches files within a directory."
+  (interactive)
+  (helm :sources (helm-build-in-buffer-source "test1"
+                 :data (shell-command-to-string "ag --hidden --ignore .git -l -g \"\"")
+                 :action 'term-send-raw-string)
+      :buffer "*helm CTRL_T find files *"))