Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

helm locate improvements

  • Loading branch information...
commit e0c283463b77f2a151a8f337c94426fa745974f3 1 parent e8cfe81
@vjohansen authored
Showing with 41 additions and 8 deletions.
  1. +1 −1  vj-copy-paste.el
  2. +40 −7 vj-helm.el
View
2  vj-copy-paste.el
@@ -1,4 +1,4 @@
-
+;; Copy/Paste - The unsolved problem. But files work.
;; Fluxbox on unix
View
47 vj-helm.el
@@ -1,21 +1,42 @@
+(defface helm-selection
+ '((((class color) (background light))
+ (:background "#ddddff" :bold t))
+ (t (:background "#000040" :foreground "white")))
+ "")
+
+;; (defface helm-ff-executable
+;; '((((class color) (background light))
+;; (:foreground "#206020"))
+;; (t (:foreground "green")))
+;; "")
+
(require 'helm-config)
(require 'helm-files)
(require 'helm-buffers)
-(require 'helm-mini) ;; enables C-r in minibuffer
+(require 'helm-misc) ;; enables C-r in minibuffer
;; Added to helm-locate.el
;; (define-key map (kbd "M-]") 'helm-ff-run-toggle-basename)
-(setq helm-c-locate-command "c:/tools/Locate32/Locate.exe %s")
+(if (eq system-type 'windows-nt)
+ (setq helm-c-locate-command "c:/tools/Locate32/Locate.exe %s"))
(setq helm-ff-transformer-show-only-basename nil)
(global-set-key (kbd "M-h") 'vj-helm)
+
(defvar vj-helm-list '(helm-c-source-buffers-list
helm-c-source-recentf
helm-c-source-locate))
+
(defun vj-helm ()
(interactive)
- (helm-other-buffer vj-helm-list "*vj-helm*"))
+ (if current-prefix-arg
+ (if (eq system-type 'windows-nt)
+ (vj-helm-wdsgrep)
+ (vj-helm-local-locate))
+ (helm-other-buffer vj-helm-list "*vj-helm*")))
+
+
;; Desktop search for windows
(defvar helm-source-wdsgrep
@@ -28,10 +49,22 @@
(delayed))
"Source for retrieving files via W. Desktop Search.")
-(add-to-list 'helm-sources 'helm-source-wdsgrep)
-(defun vj-helm-wdsgrep ()
- (interactive)
- (helm-other-buffer '(helm-source-wdsgrep) "*helm Desktop Search*"))
+(if (eq system-type 'windows-nt)
+
+ ;; Windows
+ (defun vj-helm-wdsgrep ()
+ (interactive)
+ (helm-other-buffer '(helm-source-wdsgrep) "*helm Desktop Search*"))
+ ;; else
+ (defun vj-helm-local-locate ()
+ (interactive)
+ (when (not (file-exists-p "~/.vj-locate.db"))
+ (message "Run: updatedb -l 0 -o ~/.vj-locate.db -U ~")
+ (sit-for 2.0))
+ (let ((helm-c-locate-command "locate -d ~/.vj-locate.db -i -r %s"))
+ (helm-other-buffer
+ '(helm-c-source-locate)
+ "*vj-helm-local-locate*"))))
Please sign in to comment.
Something went wrong with that request. Please try again.