;; Requires: ;; aspell - Spell checking ;; xclip - Copy/Paste ;; Optional: ;; gocode - Go auto complete ;; Enable loading my custom config files (add-to-list 'load-path "~/.emacs.d/configs/") ;; ----------- Default Variables ----------- ;; Global variables (defvar backup-directory (concat user-emacs-directory "backups")) (unless (file-exists-p backup-directory) (make-directory backup-directory)) (setq-default inhibit-startup-screen t column-number-mode t scroll-error-top-bottom t show-paren-delay 0.25 tab-width 4 indent-tabs-mode nil backup-directory-alist `(("." . ,backup-directory)) delete-old-versions t) ;; ----------- Package Managing ----------- (require 'package-loader) ;; Delete selected text when typing (normal editor behavior) (delete-selection-mode t) ;; ------------- Keybindings ------------- (require 'smart-home) (global-set-key (kbd "C-c /") 'comment-or-uncomment-region) (global-set-key (kbd "C-c C-k") 'compile) (global-set-key (kbd "M-") 'backward-list) (global-set-key (kbd "M-") 'forward-list) (global-set-key (kbd "M-") 'racket-backward-up-list) ;; Can't seem to find forward-down-list. ;; Not very important since I would rarely use it anyway ;;(global-set-key (kbd "M-") '?) (global-set-key (kbd "M-") 'kill-sexp) (defun revert-buffer-no-confirm () "Revert buffer without confirmation." (interactive) (revert-buffer :ignore-auto :noconfirm)) (global-set-key (kbd "M-f") 'revert-buffer) (global-set-key (kbd "M-F") 'revert-buffer-no-confirm) ;; ---------- Use X11 clipboard ----------- (use-package xclip :if (executable-find "xclip") :init (add-to-list 'load-path "~/.emacs.d/elpa/xclip-1.4/") :config (xclip-mode 1)) ;; --------- Parentheses Matching --------- (show-paren-mode) (use-package highlight-parentheses :init (define-globalized-minor-mode global-highlight-parentheses-mode highlight-parentheses-mode (lambda () (highlight-parentheses-mode t))) :config (global-highlight-parentheses-mode t)) ;; Use built-in pairing if available. ;; Otherwise install substitute (if (version<= "24.4" emacs-version) (electric-pair-mode) (use-package autopair :config (autopair-global-mode))) ;; ------------ xTerm Mouse ------------ ;; Disable because it became annoying, sounds cool though. (use-package mouse :disabled :config (xterm-mouse-mode t)) ;; ---------- Auto-complete ----------- (use-package company :init (add-hook 'after-init-hook 'global-company-mode) :config (setq company-minimum-prefix-length 2 ;; company-idle-delay nil ;; company-show-numbers t ;; company-tooltip-limit 20 ;; company-dabbrev-downcase nil ) ;; :bind ("C-;" . company-complete-common) ) ;; ---------- Syntax Checking ----------- (use-package flycheck :config (setq flycheck-check-syntax-automatically '(mode-enabled idle-change save))) ;; ----------- Scala Mode ----------- (require 'scala) ;; ---------- Kotlin Mode ----------- (require 'kotlin) ;; ------------ Web Mode ------------ (require 'web) ;; ------------ Git Mode ------------ ;; TODO: make resolving merge conflicts hotkeys not use "^" ;; TODO: Conflict resolution theme is unreadable (when (version<= "24.4" emacs-version) (use-package magit :bind ("C-x g" . magit-status))) ;; ----------- Rust Mode ------------ (require 'rust) ;; ----------- Go Mode ------------- (require 'go) ;; ----------- i3 Support ---------- (use-package i3wm :disabled :if (equal (getenv "DESKTOP_SESSION") "i3")) ;; --------- Racket Mode ---------- (use-package racket-mode) ;; ---------- Tex Mode ------------ (require 'my-tex) ;; ---------- C# Mode ------------- (use-package csharp-mode :if (version<= "24.4" emacs-version)) ;; ------- Markdown Mode ---------- (when (version<= "24.4" emacs-version) (use-package markdown-mode)) ;; ---- StackOverflow Client ------ (require 'stackoverflow) ;; -------- Spellcheck ------------ (require 'spellcheck) ;; -------- REST Client --------- (require 'rest-client) ;; ------- Highlight TODO ------- (require 'todo) ;; ---- Printer Integration ----- (require 'printer) (set-frame-font "DejaVu Sans Mono-10" nil t) (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 (quote (gnu-elpa-keyring-update flycheck-kotlin kotlin-mode hl-todo restclient flyspell-correct-popup sx csharp-mode auctex company-go go-mode flycheck-rust cargo rust-playground rust-mode magit multi-web-mode ensime flycheck company highlight-parentheses xclip auto-package-update 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. ) (put 'downcase-region 'disabled nil)