Browse Source

Update emacs to support C/C++ dev

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

4
dotfiles/bash/scripts/cgen.sh

@ -5,7 +5,11 @@ cmake_version=$2
c_standard=$3 c_standard=$3
# Finds the directory of this script # Finds the directory of this script
if [[ "$OS_TYPE" == "linux-gnu" ]]; then
script_dir=$(cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`")" && pwd) 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 ] if [ -z $name ]
then 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 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-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) (require 'rainbow-delimiters)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode) (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. ;; Press <f2> in lisp mode to evaluate the current defun in SLIME.
(define-key lisp-mode-map (kbd "<f2>") 'slime-eval-defun) (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 ;; Install and load Packages
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------

1
dotfiles/emacs.d/package.el

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

Loading…
Cancel
Save