diff options
| author | Ravi R Kiran <aine.marina@gmail.com> | 2020-02-10 12:50:55 (GMT) |
|---|---|---|
| committer | Ravi R Kiran <aine.marina@gmail.com> | 2020-02-10 12:50:55 (GMT) |
| commit | 80d240f0036b0ed4a041f9c65bbe1e23cf344c11 (patch) | |
| tree | a3b31a62ebbf1d779c9301e9430055ca3d04889e /lisp | |
| parent | 41d2d77d5ddc73e6a9b98047d0a262232b876a76 (diff) | |
| download | dotemacs-80d240f0036b0ed4a041f9c65bbe1e23cf344c11.zip dotemacs-80d240f0036b0ed4a041f9c65bbe1e23cf344c11.tar.gz dotemacs-80d240f0036b0ed4a041f9c65bbe1e23cf344c11.tar.bz2 | |
Switch to posframe and pretty-hydra
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ravi-init-appearance.el | 5 | ||||
| -rw-r--r-- | lisp/ravi-init-cpp.el | 129 | ||||
| -rw-r--r-- | lisp/ravi-init-helm.el | 8 | ||||
| -rw-r--r-- | lisp/ravi-init-insertion.el | 98 | ||||
| -rw-r--r-- | lisp/ravi-init-maps.el | 9 |
5 files changed, 124 insertions, 125 deletions
diff --git a/lisp/ravi-init-appearance.el b/lisp/ravi-init-appearance.el index fbebc1e..c8ccad6 100644 --- a/lisp/ravi-init-appearance.el +++ b/lisp/ravi-init-appearance.el @@ -263,6 +263,11 @@ Delete all whitespace on a successive key press." (which-key-mode)) :defer 10 :diminish which-key-mode) +(use-package which-key-posframe + :after which-key + :config + (which-key-posframe-mode) + (setq which-key-posframe-poshandler #'posframe-poshandler-frame-bottom-center)) (bind-key "C-h a" 'apropos) diff --git a/lisp/ravi-init-cpp.el b/lisp/ravi-init-cpp.el index adb8098..ed124d8 100644 --- a/lisp/ravi-init-cpp.el +++ b/lisp/ravi-init-cpp.el @@ -103,82 +103,6 @@ (setq dummy-h-mode-default-major-mode 'c++-mode))) -;; Bind to f6 later; to do: pretty docstrings -(defhydra rtags-hydra (:color blue :hint nil) - " -^At point^ ^Location^ ^File^ ^Information -^^^^^^^^---------------------------------------------------------------- -_._: symbol _[_: back _p_: dependencies _D_: diagnostics -_,_: references _]_: forward _e_: reparse _S_: summary -_v_: virtuals _L_: copy _E_: preprocess _B_: rtags buffer -_V_: enum value _O_: to offset _C_: compile _h_: class hierarchy -_/_: all references _F_: fixit _I_: imenu _>_: find symbol -_G_: guess function _K_: member _T_: tag list _<_: find references -_X_: fix fixit _Z_: stack _;_: find file _R_: rename symbol -_M_: symbol info _A_: functions _a_: source args _P_: all deps -" - ("." rtags-find-symbol-at-point "find-symbol-at-point") - ("," rtags-find-references-at-point "find-references-at-point") - ("v" rtags-find-virtuals-at-point "find-virtuals-at-point") - ("V" rtags-print-enum-value-at-point "print-enum-value-at-point") - ("/" rtags-find-all-references-at-point "find-all-references-at-point") - ;; ("Y" rtags-cycle-overlays-on-screen "cycle-overlays-on-screen") - (">" rtags-find-symbol "find-symbol") - ("<" rtags-find-references "find-references") - ("[" rtags-location-stack-back "location-stack-back" :exit nil) - ("]" rtags-location-stack-forward "location-stack-forward" :exit nil) - ("Z" rtags-location-stack-visualize "location-stack-visualize") - ("D" rtags-diagnostics "diagnostics") - ("C" rtags-compile-file "compile-file") - ("G" rtags-guess-function-at-point "guess-function-at-point") - ("p" rtags-dependency-tree "dependency-tree") - ("P" rtags-dependency-tree-all "dependency-tree-all") - ("e" rtags-reparse-file "reparse-file") - ("E" rtags-preprocess-file "preprocess-file") - ("R" rtags-rename-symbol "rename-symbol") - ("M" rtags-symbol-info "symbol-info") - ("S" rtags-display-summary-as-message "display-summary") - ("O" rtags-goto-offset "goto-offset") - (";" rtags-find-file "find-file") - ("F" rtags-fixit "fixit") - ("L" rtags-copy-and-print-current-location "copy-and-print-current-location") - ("X" rtags-fix-fixit-at-point "fix-fixit-at-point") - ("B" rtags-show-rtags-buffer "show-rtags-buffer") - ("K" rtags-make-member "make-member") - ("A" rtags-find-functions-called-by-this-function "find-functions-called-by-this-function") - ("I" rtags-imenu "imenu") - ("T" rtags-taglist "taglist") - ("h" rtags-print-class-hierarchy "print-class-hierarchy") - ("a" rtags-print-source-arguments "print-source-arguments")) -(defhydra hydra-cextra (:color blue :hint nil) - " ------------------------------------------------------------------- -_i_: hide ifdef _C-i_: show _b_: hide/show _o_: other file -" - ("i" hide-ifdef-block "hide ifdef") - ("C-i" show-ifdef-block "show ifdef") - ("b" hs-toggle-hiding "hide/show block") - ("o" ff-find-other-file "other file")) -(defhydra cextra-rtags-hydra (:inherit - (hydra-cextra/heads rtags-hydra/heads) - :hint nil - :color blue) - " -^At point^ ^Location^ ^File^ ^Information -^^^^^^^^---------------------------------------------------------------- -_._: symbol _[_: back _p_: dependencies _D_: diagnostics -_,_: references _]_: forward _e_: reparse _S_: summary -_v_: virtuals _L_: copy _E_: preprocess _B_: rtags buffer -_V_: enum value _O_: to offset _C_: compile _h_: class hierarchy -_/_: all references _F_: fixit _I_: imenu _>_: find symbol -_G_: guess function _K_: member _T_: tag list _<_: find references -_X_: fix fixit _Z_: stack _;_: find file _R_: rename symbol -_M_: symbol info _A_: functions _a_: source args _P_: all deps -^^^^^^^------------------------------------------------------------------ -_i_: hide ifdef _C-i_: show _b_: hide/show _o_: other file -" - ) - (use-package cc-mode :mode (("\\.h\\(h\\|xx\\|pp\\)\\'" . c++-mode) @@ -569,10 +493,55 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named (setq hide-ifdef-initially nil) - (if (bound-and-true-p use-rtags-hydra) - (progn - (bind-key "<f6>" 'cextra-rtags-hydra/body c-mode-base-map)) - (bind-key "<f6>" 'hydra-cextra/body c-mode-base-map)) + (pretty-hydra-define ravi/hydra-cextra (:color blue :hint nil) + ("Hide" + (("i" hide-ifdef-block "hide ifdef") + ("C-i" show-ifdef-block "show ifdef") + ("b" hs-toggle-hiding "hide/show block") + ("o" ff-find-other-file "other file")))) + (when (bound-and-true-p use-rtags-hydra) + (pretty-hydra-define+ ravi/hydra-cextra () + ("At point" + (("." rtags-find-symbol-at-point "symbol") + ("," rtags-find-references-at-point "references") + ("v" rtags-find-virtuals-at-point "virtuals") + ("V" rtags-print-enum-value-at-point "enum value") + ("/" rtags-find-all-references-at-point "all references") + ("G" rtags-guess-function-at-point "guess function") + ("X" rtags-fix-fixit-at-point "fix fixit") + ("M" rtags-symbol-info "symbol info")) + + "Location" + (("[" rtags-location-stack-back "back" :exit nil) + ("]" rtags-location-stack-forward "forward" :exit nil) + ("L" rtags-copy-and-print-current-location "copy") + ("O" rtags-goto-offset "to offset") + ("F" rtags-fixit "fixit") + ("K" rtags-make-member "member") + ("Z" rtags-location-stack-visualize "stach") + ("A" rtags-find-functions-called-by-this-function "functions")) + + "File" + (("p" rtags-dependency-tree "dependencies") + ("e" rtags-reparse-file "reparse") + ("E" rtags-preprocess-file "preprocess") + ("C" rtags-compile-file "compile") + ("I" rtags-imenu "imenu") + ("T" rtags-taglist "tag list") + (";" rtags-find-file "find file") + ("a" rtags-print-source-arguments "source args")) + + "Information" + (("D" rtags-diagnostics "diagnostics") + ("S" rtags-display-summary-as-message "summary") + ("B" rtags-show-rtags-buffer "rtags buffer") + ("h" rtags-print-class-hierarchy "class hierarchy") + (">" rtags-find-symbol "find symbol") + ("<" rtags-find-references "find references") + ("R" rtags-rename-symbol "rename symbol") + ("P" rtags-dependency-tree-all "all deps")) + )) + (bind-key "<f6>" 'ravi/hydra-cextra/body c-mode-base-map)) (bind-key "<M-f8>" 'compile-dwim c-mode-base-map) (use-package multi-compile diff --git a/lisp/ravi-init-helm.el b/lisp/ravi-init-helm.el index b4097d3..9ea83db 100644 --- a/lisp/ravi-init-helm.el +++ b/lisp/ravi-init-helm.el @@ -53,6 +53,14 @@ (bind-key "<tab>" 'helm-execute-persistent-action helm-map) (bind-key "H-<tab>" 'helm-select-action helm-map) + (use-package helm-posframe + :config + (helm-posframe-enable) + (setq helm-posframe-parameters '((left-fringe . 10) + (right-fringe . 10) + (width . 1.0))) + (setq helm-posframe-poshandler #'posframe-poshandler-frame-bottom-center)) + (use-package helm-proc :commands helm-proc :init diff --git a/lisp/ravi-init-insertion.el b/lisp/ravi-init-insertion.el index 474e73b..8088273 100644 --- a/lisp/ravi-init-insertion.el +++ b/lisp/ravi-init-insertion.el @@ -127,58 +127,66 @@ ;; To do: enable when moving to emacs 26+ ;; (use-package company-box :hook (company-mode . company-box-mode) :ensure t) - (setq ravi/use-company-box t) - (when ravi/use-company-box - (use-package all-the-icons) - (use-package company-box - :hook (company-mode . company-box-mode) - :config - (setq company-box-icons-unknown (all-the-icons-faicon "question-circle" :height 0.8)) - - (setq company-box-icons-elisp - `(,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8) ;; Function - ,(all-the-icons-faicon "cog" :face font-lock-variable-name-face :height 0.8) ;; Variable - ,(all-the-icons-faicon "cube" :face font-lock-constant-face :height 0.8) ;; Feature - ,(all-the-icons-material "color_lens" :face font-lock-doc-face :height 0.8))) ;; Face - - (setq company-box-icons-yasnippet (all-the-icons-faicon "bookmark" :height 0.8)) - - (setq company-box-icons-lsp - `((1 . ,(all-the-icons-faicon "text-height" :height 0.8)) ;; Text - (2 . ,(all-the-icons-faicon "tags" :face font-lock-function-name-face :height 0.8)) ;; Method - (3 . ,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8)) ;; Function - (4 . ,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8)) ;; Constructor - (5 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Field - (6 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Variable - (7 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Class - (8 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Interface - (9 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Module - (10 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Property - (11 . ,(all-the-icons-material "settings_system_daydream" :height 0.8)) ;; Unit - (12 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Value - (13 . ,(all-the-icons-material "storage" :face font-lock-type-face :height 0.8)) ;; Enum - (14 . ,(all-the-icons-material "closed_caption" :foreground "#009688" :height 0.8)) ;; Keyword - (15 . ,(all-the-icons-material "closed_caption" :height 0.8)) ;; Snippet - (16 . ,(all-the-icons-material "color_lens" :face font-lock-doc-face :height 0.8)) ;; Color - (17 . ,(all-the-icons-faicon "file-text-o" :height 0.8)) ;; File - (18 . ,(all-the-icons-material "refresh" :height 0.8)) ;; Reference - (19 . ,(all-the-icons-faicon "folder-open" :height 0.8)) ;; Folder - (20 . ,(all-the-icons-material "closed_caption" :foreground "#009688" :height 0.8)) ;; EnumMember - (21 . ,(all-the-icons-faicon "square" :face font-lock-constant-face :height 0.8)) ;; Constant - (22 . ,(all-the-icons-faicon "cube" :face font-lock-type-face :height 0.8)) ;; Struct - (23 . ,(all-the-icons-faicon "calendar" :height 0.8)) ;; Event - (24 . ,(all-the-icons-faicon "square-o" :height 0.8)) ;; Operator - (25 . ,(all-the-icons-faicon "arrows" :height 0.8))) ;; TypeParameter - ) - ) + (setq ravi/use-company-box nil) + (if ravi/use-company-box + (progn + (use-package all-the-icons) + (use-package company-box + :hook (company-mode . company-box-mode) + :config + (setq company-box-icons-unknown (all-the-icons-faicon "question-circle" :height 0.8)) + + (setq company-box-icons-elisp + `(,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8) ;; Function + ,(all-the-icons-faicon "cog" :face font-lock-variable-name-face :height 0.8) ;; Variable + ,(all-the-icons-faicon "cube" :face font-lock-constant-face :height 0.8) ;; Feature + ,(all-the-icons-material "color_lens" :face font-lock-doc-face :height 0.8))) ;; Face + + (setq company-box-icons-yasnippet (all-the-icons-faicon "bookmark" :height 0.8)) + + (setq company-box-icons-lsp + `((1 . ,(all-the-icons-faicon "text-height" :height 0.8)) ;; Text + (2 . ,(all-the-icons-faicon "tags" :face font-lock-function-name-face :height 0.8)) ;; Method + (3 . ,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8)) ;; Function + (4 . ,(all-the-icons-faicon "tag" :face font-lock-function-name-face :height 0.8)) ;; Constructor + (5 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Field + (6 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Variable + (7 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Class + (8 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Interface + (9 . ,(all-the-icons-faicon "cube" :foreground "#7C4DFF" :height 0.8)) ;; Module + (10 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Property + (11 . ,(all-the-icons-material "settings_system_daydream" :height 0.8)) ;; Unit + (12 . ,(all-the-icons-faicon "cog" :foreground "#FF9800" :height 0.8)) ;; Value + (13 . ,(all-the-icons-material "storage" :face font-lock-type-face :height 0.8)) ;; Enum + (14 . ,(all-the-icons-material "closed_caption" :foreground "#009688" :height 0.8)) ;; Keyword + (15 . ,(all-the-icons-material "closed_caption" :height 0.8)) ;; Snippet + (16 . ,(all-the-icons-material "color_lens" :face font-lock-doc-face :height 0.8)) ;; Color + (17 . ,(all-the-icons-faicon "file-text-o" :height 0.8)) ;; File + (18 . ,(all-the-icons-material "refresh" :height 0.8)) ;; Reference + (19 . ,(all-the-icons-faicon "folder-open" :height 0.8)) ;; Folder + (20 . ,(all-the-icons-material "closed_caption" :foreground "#009688" :height 0.8)) ;; EnumMember + (21 . ,(all-the-icons-faicon "square" :face font-lock-constant-face :height 0.8)) ;; Constant + (22 . ,(all-the-icons-faicon "cube" :face font-lock-type-face :height 0.8)) ;; Struct + (23 . ,(all-the-icons-faicon "calendar" :height 0.8)) ;; Event + (24 . ,(all-the-icons-faicon "square-o" :height 0.8)) ;; Operator + (25 . ,(all-the-icons-faicon "arrows" :height 0.8))) ;; TypeParameter + ) + )) + (progn + (use-package company-posframe + :config + (company-posframe-mode 1) + :diminish company-posframe-mode)) + ) (unless ravi/use-company-box (use-package company-quickhelp + :disabled t :config (progn (company-quickhelp-mode 1) ;; Enable company-quickhelp only when company-mode is active ;; (unbind-key "M-h" company-quickhelp-mode-map) - (bind-key "M-h" 'company-quickhelp-manual-begin company-active-map))))) + (bind-key "M-h" 'company-quickhelp-manual-begin company-active-map)))) (use-package company-statistics :init diff --git a/lisp/ravi-init-maps.el b/lisp/ravi-init-maps.el index 6654463..fa563cd 100644 --- a/lisp/ravi-init-maps.el +++ b/lisp/ravi-init-maps.el @@ -24,6 +24,15 @@ (use-package hydra :ensure t) +(use-package hydra-posframe + :load-path (lambda () (ravi/emacs-file "site-lisp/hydra-posframe")) + :after hydra + :config + (hydra-posframe-mode) + (setq hydra-posframe-poshandler #'posframe-poshandler-frame-bottom-center) + :diminish hydra-posframe-mode) +(use-package pretty-hydra + :after hydra) (use-package operate-on-number :bind (("M-g M-d" . hydra-operate-on-number/body)) |
