Simplify and add emacs config
This commit is contained in:
27
xdg/emacs/modes/c-mode.el
Normal file
27
xdg/emacs/modes/c-mode.el
Normal file
@ -0,0 +1,27 @@
|
||||
;; New Keybindings
|
||||
(define-key c-mode-base-map (kbd "<f11>") 'compile)
|
||||
(define-key c-mode-base-map "\C-c\C-c" 'compile)
|
||||
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
|
||||
(define-key c-mode-base-map (kbd "C-c SPC") 'hs-toggle-hiding)
|
||||
|
||||
;; Syntax hilighting
|
||||
(setq c-default-style "stroustrup")
|
||||
|
||||
;; Bury the compile buffer when finished compiling. Function in lisp/functions.el
|
||||
(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful)
|
||||
|
||||
;; Define Tab width
|
||||
(setq truncate-lines 1)
|
||||
(setq tab-width 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
|
||||
;; Make backspace and C-d delete whitespace
|
||||
(c-toggle-hungry-state t)
|
||||
|
||||
;; When using a new enough version of emacs, use many gdb windows.
|
||||
(when (or (> emacs-major-version 23)
|
||||
(and (= emacs-major-version 23)
|
||||
(>= emacs-minor-version 2)))
|
||||
;; Use the GDB visual debugging moden
|
||||
(setq gdb-many-windows t)
|
||||
)
|
||||
7
xdg/emacs/modes/go-mode-custom.el
Normal file
7
xdg/emacs/modes/go-mode-custom.el
Normal file
@ -0,0 +1,7 @@
|
||||
;; Bury the compile buffer when finished compiling. Function in lisp/functions.el
|
||||
(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful)
|
||||
|
||||
(add-hook 'before-save-hook #'gofmt-before-save)
|
||||
|
||||
;; Define Tab width
|
||||
(setq truncate-lines t)
|
||||
13
xdg/emacs/modes/mode-hooks.el
Normal file
13
xdg/emacs/modes/mode-hooks.el
Normal file
@ -0,0 +1,13 @@
|
||||
; Hooks to enable custom modes
|
||||
(add-to-list 'auto-mode-alist '("\\.cu\\'" . c++-mode))
|
||||
|
||||
; Settings for Text mode
|
||||
(add-hook 'text-mode-hook 'auto-fill-mode)
|
||||
(add-hook 'text-mode-hook 'flyspell-mode)
|
||||
|
||||
; Settings for C++ mode (and I guess C as well)
|
||||
(add-hook 'c-mode-common-hook (lambda () (load "~/.emacs.d/modes/c-mode.el")))
|
||||
(add-hook 'c-mode-common-hook 'hs-minor-mode)
|
||||
|
||||
;; Terraform mode hooks
|
||||
(add-hook 'terraform-mode-hook 'terraform-format-on-save-mode)
|
||||
Reference in New Issue
Block a user