~aodag/dotfiles

ref: 289340ee0614b010c15eabfbb5a03526c840cfd6 dotfiles/config/emacs/init.el -rw-r--r-- 2.8 KiB
289340eeAtsushi Odagiri lsp for typescript 5 months ago
                                                                                
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
96
97
98
99
100
101
102
103
104
105
106
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))

;; basic preference
(load-theme 'tango-dark t)
(set-face-attribute 'default nil :family "Noto Sans Mono CJK JP" :height 120)
(set-face-attribute 'variable-pitch nil :family "Noto Sans CJK JP" :height 120)
(menu-bar-mode -1)
(tool-bar-mode -1)
(setq-default indent-tabs-mode nil)

(use-package mozc
  :ensure t
  :init
  (setq default-input-method "japanese-mozc"))

;; server
(use-package server
  :config
  (unless (server-running-p) (server-start)))

(use-package which-key
  :ensure t
  :config
  (which-key-mode))

;; ido
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
(use-package ido-vertical-mode
  :init
  (setq ido-vertical-define-keys 'C-n-and-C-p-only)
  :ensure t
  :config
  (ido-vertical-mode 1))
(use-package smex
  :ensure t
  :config
  (smex-initialize)
  :bind (("M-x" . smex)
	 ("M-X" . smex-major-mode-commands)
	 ("C-c C-c M-x" . execute-extended-command)))

;; develop
(use-package magit
  :ensure t)
(use-package git-gutter
  :ensure t
  :config
  (global-git-gutter-mode t))
(use-package projectile
  :ensure t
  :config
  (projectile-mode +1)
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))

;; modes
(use-package markdown-mode
  :ensure t)
(use-package go-mode
  :ensure t
  :config
  (add-hook 'before-save-hook 'gofmt-before-save))
(use-package typescript-mode
  :ensure t)
(use-package dockerfile-mode
  :ensure t)
(use-package company
  :ensure t)
(use-package lsp-mode
  :ensure t
  :commands lsp
  :init
  (setq lsp-keymap-prefix "C-c l")
  :hook
  (go-mode . lsp)
  (typescript-mode . lsp))
(use-package lsp-pyright
  :ensure t
  :hook (python-mode . (lambda ()
                         (require 'lsp-pyright)
                         (lsp))))  ; or lsp-deferred
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(use-package)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )