summary refs log tree commit diff
path: root/emacs.d/custom/fcuny-prog.el
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2020-01-13 14:15:31 -0800
committerFranck Cuny <franck.cuny@gmail.com>2020-01-13 14:15:31 -0800
commitb5dd649f07998b289e90862d74d6fb8e046345a8 (patch)
tree33db6640420e3e55b6115723a032248b3782e0cc /emacs.d/custom/fcuny-prog.el
parentemacs/text: flyspell configuration. (diff)
downloademacs.d-b5dd649f07998b289e90862d74d6fb8e046345a8.tar.gz
emacs/prog: more cleanup for lsp/go.
A few changes to the configuration related to go, mostly to drop some
code that is not needed anymore.

Add a few more bindings for LSP.

Add `company-posframe`, which is a nicer UI for company.
Diffstat (limited to 'emacs.d/custom/fcuny-prog.el')
-rw-r--r--emacs.d/custom/fcuny-prog.el22
1 files changed, 18 insertions, 4 deletions
diff --git a/emacs.d/custom/fcuny-prog.el b/emacs.d/custom/fcuny-prog.el
index 92dd9c7..b895807 100644
--- a/emacs.d/custom/fcuny-prog.el
+++ b/emacs.d/custom/fcuny-prog.el
@@ -3,17 +3,27 @@
 (use-package company
   :ensure t
   :diminish company-mode
-
   :custom
   (company-minimum-prefix-length 2)
   (company-tooltip-align-annotations t)
   (company-tooltip-limit 12)
   (company-idle-delay 1))
 
+(use-package company-posframe
+  :ensure t
+  :diminish company-posframe-mode
+  :hook (company-mode . company-posframe-mode)
+  :after company)
+
 (use-package lsp-mode
   :ensure t
   :commands (lsp lsp-deferred)
-  :hook (go-mode . lsp-deferred)
+  :bind (:map lsp-mode-map
+              ("C-c e b" . lsp-format-buffer)
+              ("C-c e m" . lsp-ui-imenu)
+              ("C-c e r" . lsp-rename)
+              ("C-c e p" . lsp-ui-peek-find-references)
+              ("C-c e t" . lsp-find-type-definition))
   :custom
   (lsp-session-file (expand-file-name "lsp-session-v1" fcuny/path-emacs-var))
   (lsp-enable-snippet nil)
@@ -23,7 +33,8 @@
   :ensure t
   :commands lsp-ui-mode
   :custom
-  (lsp-ui-doc-enable t)
+  (lsp-ui-doc-enable nil)
+  (lsp-ui-doc-include-signature t)
   (lsp-ui-peek-enable t)
   (lsp-ui-sideline-enable t)
   (lsp-ui-imenu-enable t)
@@ -34,6 +45,9 @@
   :after company
   :commands company-lsp
   :config
-  (push 'company-lsp company-backends))
+  (push 'company-lsp company-backends)
+  :custom
+  (company-lsp-enable-snippet t)
+  (company-lsp-cache-candidates t))
 
 (provide 'fcuny-prog)