Browse Source

Upgrade to emacs 27.1, modify bashrc, and make ruby mode play nice with flycheck

master
Taylor Bockman 4 years ago
parent
commit
d26a408415
  1. 17
      README.md
  2. 4
      dotfiles/bash/bashrc
  3. 36
      dotfiles/emacs.d/init.el
  4. 4
      dotfiles/emacs.d/package.el

17
README.md

@ -70,6 +70,23 @@ Finally, `cd` to the root of your project and run `gtags`. You now have function
Before programming Java, install `eclim`, and `eclipse`. Before programming Java, install `eclim`, and `eclipse`.
### Ruby
Ruby makes using emacs a challenge.
Flycheck likes to complain about `bundle exec` even on emacs 27.1+. There are a few things you need to do to make things work nicely:
1. Use `lsp-mode` instead of robe and launch a ruby server with that. For some reason robe gets in the way of things like `.dir-locals.el`.
2. On a per-project basis, put a `.dir-locals.el` file with the following in it:
```
((ruby-mode . ((eval . (setq flycheck-command-wrapper-function
(lambda (command)
(append '("bundle" "exec") command)))))))
```
Which will allow bundle exec to work with flycheck.
## Joe Editor ## Joe Editor
Always build from source to get the latest features. You will need at least Always build from source to get the latest features. You will need at least

4
dotfiles/bash/bashrc

@ -135,6 +135,10 @@ export HISTCONTROL=ignoredups
# If go is installed, set the $GOPATH to the projects directory created above. # If go is installed, set the $GOPATH to the projects directory created above.
if which go > /dev/null; then export GOPATH=$HOME/projects/go; fi if which go > /dev/null; then export GOPATH=$HOME/projects/go; fi
# For emacs 27.1+. This way no matter what config changes or version of emacs
# I find myself on it will always work the same.
export XDG_CONFIG_HOME="${HOME}/.emacs.d"
# ------------ END EXPORTS ------------# # ------------ END EXPORTS ------------#

36
dotfiles/emacs.d/init.el

@ -19,7 +19,9 @@ There are two things you can do about this warning:
(when (< emacs-major-version 24) (when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib ;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/"))))) (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(when (< emacs-major-version 27)
(package-initialize))
(add-to-list 'package-archives (add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t) '("melpa-stable" . "https://stable.melpa.org/packages/") t)
@ -45,6 +47,17 @@ There are two things you can do about this warning:
(setq inhibit-startup-screen t) (setq inhibit-startup-screen t)
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
;; Emacs 27+ Configs
;;--------------------------------------------------------------------------------------
;; Set the directory to the home directory. This has the side effect of making
;; emacs load files from the home directory when called as emacs -nw xyz.
(when (>= emacs-major-version 27)
(setq default-directory "~/")
(setq command-line-default-directory "~/"))
;;--------------------------------------------------------------------------------------
;; Display battery life in modeline ;; Display battery life in modeline
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
@ -119,7 +132,7 @@ There are two things you can do about this warning:
(name . "\*info\*"))) (name . "\*info\*")))
("Dired" (mode . dired-mode)) ("Dired" (mode . dired-mode))
;; Dev has groups for all languages you program in ;; Dev has groups for all languages you program in
("Dev" (or (mode . cc-mode) ("Dev" (or
(filename . ".c") (filename . ".c")
(filename . ".cpp") (filename . ".cpp")
(filename . ".hpp") (filename . ".hpp")
@ -304,13 +317,6 @@ There are two things you can do about this warning:
(require 'rvm) (require 'rvm)
(rvm-use-default) (rvm-use-default)
(add-hook 'ruby-mode-hook 'robe-mode)
(eval-after-load 'company
'(push 'company-robe company-backends))
(add-hook 'robe-mode-hook 'ac-robe-setup)
(advice-add 'inf-ruby-console-auto :before #'rvm-activate-corresponding-ruby) (advice-add 'inf-ruby-console-auto :before #'rvm-activate-corresponding-ruby)
;;;;;;;;;;; C/C++ ;;;;;;;;;;; C/C++
@ -383,10 +389,16 @@ There are two things you can do about this warning:
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(lisp-indent-function (quote common-lisp-indent-function)) '(lisp-indent-function 'common-lisp-indent-function)
'(package-selected-packages '(package-selected-packages
(quote '(arjen-grey-theme oceanic-theme company-lsp projectile smex grizzl flycheck-pos-tip flycheck material-theme expand-region wrap-region rainbow-delimiters powerline linum-relative golden-ratio fill-column-indicator autopair exec-path-from-shell ws-butler yaml-mode python-mode protobuf-mode paredit nasm-mode meson-mode markdown-mode magit gradle-mode gitignore-mode feature-mode counsel company-jedi jedi-core company-emacs-eclim company-irony company ag))
(arjen-grey-theme oceanic-theme company-lsp projectile smex grizzl flycheck-pos-tip flycheck material-theme expand-region wrap-region rainbow-delimiters powerline linum-relative golden-ratio fill-column-indicator autopair exec-path-from-shell ws-butler yaml-mode python-mode protobuf-mode paredit nasm-mode meson-mode markdown-mode magit gradle-mode gitignore-mode feature-mode counsel company-jedi jedi-core company-emacs-eclim company-irony company ag)))) '(safe-local-variable-values
'((eval setq flycheck-command-wrapper-function
(lambda
(command)
(append
'("bundle" "exec")
command))))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.

4
dotfiles/emacs.d/package.el

@ -33,7 +33,6 @@
;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
;; Programming modes ;; Programming modes
cc-mode
feature-mode feature-mode
gitignore-mode gitignore-mode
gradle-mode gradle-mode
@ -50,9 +49,6 @@
;; Rails ;; Rails
rinari rinari
;; Ruby autocomplete
robe
;; RVM support ;; RVM support
rvm rvm
;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;

Loading…
Cancel
Save