Browse Source

emacs lsp init

VHDL Tool 2 years ago
parent
commit
7703d8ce80
1 changed files with 39 additions and 0 deletions
  1. 39 0
      lsp-init.el

+ 39 - 0
lsp-init.el

@@ -0,0 +1,39 @@
1
+(require 'package) 
2
+(add-to-list 'package-archives
3
+             '("melpa" . "https://melpa.org/packages/"))
4
+(when (< emacs-major-version 24)
5
+  ;; For important compatibility libraries like cl-lib
6
+  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
7
+(package-initialize) 
8
+
9
+(custom-set-variables
10
+ ;; custom-set-variables was added by Custom.
11
+ ;; If you edit it by hand, you could mess it up, so be careful.
12
+ ;; Your init file should contain only one such instance.
13
+ ;; If there is more than one, they won't work right.
14
+ '(inhibit-startup-screen t)
15
+ '(package-selected-packages (quote (flycheck use-package))))
16
+(custom-set-faces
17
+ ;; custom-set-faces was added by Custom.
18
+ ;; If you edit it by hand, you could mess it up, so be careful.
19
+ ;; Your init file should contain only one such instance.
20
+ ;; If there is more than one, they won't work right.
21
+ )
22
+
23
+(use-package flycheck
24
+  :ensure t
25
+  :init (global-flycheck-mode))
26
+
27
+(add-to-list 'load-path "~/.emacs.d/lsp-mode")
28
+(with-eval-after-load 'lsp-mode
29
+    (require 'lsp-flycheck))
30
+(require 'lsp-mode)
31
+
32
+(add-hook 'vhdl-mode-hook #'lsp-mode)
33
+
34
+(lsp-define-stdio-client 'vhdl-mode "VHDL" 'stdio (lsp-make-traverser "vhdltool-config.yaml")
35
+			 "VHDL Language Server"
36
+			 '("vhdl-tool" "lsp"))
37
+
38
+(provide 'lsp-vhdl)
39
+