Browse Source

Update emacs to support C/C++ dev

Taylor Bockman 5 years ago
parent
commit
f2fe0fbbc3
  1. 6
      dotfiles/bash/scripts/cgen.sh
  2. 12
      dotfiles/emacs.d/init.el
  3. 1
      dotfiles/emacs.d/package.el

6
dotfiles/bash/scripts/cgen.sh

@ -5,7 +5,11 @@ cmake_version=$2
c_standard=$3
# Finds the directory of this script
script_dir=$(cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`")" && pwd)
if [[ "$OS_TYPE" == "linux-gnu" ]]; then
script_dir=$(cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`")" && pwd)
else
script_dir=$(cd "$( dirname "`greadlink -f ${BASH_SOURCE[0]}`")" && pwd)
fi
if [ -z $name ]
then

12
dotfiles/emacs.d/init.el

@ -156,6 +156,9 @@ There are two things you can do about this warning:
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
(add-hook 'c-mode-hook 'counsel-gtags-mode)
(add-hook 'c++-mode-hook 'counsel-gtags-mode)
(require 'rainbow-delimiters)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
@ -208,6 +211,15 @@ There are two things you can do about this warning:
;; Press <f2> in lisp mode to evaluate the current defun in SLIME.
(define-key lisp-mode-map (kbd "<f2>") 'slime-eval-defun)
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(with-eval-after-load 'counsel-gtags
(define-key counsel-gtags-mode-map (kbd "M-t") 'counsel-gtags-find-definition)
(define-key counsel-gtags-mode-map (kbd "M-r") 'counsel-gtags-find-reference)
(define-key counsel-gtags-mode-map (kbd "M-s") 'counsel-gtags-find-symbol)
(define-key counsel-gtags-mode-map (kbd "M-,") 'counsel-gtags-go-backward))
;;--------------------------------------------------------------------------------------
;; Install and load Packages
;;--------------------------------------------------------------------------------------

1
dotfiles/emacs.d/package.el

@ -69,6 +69,7 @@
grizzl
smex
projectile
counsel-gtags
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
)

Loading…
Cancel
Save