summary refs log tree commit diff
path: root/emacs.d/custom/fcuny-prog.el
blob: 76b65a92a3574c0a6c04f34172da9bea93ce8a12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
(require 'fcuny-vars)

(use-package auto-fill
  :hook (prog-mode . auto-fill-mode)
  :custom
  ;; this does not seem to work ..
  (comment-fill-column 80)
  (comment-auto-fill-only-comments t))

(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)
  :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
  :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))))

(use-package go-mode
  :ensure t
  :hook ((before-save . lsp-format-buffer)
         (before-save . lsp-organize-imports))
  :config
  (when (memq window-system '(mac ns))
    (exec-path-from-shell-copy-env "GOPATH"))
  :custom
  (tab-width 4))

(use-package gotest
  :ensure t)

(use-package lisp-mode
  :bind
  (("C-c C-e" . eval-buffer)
   ("C-c C-r" . eval-region)))

(use-package puppet-mode
  :ensure t
  :bind (:map puppet-mode-map
              ("C-c |" . puppet-align-block)))

(provide 'fcuny-prog)