Move binding specs into :bind, other random tweaks

This commit is contained in:
Ivan Malison 2016-05-13 16:53:55 -07:00
parent d5f3e7593e
commit bf9b86b3cc

View File

@ -1744,11 +1744,13 @@ marking if it still had that."
(use-package helm-ag (use-package helm-ag
:bind ("C-c p S" . imalison:set-helm-ag-extra-options) :bind ("C-c p S" . imalison:set-helm-ag-extra-options)
:config :config
(defun imalison:set-helm-ag-extra-options () (progn
(interactive) (setq helm-ag-always-set-extra-option nil)
(let ((option (read-string "Extra options: " (or helm-ag--extra-options "") (defun imalison:set-helm-ag-extra-options ()
'helm-ag--extra-options-history))) (interactive)
(setq helm-ag--extra-options option))))) (let ((option (read-string "Extra options: " (or helm-ag--extra-options "")
'helm-ag--extra-options-history)))
(setq helm-ag--extra-options option))))))
:config :config
(progn (progn
(setq helm-split-window-default-side 'same) (setq helm-split-window-default-side 'same)
@ -1911,8 +1913,17 @@ window is active in the perspective."
(use-package projectile (use-package projectile
:demand t :demand t
:config :bind (("C-x f" . projectile-find-file-in-known-projects)
("C-c p f" . imalison:projectile-find-file)
:map projectile-command-map
("C-c p s" . imalison:do-ag)
("C-c p f" . imalison:projectile-find-file))
:preface
(progn (progn
(defun imalison:do-ag (&optional arg)
(interactive "P")
(if arg (helm-do-ag) (helm-projectile-ag)))
(defun projectile-make-all-subdirs-projects (directory) (defun projectile-make-all-subdirs-projects (directory)
(cl-loop for file-info in (directory-files-and-attributes directory) (cl-loop for file-info in (directory-files-and-attributes directory)
do (when (nth 1 file-info) do (when (nth 1 file-info)
@ -1920,10 +1931,16 @@ window is active in the perspective."
(expand-file-name (expand-file-name
(concat directory "/" (concat directory "/"
(nth 0 file-info) "/.projectile")))))) (nth 0 file-info) "/.projectile"))))))
(setq helm-ag-always-set-extra-option nil) (defun imalison:projectile-find-file (arg)
(defun imalison:do-ag (&optional arg) (interactive "P")
(interactive "P") (if arg
(if arg (helm-do-ag) (helm-projectile-ag))) (projectile-find-file-other-window)
(projectile-find-file))))
:config
(progn
(use-package persp-projectile
:commands projectile-persp-switch-project)
(projectile-global-mode) (projectile-global-mode)
(setq projectile-require-project-root nil) (setq projectile-require-project-root nil)
(setq projectile-enable-caching nil) (setq projectile-enable-caching nil)
@ -1937,20 +1954,7 @@ window is active in the perspective."
(unbind-key "C-c p s g" projectile-command-map) (unbind-key "C-c p s g" projectile-command-map)
(unbind-key "C-c p s s" projectile-command-map) (unbind-key "C-c p s s" projectile-command-map)
(unbind-key "C-c p s" projectile-command-map) (unbind-key "C-c p s" projectile-command-map)
(unbind-key "C-c p f" projectile-command-map) (unbind-key "C-c p f" projectile-command-map)))
(bind-key* "C-c p s" 'imalison:do-ag)
(bind-key* "C-c p f" 'imalison:projectile-find-file)
(defun imalison:projectile-find-file (arg)
(interactive "P")
(if arg
(projectile-find-file-other-window)
(projectile-find-file))))
:bind (("C-x f" . projectile-find-file-in-known-projects)
("C-c p f" . imalison:projectile-find-file))
:init
(progn
(use-package persp-projectile
:commands projectile-persp-switch-project)))
(use-package smex (use-package smex
;; Using helm-M-x instead ;; Using helm-M-x instead