aboutsummaryrefslogblamecommitdiffstats
path: root/emacs/init.el
blob: 432b77247d61dd963be916a24863d55f5f79892a (plain) (tree)
1
2
3
4
5
6
7
8
9





                                                                      

                                                                 
                                  
 
 




                                                                              
                    




                                                             

                   
 












                                                                             

                                                   


                          

                                                                             
                           
                                        



                                                                        


                                                  
 















                                                                                                
;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments. 
(package-initialize)


;; Enable the upcase-region function which is disabled by default
(put 'upcase-region 'disabled nil)


;; Never show the startup screen (go to scratch if there is no file specified)
(custom-set-variables '(inhibit-startup-screen t))


;; Display column number after line number
(column-number-mode)


;; Configure and display clock
(setq display-time-string-forms
      '((propertize (concat " " 24-hours ":" minutes " ") )))
(display-time-mode)


; (set-default-font "-misc-fixed-medium-r-normal--13-*-75-75-c-70-iso8859-1")
;; TODO set-default-font stopped working

; (blink-cursor-mode 0)
; (setq visible-bell t)
; (scroll-bar-mode 0)
; (tool-bar-mode 0)
; (menu-bar-mode 0)

;(custom-set-faces
;  '(default ((t (:background "#101064" :foreground "#FFFFFF"))))
;  '(fringe ((t (:background "#101064")))))

(set-face-foreground 'font-lock-comment-face "red")


;; Fix up C mode
;;;; disable electric mode
(add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1)))
(add-hook 'c-mode-hook (lambda () (electric-indent-local-mode)))
;;;; use tab as indentation
(defvaralias 'c-basic-offset 'tab-width)
;; TODO trailing whitespaces are removed even where I want them


;; TODO I can probably remove these, do not remember why they were added
(global-set-key (kbd "DEL") 'backward-delete-char)
(setq c-backspace-function 'backward-delete-char)


;; Version control configurations
(setq vc-follow-symlinks nil)  ; Do not follow symlinks in version control
(setq vc-handled-backends nil) ; Do not use version control features


;; Addition rules for major mode selection
(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode))  ; arch linux build scripts
(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode))  ; alpine linux build scripts
(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist))   ; OpenCL source files



;; Load configurations from installed for other packages
((lambda ()
  (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
    (load-file file))))