-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
97 lines (74 loc) · 3.88 KB
/
init.el
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
(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.
'(default ((t (:family "DejaVu Sans Mono" :foundry "PfEd" :slant normal :weight normal :height 80 :width normal)))))
;;(set-face-attribute 'default nil :height 80)
(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.
'(column-number-mode t)
'(inhibit-startup-screen t)
'(menu-bar-mode nil)
'(package-selected-packages
(quote
(jenkinsfile-mode json-navigator protobuf-mode dockerfile-mode docker-tramp)))
'(scroll-bar-mode nil)
'(tooltip-mode nil))
;;(set-foreground-color "white") ;; foreground color - white
;;(set-background-color "black") ;; background color - black
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)
;; M-x list-faces-display to generate a list of faces
;; M-x list-colors-display to list some of the colors emacs can display
;; (set-face-foreground 'font-lock-comment-face "red1") ;; comments - red
;; add the ~/.emacs.d/lisp directory to the load path
(add-to-list 'load-path "~/.emacs.d/lisp/")
;; do M-x list-packages to bring up a buffer with a list of all packages
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; load the llvm related package
(require 'cmake-mode)
(require 'llvm-mode)
(require 'mlir-mode)
(require 'tablegen-mode)
(require 'bazel-mode)
;; bind "C-c h" to call org-html-export-to-html
(global-set-key (kbd "C-c h") 'org-html-export-to-html)
;; bind "C-c r" to reload the current buffer
(global-set-key (kbd "C-c r") (lambda() (interactive) (revert-buffer t t t) (message "buffer is reloaded")))
;; bind "C-c t" to call toggle-truncate-lines
(global-set-key (kbd "C-c t") 'toggle-truncate-lines)
;; Set thresholds for when emacs wants to auto-split current window into two
;; (like when using gud-gdb or displaying grep results)
;; basically set the thresholds so high that auto-split gets disabled
(setq split-height-threshold 2000)
(setq split-width-threshold 2000)
;; stop emacs from creating "backup~" and "#autosave#" files
(setq make-backup-files nil) ; stop creating backup~ files
(setq auto-save-default nil) ; stop creating #autosave# files
;; the "alist" auto-mode-alist contains the list of all auto-mode associations (i.e. file-extension to emacs-major-mode associations)
;; Do M-x describe-variable on "auto-mode-alist" to see its contents
(setq scroll-step 1) ;; keyboard scroll one line at a time
;; colorize log files generated by ROCm debug
;; got it from here : https://stackoverflow.com/questions/17468696/how-to-recognize-vt-100-escape-sequences-when-reading-a-file
(define-derived-mode fundamental-ansi-mode fundamental-mode "fundamental ansi"
"Fundamental mode that understands ansi colors."
(require 'ansi-color)
(ansi-color-apply-on-region (point-min) (point-max)))
;; enable windmove keybindings (Shift-up/down/left/right to switch between windows)
(windmove-default-keybindings)
;; set python indentation to 2
(add-hook 'python-mode-hook '(lambda () (setq python-indent-offset 2)))