diff --git a/Emacs/emacsConfig.txt b/Emacs/emacsConfig.txt index f857ed1..6c0e5f8 100644 --- a/Emacs/emacsConfig.txt +++ b/Emacs/emacsConfig.txt @@ -52,7 +52,7 @@ ;; Emacs Notes ;; C-h k to find what a key does ;; C-h b to list all bindings (should've used this more when fighting binds...) - +;; C-q = quoted-insert "insert the next character, whatever it is" e.g. useful for inserting ;; Enable MELPA (require 'package) @@ -148,10 +148,42 @@ ;; powerline-vim-theme ;; powerline-nano-theme +;; Instead of wrapping at character, wrap at word. This slightly improves readability +(setq visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow)) +(global-visual-line-mode 1) + +;; After wrapping, try to line up the text with the wrapped line column +(define-globalized-minor-mode my-global-adaptive-wrap-mode adaptive-wrap-prefix-mode + (lambda () (adaptive-wrap-prefix-mode 1))) +(my-global-adaptive-wrap-mode 1) + ;; C indentation settings ;; bsd AKA Allman https://www.emacswiki.org/emacs/IndentingC (setq c-default-style "bsd" - c-basic-offset 4) + c-basic-offset 4 + tab-width 4 + indent-tabs-mode t) + +;; Doesn't quite work +;; (defun infer-indentation-style () +;; ;; if our source file uses tabs, we use tabs, if spaces spaces, and if +;; ;; neither, we use the current indent-tabs-mode +;; (let ((space-count (how-many "^ " (point-min) (point-max))) +;; (tab-count (how-many "^\t" (point-min) (point-max)))) +;; (if (> space-count tab-count) +;; ;; ((message "Indent using space") +;; (setq indent-tabs-mode nil)) +;; (if (> tab-count space-count) +;; ;; ((message "Indent using tab") +;; (setq indent-tabs-mode t)))) + +;; (add-hook 'c-mode-common-hook +;; (lambda () (setq indent-tabs-mode nil) +;; (infer-indentation-style))) + +;; (add-hook 'lisp-mode-hook +;; (lambda () (setq indent-tabs-mode nil) +;; (infer-indentation-style))) ;; Detect which indentation style a file is using and use that (doesn't work) (setq dtrt-indent-mode 1) diff --git a/Emacs/emacsPackages.txt b/Emacs/emacsPackages.txt index 1134be8..c08233e 100644 --- a/Emacs/emacsPackages.txt +++ b/Emacs/emacsPackages.txt @@ -27,3 +27,4 @@ ac-etags 20161001.807 installed etags/ctags completion so xah-find 20180310.450 installed find replace in pure emacs lisp. Purpose similar to grep/sed. yasnippet 20180412.1548 installed Yet another snippet extension for Emacs. zenburn-theme 2.1 installed A low contrast color theme for Emacs. + adaptive-wrap