(require 'fcuny-vars) (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)) (use-package lsp-mode :ensure t :hook ((go-mode . lsp-deferred)) :commands (lsp lsp-deferred) :pretty-hydra ((:title "lsp" :color teal :quit-key "q") ("Connection" (("cc" lsp "start") ("cr" lsp-restart-workspace "restart") ("cd" lsp-describe-session "describe session") ("cq" lsp-disconnect "disconnect")) "Find & Goto" (("fd" lsp-describe-thing-at-point "describe symbol") ("fm" lsp-ui-imenu "imenu") ("ft" lsp-find-type-definition "type definition")) "Refactor" (("rr" lsp-rename "rename") ("ra" lsp-execute-code-action "code action") ("rf" lsp-format-buffer "format")) "Toggles" (("tl" lsp-lens-mode "toggle lens" :toggle t :exit nil)))) :mode-hydra ((go-mode) (:color teal :quit-key "q" :title "Language Server Commands") ("LSP" (("d" lsp-describe-thing-at-point "describe") ("R" lsp-rename "rename") ("A" lsp-execute-code-action "code action") ("F" lsp-format-buffer "format") ("l" lsp-mode-hydra/body "more...")))) :custom (lsp-session-file (expand-file-name "lsp-session-v1" fcuny/path-emacs-var)) (lsp-enable-snippet nil) (lsp-prefer-flymake nil)) (use-package lsp-ui :ensure t :hook (lsp-mode . lsp-ui-mode) :commands lsp-ui-mode :pretty-hydra (lsp-mode-hydra ("Toggles" (("td" lsp-ui-doc-mode "toggle hover doc" :toggle t :exit nil) ("ts" lsp-ui-sideline-mode "toggle sideline" :toggle t :exit nil)) "Find & Goto" (("gr" lsp-ui-peek-find-references "references") ("gd" lsp-ui-peek-find-definitions "definitions")))) :custom (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) (lsp-ui-flycheck-enable t)) (use-package company-lsp :ensure t :commands company-lsp :config (push 'company-lsp company-backends) :custom (company-lsp-enable-snippet t) (company-lsp-cache-candidates t)) (use-package sh-script :mode ("bashrc" . sh-mode) :hook (after-save . executable-make-buffer-file-executable-if-script-p) :config (setq-default sh-indentation 2 sh-basic-offset 2)) (use-package python :mode (("\\.py$" . python-mode) ("\\.aurora$" . python-mode)) :commands python-mode :hook ((python-mode . eldoc-mode)) :custom (python-indent-offset 2)) (use-package make-mode :config (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2)))) (defun fcuny/go-mode-setup () (setq tab-width 4) (setq comment-auto-fill-only-comments t) (setq fill-column 80) (auto-fill-mode 1)) (use-package go-mode :ensure t :hook ((go-mode . fcuny/go-mode-setup) (before-save . lsp-format-buffer) (before-save . lsp-organize-imports)) :config (when (memq window-system '(mac ns)) (exec-path-from-shell-copy-env "GOPATH"))) (use-package gotest :ensure t :mode-hydra (go-mode nil ("Tests" (("tt" go-test-current-test "current test") ("tf" go-test-current-file "current file") ("tp" go-test-current-project "current project"))))) (use-package lisp-mode :bind (("C-c C-e" . eval-buffer) ("C-c C-r" . eval-region))) (provide 'fcuny-prog)