From a2f9f39ea1809765386456e18ee33b6e308715c4 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 30 May 2018 10:30:50 -0700 Subject: [PATCH] Clean up files, fix CC-mode, add eclim to java mode --- dotfiles/emacs.d/init.el | 44 +++++++++++++++++++++-------- dotfiles/emacs.d/package.el | 68 +++++++++++++++++++++++++++++---------------- 2 files changed, 76 insertions(+), 36 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index d2522c1..8cac2c0 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -49,7 +49,7 @@ (setq Inhibit-Splash-Screen t) ;;-------------------------------------------------------------------------------------- -;; Prefer Utf-8 For Buffers +;; Prefer UTF-8 For Buffers ;;-------------------------------------------------------------------------------------- (prefer-coding-system 'utf-8) @@ -241,17 +241,6 @@ setq org-log-done t) (require 'expand-region) (pending-delete-mode t) ; Selected region contents are replaced on typing -;;-------------------------------------------------------------------------------------- -;; CC-Mode Settings -;;------------------------------------------------------------------------------------- - -;; Keep character limit to 80 -(eval-after-load "c" - '(progn - (setq fci-rule-column 80))) - -(setq-default c-basic-offset 4) ;; NASA Style Guide says 4 spaces is optimal -(setq-default c-default-style "linux") ;; Use Linux code style ;;-------------------------------------------------------------------------------------- ;; Line Numbering - Note: Might not look good with files with 10,000 or more lines @@ -320,6 +309,12 @@ setq org-log-done t) (sh-set-shell "zsh")))) ;;------------------------------------------------------------------------------------- +;; Enable and Configure `company-mode` +;;------------------------------------------------------------------------------------ + +(add-hook 'after-init-hook 'global-company-mode) + +;;------------------------------------------------------------------------------------- ;; Alignment ;;------------------------------------------------------------------------------------- @@ -374,6 +369,31 @@ setq org-log-done t) (setq deactivate-mark nil)) (self-insert-command N))) +;;-------------------------------------------------------------------------------------- +;; CC-Mode Settings +;;------------------------------------------------------------------------------------- + +;; Keep character limit to 80 +(eval-after-load "c-mode" + '(progn + (setq fci-rule-column 80))) + +(setq-default c-basic-offset 4) ;; NASA Style Guide says 4 spaces is optimal +(setq-default c-default-style "linux") ;; Use Linux code style + +;;-------------------------------------------------------------------------------------- +;; Java Mode Setup +;;------------------------------------------------------------------------------------- + +(defun my-java-mode-hook () + (require 'eclim) + (eclim-mode t) + (require 'company-emacs-eclim) + (company-emacs-eclim-setup) + ) + +(add-hook 'java-mode-hook 'my-java-mode-hook) + ;;------------------------------------------------------------------------------------- ;; Key Bindings ;;------------------------------------------------------------------------------------- diff --git a/dotfiles/emacs.d/package.el b/dotfiles/emacs.d/package.el index e0aaae0..4c960ee 100644 --- a/dotfiles/emacs.d/package.el +++ b/dotfiles/emacs.d/package.el @@ -1,29 +1,49 @@ (require 'cl) -(defvar my-packages '(ag auto-complete - cc-mode - yaml-mode - markdown-mode - counsel - expand-region - flycheck - grizzl - fill-column-indicator - feature-mode - flycheck-pos-tip - gitignore-mode - golden-ratio - swiper - linum-relative - magit - neotree - paredit - smex - powerline - projectile - wrap-region - rainbow-delimiters - zenburn-theme) +(defvar my-packages '(ag + ;; Completion Frameworks + company + eclim + irony + counsel + swiper + ;;;;;;;;;;;;;;;;;;;;;;;; + + ;; Programming modes + cc-mode + yaml-mode + markdown-mode + gitignore-mode + feature-mode + paredit + magit + ;;;;;;;;;;;;;;;;;;;; + + ;; Navigation + neotree + ;;;;;;;;;;;;; + + ;; UI + fill-column-indicator + golden-ratio + linum-relative + powerline + rainbow-delimiters + zenburn-theme + wrap-region + expand-region + wrap-region + ;;;;; + + ;; Project Interaction/Search/Syntax + flycheck + flycheck-pos-tip + grizzl + smex + projectile + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ) "Packages to make sure are installed") (defun my-packages-installed-p ()