Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
xarthurx 2018-02-06 20:35:32 +01:00
commit 256121655e
8 changed files with 32 additions and 21 deletions

View file

@ -93,7 +93,8 @@ immediately runs it on the current candidate (ending the ivy session)."
[remap yank-pop] #'counsel-yank-pop [remap yank-pop] #'counsel-yank-pop
[remap info-lookup-symbol] #'counsel-info-lookup-symbol [remap info-lookup-symbol] #'counsel-info-lookup-symbol
[remap imenu] #'counsel-imenu [remap imenu] #'counsel-imenu
[remap recentf-open-files] #'counsel-recentf) [remap recentf-open-files] #'counsel-recentf
[remap org-capture] #'counsel-org-capture)
:config :config
(set! :popup "^\\*ivy-occur" '((size . 0.35)) '((transient . 0) (quit))) (set! :popup "^\\*ivy-occur" '((size . 0.35)) '((transient . 0) (quit)))

View file

@ -194,7 +194,7 @@ Uses `shrink-window-if-larger-than-buffer'."
window--sides-inhibit-check nil) window--sides-inhibit-check nil)
(+popup|cleanup-rules) (+popup|cleanup-rules)
(dolist (prop +popup-window-parameters) (dolist (prop +popup-window-parameters)
(map-delete prop window-persistent-parameters))))) (map-delete window-persistent-parameters prop)))))
;;;###autoload ;;;###autoload
(define-minor-mode +popup-buffer-mode (define-minor-mode +popup-buffer-mode

View file

@ -488,16 +488,7 @@ created."
(setq +workspaces--project-dir default-directory)) (setq +workspaces--project-dir default-directory))
;;;###autoload ;;;###autoload
(defun +workspaces|switch-counsel-project-action (project) (defun +workspaces|switch-to-project (&optional inhibit-prompt)
"A `counsel-projectile-switch-project-action' that creates a dedicated
workspace for a new project, before prompting to open a file."
(when persp-mode
(let ((+workspaces--project-dir project)
(inhibit-message t))
(+workspaces|switch-to-project))))
;;;###autoload
(defun +workspaces|switch-to-project ()
"Creates a workspace dedicated to a new project. If one already exists, switch "Creates a workspace dedicated to a new project. If one already exists, switch
to it. Should be hooked to `projectile-after-switch-project-hook'." to it. Should be hooked to `projectile-after-switch-project-hook'."
(when (and persp-mode +workspaces--project-dir) (when (and persp-mode +workspaces--project-dir)
@ -516,7 +507,8 @@ to it. Should be hooked to `projectile-after-switch-project-hook'."
(+workspace-switch new-name) (+workspace-switch new-name)
(unless persp-p (unless persp-p
(switch-to-buffer (doom-fallback-buffer))) (switch-to-buffer (doom-fallback-buffer)))
(doom-project-find-file +workspaces--project-dir) (unless inhibit-prompt
(doom-project-find-file +workspaces--project-dir))
(+workspace-message (+workspace-message
(format "Switched to '%s' in new workspace" new-name) (format "Switched to '%s' in new workspace" new-name)
'success))) 'success)))
@ -527,6 +519,14 @@ to it. Should be hooked to `projectile-after-switch-project-hook'."
;; Advice ;; Advice
;; ;;
;;;###autoload
(defun +workspaces*switch-counsel-project-action (project)
"A `counsel-projectile-switch-project-action' that creates a dedicated
workspace for a new project, before prompting to open a file."
(let ((+workspaces--project-dir project)
(inhibit-message t))
(+workspaces|switch-to-project 'inhibit-prompt)))
;;;###autoload ;;;###autoload
(defun +workspaces*autosave-real-buffers (orig-fn &rest args) (defun +workspaces*autosave-real-buffers (orig-fn &rest args)
"Don't autosave if no real buffers are open." "Don't autosave if no real buffers are open."

View file

@ -98,8 +98,8 @@ Uses `+workspaces-main' to determine the name of the main workspace."
(add-hook 'delete-frame-functions #'+workspaces|delete-associated-workspace) (add-hook 'delete-frame-functions #'+workspaces|delete-associated-workspace)
;; per-project workspaces ;; per-project workspaces
(setq projectile-switch-project-action #'+workspaces|set-project-action (setq projectile-switch-project-action #'+workspaces|set-project-action)
counsel-projectile-switch-project-action #'+workspaces|switch-counsel-project-action) (advice-add #'counsel-projectile-switch-project-by-name :before #'+workspaces*switch-counsel-project-action)
(add-hook 'projectile-after-switch-project-hook #'+workspaces|switch-to-project) (add-hook 'projectile-after-switch-project-hook #'+workspaces|switch-to-project)
;; ;;

View file

@ -13,3 +13,7 @@
(def-package! flycheck-crystal (def-package! flycheck-crystal
:after crystal-mode :after crystal-mode
:config (add-hook 'crystal-mode-hook #'flycheck-mode)) :config (add-hook 'crystal-mode-hook #'flycheck-mode))
(def-package! inf-crystal
:commands (inf-crystal crystal-switch-to-inf))

View file

@ -3,4 +3,4 @@
(package! crystal-mode) (package! crystal-mode)
(package! flycheck-crystal) (package! flycheck-crystal)
(package! inf-crystal)

View file

@ -11,13 +11,19 @@
(package! org-download)) (package! org-download))
(when (featurep! +babel) (when (featurep! +babel)
(package! ob-go)
(package! ob-mongo) (package! ob-mongo)
(package! ob-redis) (package! ob-redis)
(package! ob-restclient)
(package! ob-rust)
(package! ob-sql-mode) (package! ob-sql-mode)
(package! ob-translate)) (package! ob-translate)
(when (featurep! :lang go)
(package! ob-go))
(when (featurep! :lang rust)
(package! ob-rust))
(when (featurep! :lang restclient)
(package! ob-restclient))
(when (featurep! :lang crystal)
(package! ob-crystal)))
(when (featurep! +export) (when (featurep! +export)
(package! ox-pandoc) (package! ox-pandoc)

View file

@ -76,7 +76,7 @@
:desc "Ex command" :nv ";" #'evil-ex :desc "Ex command" :nv ";" #'evil-ex
:desc "M-x" :nv ":" #'execute-extended-command :desc "M-x" :nv ":" #'execute-extended-command
:desc "Pop up scratch buffer" :nv "x" #'doom/open-scratch-buffer :desc "Pop up scratch buffer" :nv "x" #'doom/open-scratch-buffer
:desc "Org Capture" :nv "X" #'+org-capture/open :desc "Org Capture" :nv "X" #'org-capture
;; Most commonly used ;; Most commonly used
:desc "Find file in project" :n "SPC" #'projectile-find-file :desc "Find file in project" :n "SPC" #'projectile-find-file