From bf9ef0976f1738db2aa6277f6476783645161dcb Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 30 May 2018 08:32:41 -0700 Subject: [PATCH 1/8] Add some java support to ibuffer --- dotfiles/emacs.d/init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index b646540..72e1acc 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -109,6 +109,9 @@ setq org-log-done t) ("Dev" (or (mode . cc-mode) (filename . ".c") (filename . ".h") + (filename . ".java") + (filename . ".properties") + (filename . ".gradle") (filename . ".am") (mode . yaml-mode)) ) From 9e50a30571393d0878e21748186b9082d62f1d36 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 30 May 2018 09:12:11 -0700 Subject: [PATCH 2/8] Add text section to ibuffer --- dotfiles/emacs.d/init.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 72e1acc..d2522c1 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -100,7 +100,6 @@ setq org-log-done t) ("Org" (or (mode . org-mode) (filename . "OrgMode"))) ("Magit" (name . "magit")) - ("Help" (or (name . "\*Help\*") (name . "\*Apropos\*") (name . "\*info\*"))) @@ -114,7 +113,12 @@ setq org-log-done t) (filename . ".gradle") (filename . ".am") (mode . yaml-mode)) - ) + ) + ("Text" (or (filename . ".csv") + (filename . ".tsv") + (filename . ".txt") + (filename . ".log"))) + ("Emacs" (or (name . "^\\*scratch\\*$") (name . "^\\*Messages\\*$"))) ("Gnus" (or (mode . message-mode) From a2f9f39ea1809765386456e18ee33b6e308715c4 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 30 May 2018 10:30:50 -0700 Subject: [PATCH 3/8] 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 () From 35c3fe1e33c2b8148b9d8b2cf8dd6e4fbafd9843 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 30 May 2018 11:08:50 -0700 Subject: [PATCH 4/8] Get rid of autocomplete enitrely from emacs --- dotfiles/emacs.d/init.el | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 8cac2c0..ef6a3a9 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -282,24 +282,6 @@ setq org-log-done t) (setq projectile-completion-system 'grizzl) ;;------------------------------------------------------------------------------------- -;; Use Grizzl with Projectile -;;------------------------------------------------------------------------------------- - -(setq projectile-completion-system 'grizzl) - - -;;------------------------------------------------------------------------------------- -;; Enable Autocomplete -;; -;; NOTE: You can replace the 't' in (setq ac-auto-start t) with a positive integer -;; to trigger autocompletion only after that number of characters. This will -;; improve performance on slower systems. -;;------------------------------------------------------------------------------------- - -(global-auto-complete-mode t) -(setq ac-auto-start t) - -;;------------------------------------------------------------------------------------- ;; ZSH script detection ;;------------------------------------------------------------------------------------ From 2b6313b396a2e484b7a332dcb278514e724aa860 Mon Sep 17 00:00:00 2001 From: angrygoats Date: Wed, 30 May 2018 12:14:39 -0700 Subject: [PATCH 5/8] update gitingore again... --- .gitignore | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d4363db..3e0780b 100644 --- a/.gitignore +++ b/.gitignore @@ -36,16 +36,19 @@ autoload/ npm-debug.log -dotfiles/config/configstore/update-notifier-nodemon.json +/dotfiles/config/configstore/update-notifier-nodemon.json -dotfiles/config/yarn +/dotfiles/config/yarn -dotfiles/emacs.d/network-security.data +/dotfiles/emacs.d/network-security.data -dotfiles/emacs.d/recentf +/dotfiles/emacs.d/recentf # Wireshark temporary files -dotfiles/config/wireshark/recent -dotfiles/config/wireshark/dfilters -dotfiles/config/wireshark/recent_common +/dotfiles/config/wireshark/recent +/dotfiles/config/wireshark/dfilters +/dotfiles/config/wireshark/recent_common + + + From 0230db5e377f027dcd43e31407bb5d0122f8072f Mon Sep 17 00:00:00 2001 From: angrygoats Date: Wed, 30 May 2018 12:33:23 -0700 Subject: [PATCH 6/8] Stuff for irony --- .gitignore | 8 +++++--- dotfiles/emacs.d/init.el | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3e0780b..fa54c66 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,8 @@ helm-adaptive-history /smex-save-file /recentf +*/emacs.d/irony/* + # nvim specific plugged bundle/** @@ -45,9 +47,9 @@ npm-debug.log /dotfiles/emacs.d/recentf # Wireshark temporary files -/dotfiles/config/wireshark/recent -/dotfiles/config/wireshark/dfilters -/dotfiles/config/wireshark/recent_common +*/dotfiles/config/wireshark/recent +*/dotfiles/config/wireshark/dfilters +*/dotfiles/config/wireshark/recent_common diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index ef6a3a9..a5a7c3e 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -363,6 +363,8 @@ setq org-log-done t) (setq-default c-basic-offset 4) ;; NASA Style Guide says 4 spaces is optimal (setq-default c-default-style "linux") ;; Use Linux code style +(add-hook 'c-mode-hook 'irony-mode) + ;;-------------------------------------------------------------------------------------- ;; Java Mode Setup ;;------------------------------------------------------------------------------------- From c0cc8c7ec96b91666d597f3c86bf863061326ff3 Mon Sep 17 00:00:00 2001 From: angrygoats Date: Wed, 30 May 2018 12:37:20 -0700 Subject: [PATCH 7/8] notes --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 8feed5c..44b9f1b 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,10 @@ The directory structure is as follows: 5. *scripts/diagnostics/* - This directory contains scripts for helping to diagnose problems 3. *installation_instructions* - This file contains a series of command you copy and paste during install of Arch 4. *nix/* - This contains all the stuff needed to get up and running with my nix configuration + +## Emacs Specific Things + +Before programming C, install `global` and `libclang` in your distro. After doing that, run `M-x irony-install-server` to install the server in the emacs directory. +Finally, `cd` to the root of your project and run `gtags`. You now have functioning irony C completion. + +Before programming Java, install `eclim`, and `eclipse`. From 3c7d5303c90ecdf96ec5c62d2b3827b33bc34295 Mon Sep 17 00:00:00 2001 From: angrygoats Date: Wed, 30 May 2018 12:40:52 -0700 Subject: [PATCH 8/8] Add some c mode stuff --- dotfiles/emacs.d/init.el | 9 +++++++++ dotfiles/emacs.d/package.el | 1 + 2 files changed, 10 insertions(+) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index a5a7c3e..1deb76b 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -296,6 +296,8 @@ setq org-log-done t) (add-hook 'after-init-hook 'global-company-mode) + + ;;------------------------------------------------------------------------------------- ;; Alignment ;;------------------------------------------------------------------------------------- @@ -365,6 +367,13 @@ setq org-log-done t) (add-hook 'c-mode-hook 'irony-mode) +;; Backend for Company +(defun my-c-mode-hook () + (eval-after-load 'company + '(add-to-list 'company-backends 'company-irony))) + +(add-hook 'c-mode-hook 'my-c-mode-hook) + ;;-------------------------------------------------------------------------------------- ;; Java Mode Setup ;;------------------------------------------------------------------------------------- diff --git a/dotfiles/emacs.d/package.el b/dotfiles/emacs.d/package.el index 4c960ee..fba1851 100644 --- a/dotfiles/emacs.d/package.el +++ b/dotfiles/emacs.d/package.el @@ -3,6 +3,7 @@ (defvar my-packages '(ag ;; Completion Frameworks company + company-irony eclim irony counsel